How to make NetBSD-1.2 i386 execute ELF binaries

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Bill&Virginia Hodge » Tue, 28 Jan 1997 04:00:00



Is there any way to get NetBSD-1.2 i386 to load
ELF format binaries from Solaris x86 and Linux?

Thanks,

Bill

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Manuel BOUY » Wed, 29 Jan 1997 04:00:00



> Is there any way to get NetBSD-1.2 i386 to load
> ELF format binaries from Solaris x86 and Linux?

Yes. Put COMPAT_LINUX or COMPAT_SVR4 in your kernel config file (they are
mutually exclusives).
See compat_linux(8) for details (no compat_svr4(8), sorry ! But it is similar
to compat_linux).

--
Manuel Bouyer, MASI, Universite Paris VI.

--

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Paul Newhou » Fri, 31 Jan 1997 04:00:00




Quote:>Yes. Put COMPAT_LINUX or COMPAT_SVR4 in your kernel config file (they are
>mutually exclusives).

Hmmm!  Not very nice of GENERIC to have come with both defined and
not commented as such.

Paul
--
    If you don't have source code, it's firmware.
    Never trust software with a version number ending in ".0".
       -Dave Tweeten (Numerical Aerodynamic Simulation Facility)

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Andrew Whead » Fri, 31 Jan 1997 04:00:00





>>Yes. Put COMPAT_LINUX or COMPAT_SVR4 in your kernel config file (they are
>>mutually exclusives).
>Hmmm!  Not very nice of GENERIC to have come with both defined and
>not commented as such.

They are not mutually exclusive except for ELF binaries so if you
leave both of them defined you can run a.out binaries from both
linux and svr4, and whichever elf-format gets checked first (Linux
as far as I remember) from one or the other system but not both.
Also for newer Versions of NetBSD you need to add: EXEC_ELF32
Cheerio

--
The cost of living hasn't affected its popularity. (Mark Twain)
current release=doc host=netbsd.wifo.uni-mannheim.de \ "NetBSD-current mirror"
hostbase=/mit/ftp/pub/NetBSD base=/usr prefix=/usr backup delete use-rel-suffix

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Matthias Schel » Fri, 31 Jan 1997 04:00:00




Quote:> Yes. Put COMPAT_LINUX or COMPAT_SVR4 in your kernel config file (they are
> mutually exclusives).

They are not. It's just that because there is no good way to determine
under which OS an ELF binary must run NetBSD sometimes has trouble to
identify Linux binaries if both emulations are available.

--
Matthias Scheler                                http://colwyn.owl.de/~tron/

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Frank van der Lind » Sat, 01 Feb 1997 04:00:00



>> Yes. Put COMPAT_LINUX or COMPAT_SVR4 in your kernel config file (they are
>> mutually exclusives).
>They are not. It's just that because there is no good way to determine
>under which OS an ELF binary must run NetBSD sometimes has trouble to
>identify Linux binaries if both emulations are available.

To be more exact: they get in eachothers way for _static_ ELF binaries only.

- Frank

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Bill&Virginia Hodge » Sun, 02 Feb 1997 04:00:00






> >>Yes. Put COMPAT_LINUX or COMPAT_SVR4 in your kernel config file (they are
> >>mutually exclusives).
> >Hmmm!  Not very nice of GENERIC to have come with both defined and
> >not commented as such.
> They are not mutually exclusive except for ELF binaries so if you
> leave both of them defined you can run a.out binaries from both
> linux and svr4, and whichever elf-format gets checked first (Linux
> as far as I remember) from one or the other system but not both.
> Also for newer Versions of NetBSD you need to add: EXEC_ELF32
> Cheerio

> --
> The cost of living hasn't affected its popularity. (Mark Twain)
> current release=doc host=netbsd.wifo.uni-mannheim.de \ "NetBSD-current mirror"
> hostbase=/mit/ftp/pub/NetBSD base=/usr prefix=/usr backup delete use-rel-suffix

I rebuilt kernel specifying:
options         COMPAT_NOMID    # compatibility with 386BSD, BSDI,
NetBSD 0.8,
options         COMPAT_09       # NetBSD 0.9,
options         COMPAT_10       # NetBSD 1.0,
options         COMPAT_11       # NetBSD 1.1,
options         COMPAT_43       # and 4.3BSD
options         TCP_COMPAT_42   # TCP bug compatibility with 4.2BSD

