This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: [Fwd: Solaris shared libs and the ".interp" section]


   From: Ian Lance Taylor <ian at zembu dot com> 
   Date: 15 May 2000 21:28:08 -0700 

      Date: Mon, 15 May 2000 15:59:41 -0700
      From: Michael Snyder <msnyder@cygnus.com>

      GDB uses it to find out where to set the dynamic library
      event breakpoint.  I'm trying to figure out where the
      information comes from.

   That seems an odd way to determine this information.

Well, the canonical way to get the breakpoint location would be via
DT_DEBUG.  The dynamic linker stores the location of its `struct
r_debug' here, which contains a member that contains the address of
the event breakpoint location.  However, when GDB stops the inferior
at the first instruction of the dynamic linker, the DT_DEBUG entry is
not yet set.  So instead GDB has a list of function names in the
various dynamic linkers it supports and sets the breakpoint there.  In
order to do so, it needs a symbol table for the dynamic linker.
GDB reads the symbol table from the interpreter specified in the
".interp" section of the inferior.

I'm not sure whether GDB always does the right thing in all cases.  It
is possible to run a program with a different dynamic linker (by
invoking the dynamic linker directly) and then attach to it.  I
believe that in that case GDB will still use the .interp section for
the name of the dynamic linker, but that's not right.

Mark

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