This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/" : \
       ABI_64_P (abfd) ? "/usr/lib64/" : \

However, gcc has the following in its 'specs' file:

    %{!dynamic-linker:-dynamic-linker /lib/}}

For little endian Linux platforms, '/lib/' clearly shows up in
all the dynamic binaries. Why isn't '/lib/' 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/' which on my RH7.2 system does not exist
except for '/usr/lib/' which contains:

   /* GNU ld script
      Use the shared library, but some functions are only in
      the static library, so try that secondarily.  */
   GROUP ( /lib/ /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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]