This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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]

Re: Chicken-or-egg problem with shared libraries


On Tue, 2006-05-23 at 18:11 -0400, Daniel Jacobowitz wrote:
> I don't think you really understand the problem you're trying to fix -
> what is it, by the way?  Is it related to Alan's comment earlier
> about the function descriptor lookup?
> 
(sigh) You're right...  I didn't look close enough.

The problem I am trying to fix is that this gets executed:

bkpt_at_symbol:
  warning (_("Unable to find dynamic linker breakpoint function.\n"
           "GDB will be unable to debug shared library initializers\n"
           "and track explicitly loaded dynamic code."));

I believe this is executed because although it finds
"_dl_debug_state" (now that Alan made his change to BFD), on a ppc64
system, that symbol is not in the a code section and so it is rejected:

>   sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, SEC_CODE);
                                                       ^^^^^^^^^

The next symbol in the list being looked for is "._dl_debug_state",
which is no longer to be found sense Alan removed the 'dot' symbols a
while back.

I guess I'll have to call "bfd_get_synthetic_symtab()" and look in the
synthetic symtab it creates.  Of course I'll have to first read in the
dynamic symbol table which "bfd_get_synthetic_symtab()" needs.

That should work.  The only down side is that that work is then thrown
away and then repeated when the symbols for the shared object that is
the dynamic loader are read in later.  But for 20 symbols or so, I guess
that's not too bad.

Thanks for setting me straight,

-=# Paul #=-
 


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