This is the mail archive of the 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: [7.0] PR/9174: gdb can't handle PIE

Jan Kratochvil wrote:
> 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
> 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:

While having the symbols non-relocated might be a good idea in the long run,
even in the current setup it is certainly possible to relocate the main
objfile without rereading its symbols: use objfile_relocate.  You might want
to have a look at the new solib-spu.c:spu_current_sos where I check whether
I'm seeing a relocated main executable for the first time, and call both
objfile_relocate and enable_breakpoints_after_startup at this point.

Looking at the current PIE patch, it seems to me that the various changes
related to avoiding calling breakpoint_re_set during startup are no longer
necessary: you're now using my version of bp_startup_disabled breakpoint,
and those can handle breakpoint_re_set properly.  All the "mainline" flag
related changes in the PIE patch can probably just go away ...


  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE

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