This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Regression on prelinked-sepdebug-shlibs
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 4 Jan 2010 19:10:09 +0100
- Subject: Re: Regression on prelinked-sepdebug-shlibs
- References: <20091225200440.GA3747@host0.dyn.jankratochvil.net> <1EA52AF6-6633-4D00-A3D7-842856D6C908@adacore.com>
Hi Tristan,
On Mon, 04 Jan 2010 16:23:22 +0100, Tristan Gingold wrote:
> can you try and/or comment this patch before I officially submit it ? No sepdebug.exp regressions.
it works (for the reproducer I provided - you could not run it?) after
removing:
+ /* In most cases, the offsets are 0. In this case we return NULL to reduce
+ overhead. */
+ for (i = 0; i < objfile->num_sections; i++)
+ if (objfile->section_offsets->offsets[i])
+ break;
+ if (i >= objfile->num_sections)
+ return NULL;
These offsets are for file vs. memory displacement. If I have .so prelinked at
0x3404200190 it gets loaded at 0x3404200190 so
objfile->section_offsets->offsets[*] will be 0 but still the .so.debug file is
0x0-based and the .so.debug file needs to be relocated to 0x3404200190.
Thanks,
Jan