This is the mail archive of the gdb-patches@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: [PATCH] Handle absence of DT_DEBUG while debugging ld.so


On Mon, Jul 28, 2008 at 08:54:37PM -0300, Luis Machado wrote:
> Hi folks,
> 
> When trying to debug ld.so, we may find that the DT_DEBUG entry in
> the .dynamic section is missing, thus GDB tries to look for the _r_debug
> minimal symbol, and eventually finds it. This works OK as long as the
> _r_debug minimal symbol is correct and initialized.
> 
> In the case where GDB fetches an uninitialized _r_debug minimal symbol
> and tries to access its address, we have a memory access error, just
> like below:
> 
> (gdb) r
> Starting program: /foo/lib/ld.so.1
> Cannot access memory at address 0x2f648
> 
> Thus, we should guard this piece of code against uninitialized addresses
> so that GDB can skip this entry and look for another (hopefully) valid
> _r_debug symbol.

I think this is a PIE-related problem.  It has nothing to do with
uninitialized, because we're just taking the symbol's
address; but the address you've got there looks wrong.  It's as if
ld.so was loaded at 0x0.  How did that happen?

-- 
Daniel Jacobowitz
CodeSourcery


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