This is the mail archive of the
mailing list for the GDB project.
Re: how to make gdb happy with my linkmap
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mathieu Lacage <mathieu dot lacage at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Mon, 5 Jan 2009 12:13:15 -0500
- Subject: Re: how to make gdb happy with my linkmap
- References: <firstname.lastname@example.org> <20081218214854.GA7706@caradoc.them.org> <email@example.com> <20081218221005.GA9012@caradoc.them.org> <firstname.lastname@example.org> <20081226125329.GA12783@caradoc.them.org> <email@example.com>
On Mon, Jan 05, 2009 at 03:58:39PM +0100, Mathieu Lacage wrote:
> What I find weird is:
> 1) mathieu@mathieu-boulot:~/code/elf-loader$ readelf -s ./ldso |grep stage1
> 225: 00000932 135 FUNC GLOBAL HIDDEN 6 stage1
> mathieu@mathieu-boulot:~/code/elf-loader$ readelf -l ./ldso
> Elf file type is DYN (Shared object file)
> Entry point 0x932
> There are 6 program headers, starting at offset 52
> i.e., stage1 is located at offset 0x932, and not 0x944 so, I can't
> figure out where the 0x944 displayed by gdb is coming from.
That's prologue skipping; it's just walking past the frame setup.
This helps GDB to display function arguments correctly.
> I also
> find it surprising that gdb is actually trying to set a breakpoint at
> address 0x944: this is a pie binary so, gdb should know that the
> address will be known only once the program is run....
This is the same problem as PIE support. Ubuntu and Fedora carry some
patches to improve PIE support; I think that Jan K. was talking about
merging those at some point. I haven't looked at them in years.