RFC: Changing ELFOSABI_FREEBSD into ELFOSABI_SYSV/ELFOSABI_NONE
Aurelien Jarno
aurelien at aurel32.net
Wed Jan 4 10:00:28 UTC 2006
Robert Millan a écrit :
> On Wed, Jan 04, 2006 at 07:10:14AM +0100, Aurelien Jarno wrote:
> This was added by Bruno. Note that unlike the other kernels (including
> kNetBSD), kFreeBSD is using weird variant of ELF. See what Bruno said:
>
> http://sourceware.org/ml/binutils/2002-07/msg00103.html
>
> rmh at aragorn:~$ ld --help | grep "supported"
> ld: supported targets: elf32-i386 [...]
> ld: supported emulations: elf_i386 [...]
> rmh at io:~$ ld --help | grep "supported"
> ld: supported targets: elf32-i386-freebsd [...]
> ld: supported emulations: elf_i386_fbsd elf_i386 [...]
>
> Gcc is patched to pass a different -m flag for i386-kfreebsd-gnu, see
>
> http://gcc.gnu.org/viewcvs/trunk/gcc/config/i386/kfreebsd-gnu.h?rev=101314&view=markup
>
> and
>
> http://gcc.gnu.org/viewcvs/trunk/gcc/config/i386/linux.h?rev=107347&view=markup
I see the solution would then to change back to the elf32-i386 format.
Note that it may solves some of the problem with some package which
force elf32-i386 as the output format (memtest86 for example).
>>Currently FreeBSD executes the binaries as follow:
>> ELFOSABI_FREEBSD: native
>> ELFOSABI_LINUX: Linux compatibility layer
>> other: error message like 'ELF binary type "0" not known.'
>
>
> They're still elf32-i386-freebsd binaries instead of elf32-i386. AFAIK this
> macro is set to make a distinction. If we're going to use _SYSV, I think we
> should be consistent and fix the kernel to skip the 16 byte label in that case.
We could ignore it only for _SYSV, and keep the actual behaviour for
_FREEBSD.
BTW, I am able to take a GNU/Linux program that does not uses any
library (namely burnK6 from cpuburn), change only the OSABI byte to
FreeBSD and execute it, without using the Linux compatibility layer. So
maybe this is only supported by the kernel. Further tests have to be
done there.
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32 at debian.org | aurelien at aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
More information about the Glibc-bsd-devel
mailing list