From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12709 invoked by alias); 9 Jul 2002 19:37:25 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 12652 invoked from network); 9 Jul 2002 19:37:23 -0000 Received: from unknown (HELO real.realitydiluted.com) (208.242.241.164) by sources.redhat.com with SMTP; 9 Jul 2002 19:37:23 -0000 Received: from localhost.localdomain ([127.0.0.1] helo=realitydiluted.com) by real.realitydiluted.com with esmtp (Exim 3.22 #1 (Red Hat Linux)) id 17S0na-0003AC-00; Tue, 09 Jul 2002 14:37:22 -0500 Message-ID: <3D2B3B72.8030205@realitydiluted.com> Date: Tue, 09 Jul 2002 12:43:00 -0000 From: "Steven J. Hill" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3 MIME-Version: 1.0 To: binutils@sources.redhat.com, gcc@gcc.gnu.org Subject: Understanding the default dynamic interpreter used by binutils/gcc.... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00216.txt.bz2 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" : \ "/usr/lib/libc.so.1") However, gcc has the following in its 'specs' file: %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} 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. -Steve