This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] readelf: Add base to offsets in format_dwarf_addr for debug_loc/ranges.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 22 Jan 2013 16:52:14 +0100
- Subject: Re: [PATCH] readelf: Add base to offsets in format_dwarf_addr for debug_loc/ranges.
On Mon, 2013-01-21 at 13:16 -0800, Josh Stone wrote:
> On 01/18/2013 01:28 PM, Mark Wielaard wrote:
> > Collect the base address of the CU while creating the listptr_tables
> > and use them when printing debug ranges and location entries with
> > format_dwarf_addr ().
> Just to provide some context, Mark is responding to my gripe here:
> In comments 2 and 7, I noted that binutils already adjusts for the base
> address, and this is much more helpful to me to see what's happening.
Thanks for providing the context. I also just fixed it because we were
calling format_dwarf_addr () with bogus addresses (actually not
addresses at all). Have you tried the patch, does it produce the
addresses you are expecting? I did a quick spot check on the vmlinux
kernel image and some random binaries and things look fine (checked
against the binutils readelf output), but I probably should add an
explicit testcase just in case.