git: kernel ELF: Reimplement Elf Branding, .note.ABI-tag

John Marino marino at crater.dragonflybsd.org
Wed May 11 00:29:40 PDT 2011


commit 315b8b8b77c1101b25fef36483a8d0474a1befb2
Author: John Marino <draco at marino.st>
Date:   Tue May 10 21:17:07 2011 +0200

    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).

Summary of changes:
 sys/cpu/i386/misc/elf_machdep.c         |   44 ++-
 sys/cpu/x86_64/misc/elf_machdep.c       |   43 ++
 sys/emulation/linux/i386/linux_sysvec.c |  207 ++++-----
 sys/kern/imgact_elf.c                   |  714 ++++++++++++++-----------------
 sys/kern/init_main.c                    |   11 +-
 sys/kern/kern_exec.c                    |    2 +
 sys/kern/kern_mib.c                     |    2 -
 sys/sys/imgact_elf.h                    |  105 ++---
 sys/sys/proc.h                          |    2 +-
 sys/sys/systm.h                         |    1 +
 10 files changed, 564 insertions(+), 567 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/315b8b8b77c1101b25fef36483a8d0474a1befb2


-- 
DragonFly BSD source repository





More information about the Commits mailing list