ELF dynamic loader name

Dag-Erling Smørgrav des at des.no
Sat Jan 5 06:16:33 PST 2008


Tim Kientzle <kientzle at freebsd.org> writes:
> It also seems that your argument applies just as well to ld-elf.so.1
> and ld-elf32.so.1.  Either way, there's more than one ld-elf.so.1, and
> therefore more than one name to keep track of.

We don't embed ld-elf32.so.1 in 32-bit binaries; if we did, we couldn't
run unmodified i386 binaries on amd64, or move i386 binaries built on an
amd64 system to a real i386 system.  Instead, the kernel automagically
translates ld-elf.so.1 to ld-elf32.so.1 for 32-bit binaries, and gdb is
none the wiser.

(see src/sys/sys/imgact_elf.h, src/sys/kern/imgact_elf.c, and the
various instances of Elf_Brandinfo, Elf32_Brandinfo and Elf64_Brandinfo
in the kernel for the precise details of how this is done)

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-current mailing list