This is the mail archive of the
mailing list for the binutils project.
Understanding the default dynamic interpreter used by binutils/gcc....
- From: "Steven J. Hill" <sjhill at realitydiluted dot com>
- To: binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: Tue, 09 Jul 2002 14:37:22 -0500
- Subject: Understanding the default dynamic interpreter used by binutils/gcc....
I am trying to understand the mechanism by with the dynamic linker/loader
fully-qualified name is placed in the '.interp' section. In the binutils,
the 'bfd/elf[32|64]-[ARCH].c' file has a #define ELF_DYNAMIC_INTERPRETER
that gets used in '_bfd_mips_elf_create_dynamic_sections'.
I am interested in the MIPS cross tools and hence we have:
#define ELF_DYNAMIC_INTERPRETER(abfd) \
(ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" : \
ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" : \
However, gcc has the following in its 'specs' file:
For little endian Linux platforms, '/lib/ld.so.1' clearly shows up in
all the dynamic binaries. Why isn't '/lib/ld.so.1' used as the default
case in the above? Secondly, for all the other architectures the path
seems to be invalid. In the i386 case, ELF_DYNAMIC_INTERPRETER is
defined as '/usr/lib/libc.so.1' which on my RH7.2 system does not exist
except for '/usr/lib/libc.so' which contains:
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
Would someone please just give me a quick explanation of the mechanism
that places the final interpreter path/pathname into the output binary's
'.interp' section. Thanks so much.