options         COMPAT_SVR4     # binary compatibility with SVR4
options         COMPAT_IBCS2    # binary compatibility with SCO and ISC
options         COMPAT_LINUX    # binary compatibility with Linux
options         COMPAT_FREEBSD  # binary compatibility with FreeBSD

options         EXEC_ELF32      # To execute linux &SVR4  exectables

When I execute I get:
localhost[bin] 67 > file *
acolorman:     ELF 32-bit LSB executable, Intel 80386, version 1
andrewdirs:    ELF 32-bit LSB executable, Intel 80386, version 1
ez:            symbolic link to runapp
ez2ascii:      ELF 32-bit LSB executable, Intel 80386, version 1
ez2html:       symbolic link to runapp
ez2ps:         C shell script text
ezpostprocess: Bourne shell script text
ezprint:       symbolic link to runapp
indexpro:      ELF 32-bit LSB executable, Intel 80386, version 1
printscribe:   C shell script text
recover:       ELF 32-bit LSB executable, Intel 80386, version 1
runapp:        ELF 32-bit LSB executable, Intel 80386, version 1
scribetext:    ELF 32-bit LSB executable, Intel 80386, version 1
toez:          symbolic link to runapp
localhost[bin] 68 > recover
recover: Exec format error. Wrong Architecture.
localhost[bin] 69 >

What am I doing wrong?

 
 
 

How to make NetBSD-1.2 i386 execute ELF binaries

Post by Andrew Whead » Mon, 03 Feb 1997 04:00:00





>> They are not mutually exclusive except for ELF binaries so if you
>> leave both of them defined you can run a.out binaries from both
>> linux and svr4, and whichever elf-format gets checked first (Linux
>> as far as I remember) from one or the other system but not both.

Looking at the source I think svr4 gets first go.

Quote:>options         COMPAT_SVR4     # binary compatibility with SVR4
>options         COMPAT_LINUX    # binary compatibility with Linux

>options         EXEC_ELF32      # To execute linux &SVR4  exectables
>When I execute I get:
>localhost[bin] 67 > file *
>recover:       ELF 32-bit LSB executable, Intel 80386, version 1
>localhost[bin] 68 > recover
>recover: Exec format error. Wrong Architecture.
>localhost[bin] 69 >
>What am I doing wrong?

You are running a statically linked ELF-i386 binary, since there is no
way for the kernel to tell which emulation to run (ELF does not define
a way of differing between os's on the same architecture. In this case the
kernel probe will answer yes-i-run-this on whichever arch (linux/svr4)
is probed first. It will then try to run it in that mode.

So You have a static Linux ELF binary and are probing SVR4 first.

Solution:
* Use dynamically linked binaries.
* Use a.out binaries
* Change the order of the probe (kern/exec_elf32.c I think.)
  and receive the same error for SVR4 static binaries in future.
* Recompile for NetBSD.
Cheerio
--
The cost of living hasn't affected its popularity. (Mark Twain)
current release=doc host=netbsd.wifo.uni-mannheim.de \ "NetBSD-current mirror"
hostbase=/mit/ftp/pub/NetBSD base=/usr prefix=/usr backup delete use-rel-suffix

 
 
 

1. i386 netbsd 1.1, ELF, and Linux

Can I run Linux ELF binaries on NetBSD 1.1 (on an i386 platform)?
I'm trying to run a statically linked Linux ELF binary 'foo'

"ELF 32-bit LSB executable, Intel 80386, version 1"

foo: Exec format error. Wrong Architecture.

I have COMPAT_SVR4 and COMPAT_LINUX turned on in my kernel. Do I need
something else for ELF support? Also, after installing the latest
slackware distribution off of sunsite.unc.edu, ldd-linux fails with
a "bad system call" error. Do I need a different Linux snapshot?
Do I need a newer version of NetBSD?

Thanks in advance,

-- Dirk

2. convert pidhash to list_t

3. What are ELF binaries and how do they differ from non-ELF binaries?

4. Erro Booting

5. oops, I leaked an alpha copy of Bliss (i386-linux-elf binary only)

6. ET6000 and available drivers

7. How to run ELF binaries compiled for i386?

8. Answer Garden

9. oops, I leaked an alpha copy of Bliss (i386-linux-elf binary only)

10. How can execute SVR4 ELF Binaries [?]

11. After ELF Upgrade: /usr/bin/gcc: cannot execute binary file

12. ELF 32 binary won't execute

13. Symbolic Math Package for NetBSD-1.0-i386 or Linux