This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATCH RFA] solib-svr4.c patch for dynamic executables


On Nov 8,  9:34am, Ulrich Drepper wrote:

> Please note that you can execute DSO even if they have an PT_INTERP
> entry (libdl.so on Linux is such an example).  I wouldn't have
> complained about not being able to debug this with Kevin's patch since
> it's not really important.  But still.

Ahh...  very interesting.  Thank you for providing this example.  I am
more convinced than ever that the correct test is to check for the
presence of a .interp section (or rather the lack thereof).

But, clearly, I have not handled the case of a DSO with an interpreter
section.  (In fact, I've just tried it and gdb can't insert the
breakpoint that I try to set due to the fact that the main program
addresses have not been properly relocated.)

I do have an idea about how to make it work, but it'll take some
effort.  The DT_DEBUG entry in the dynamic linker's own dynamic
section also contains the address of _r_debug, making it possible to
obtain the linkmap entry for the main program.  Once we have that, it
should be easy to do the relocation...  It'll take a bit of work to
implement it though which is why I'd like to know if anyone will ever
likely need this functionality.

Either way, the patch currently on the table should go in since it is
needed to handle the case of DSOs (and perhaps other executables)
which lack an interpreter section.

Kevin

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