ELF dynamic loader name

John Baldwin jhb at freebsd.org
Mon Jan 14 06:32:35 PST 2008

On Sunday 13 January 2008 02:33:21 pm Tim Kientzle wrote:
> > Instead, the kernel automagically
> > translates ld-elf.so.1 to ld-elf32.so.1 for 32-bit binaries, and gdb is
> > none the wiser.
> Ah!  I see.  So let me see if I understand:
>    * Peter Wemm's concern about gdb is that the library
> reference in the compiled binaries always be "ld-elf.so.1"
> so that the debugger and other system tools can identify
> references to this special library.
>    * The kernel already has logic to translate refs to this
> library to "ld-elf<platform>.so.1" for the single
> special case of i386 on amd64 (even though "i386" seems to
> be spelled "32" in this case).

It's not an arch name.  The '32' is because it is part of the
freebsd32 compat ABI which provides an alternate syscall table
just like ABIs for SVR4, IBCS2, and Linux.  freebsd32 is
not i386-specific, but instead is split into an MI portion
that provides generic 32-bit wrapping for 64-bit platforms
and MD backends (ia32 ABI on amd64 and ia64 for i386 currently).

If you had foo32 and foo64 archs then freebsd32 (and thus
ld-elf32.so.1) would be used on foo64 systems to run foo32

>    * "Side-grades" from i386 to amd64 have the complication of
> having to rename ld-elf.so.1 at some point in the process.
> Failure to do this at the correct point risks breaking the
> entire system.
> It still seems that renaming ld-elf.so.1 to ld-elf-<platform>.so.1
> on disk would solve the side-grade problem (nothing to be renamed,
> only a new ld-elf-amd64.so.1 to install), and the existing
> kernel translation logic could be generalized to allow all
> binaries to refer to ld-elf.so.1, thus addressing the gdb
> problem in the same way it's been handled for this case for
> some time.

I think the side-grade is such a special case (are you going to
side-grade from ia64 to alpha?) that it doesn't warrant changing
the rest of the system.  We don't have /usr/<arch>-bin instead
of /usr/bin.

John Baldwin

More information about the freebsd-current mailing list