svn commit: r216200 - in projects/binutils-2.17:
contrib/binutils/bfd
contrib/binutils/gas/config contrib/binutils/ld/emulparams
gnu/usr.bin/binutils/libbfd
sys/boot/ia64/efi sys/boot/ia64/ski sys/...
Dimitry Andric
dim at FreeBSD.org
Wed Dec 8 11:47:37 UTC 2010
On 2010-12-07 14:48, Tijl Coosemans wrote:
> A third alternative :) Stop setting OSABI.
Yes, that looks like a good alternative. It appears the kernel does not
care too much about the OSABI field; if I hand-hack a static executable
to reset the OSABI field to zero (aka 'SYSV'), it runs fine. It is
sufficient that there is a .note.ABI-tag section in the file.
> Looking at the binutils 2.20.1 BFD source the only files in which OSABI
> is set to FreeBSD are: elf32-i386.c, elf64-alpha.c, elf64-sparc.c and
> elf64-x86-64.c. For those architectures FreeBSD is the only OS that sets
> OSABI. Since nobody cares about it maybe FreeBSD shouldn't either. The
> field is redundant anyway given the .note.ABI-tag section.
Indeed. There are some other OSes that seem to care about the field,
but I don't see any real problem with just getting rid of it entirely.
> I noticed the .note.ABI-tag section was missing from the ia64 startup
> code (src/lib/csu/ia64/crt1.S). Adding it should fix the branding
> problem reported on the mailing lists too and then there's no need for
> hacks or special *-freebsd ELF formats.
I verified this patch works on a ia64 box, it even looks nicer in
file(1) output:
test-before: ELF 64-bit LSB executable, IA-64, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped
test-after: ELF 64-bit LSB executable, IA-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.0 (900026), not stripped
So as far as I'm concerned, you can just commit it.
As an aside, I saw that lib/csu/ia64/crti.S and crtn.S miss .ident
statements, and as a whole lib/csu seems a bit inconsistent with those.
Some files use __FBSID(), others plain .ident statements, and yet others
simply use .ascii, and put the ID's in the .rodata segment... I'll have
a look at cleaning that up, I think. :)
More information about the svn-src-projects
mailing list