[7.0] PR/9174: gdb can't handle PIE
Jan Kratochvil
jan.kratochvil@redhat.com
Wed Aug 5 18:04:00 GMT 2009
On Wed, 29 Jul 2009 22:40:54 +0200, Thiago Jung Bauermann wrote:
> I just removed my name from the task in the subject in the wiki page for
> GDB 7.0. The task consists of taking one of the two "competing" patches which
> implement PIE support and herding it upstream, or implementing a third patch.
It is questionable how much clean it should be.
The right way would be to make all the GDB read-in symbols non-relocated and
relocated by section_offsets/ANOFFSET only on each use.
Currently the (Red Hat) PIE patch
http://cvs.fedora.redhat.com/viewvc/rpms/gdb/devel/gdb-6.3-pie-20050110.patch?view=co
does a needless reread of the symbol files when the executable gets its final
in-memory address from solib_add() as it has been added there to the shared
library list:
/* For SVR4 versions, the first entry in the link map is for the
inferior executable, so we must ignore it. For some versions of
SVR4, it has no name. For others (Solaris 2.3 for example), it
does have a name, so we can no longer use a missing name to
decide when to ignore it. */
->
+ /* Pie case, main executable has been relocated. */
This non-relocated symbols functionality should be also applicable for the
multi-executables support (as somewhere Tom Tromey made a note about).
(there are sure more cleanups to be done)
Regards,
Jan
More information about the Gdb
mailing list