kernel ELF: Reimplement Elf Branding, .note.ABI-tag
authorJohn Marino <draco@marino.st>
Tue, 10 May 2011 19:17:07 +0000 (21:17 +0200)
committerJohn Marino <draco@marino.st>
Wed, 11 May 2011 07:27:14 +0000 (09:27 +0200)
commit315b8b8b77c1101b25fef36483a8d0474a1befb2
treeec8e595dd229789b3c8dcc2ccaef7ac1831e55b7
parent455468491b77d557da36d217bd902df99eafaf30
kernel ELF: Reimplement Elf Branding, .note.ABI-tag

Static executables built with the GNU gold linker are not recognized as
valid ELF binaries, although the same binaries built by ld linker did
work.

It was suspected that gold was keying off the .note.ABI-tag.  Primitive
support for this tag had been added years ago from NetBSD, and later
Corecode disabled it except for ELF program headers.

I removed all the .note.ABI-tag support that had been added after
DragonFly forked from FreeBSD and ported over FreeBSD's branding logic
and .note.ABI-tag support.  In particular, the branding logic a lot
cleaner now, and will easily support 32-bit binaries on x86_64 should
this feature arise in DragonFly in the future.

With these changes, gold can now build static executables that are
recognized and execute.  The Linuxolator had to be modified to work
with the new branding scheme as well (i386 only).
sys/cpu/i386/misc/elf_machdep.c
sys/cpu/x86_64/misc/elf_machdep.c
sys/emulation/linux/i386/linux_sysvec.c
sys/kern/imgact_elf.c
sys/kern/init_main.c
sys/kern/kern_exec.c
sys/kern/kern_mib.c
sys/sys/imgact_elf.h
sys/sys/proc.h
sys/sys/systm.h