This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: dwarflint versus data_member_location
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 19 Jul 2010 10:22:29 +0200
- Subject: Re: dwarflint versus data_member_location
Hi Petr,
On Sat, 2010-07-17 at 20:36 +0200, Petr Machata wrote:
> 16.07.2010 11:20, Mark Wielaard wrote:
> > dwarflint (from the dwarf branch) gives the following error:
>
> Hi, dwarflint on the dwarf branch is not up to date. The one that is is
> on pmachata/dwarflint. That branch should have this fix.
Thanks. That branch does indeed not give an error for that case.
I did find a bug in CU address size checking that is only exposed on
32bit files. read_address_size is called with the wrong arguments (see
attached). It might make sense to include some -m32 testcases on 64bit
architectures.
BTW. There are some fixes missing from the origin/dwarf branch that help
with building on newer systems (in particular commit b337b1). Also note
that on the branch srcdir == builddir builds are broken since
src/dwarflint is a directory (so the executable cannot be placed there).
Cheers,
Mark
>From a0f91e8a466b0feb8122f689249d0e18b3519dd9 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Mon, 19 Jul 2010 10:17:16 +0200
Subject: [PATCH] Call read_address_size with file->addr_64 as first argument.
* src/dwarflint/check_debug_info.cc (read_info_headers): Pass file->addr_64
to read_address_size ().
* src/dwarflint/low.c (check_aranges_structural): Likewise.
---
src/dwarflint/check_debug_info.cc | 3 ++-
src/dwarflint/low.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/dwarflint/check_debug_info.cc b/src/dwarflint/check_debug_info.cc
index 441f6b6..9ae820f 100644
--- a/src/dwarflint/check_debug_info.cc
+++ b/src/dwarflint/check_debug_info.cc
@@ -206,7 +206,8 @@ namespace
<< pri::lacks_relocation ("abbrev table offset") << std::endl;
/* Address size. */
- if (!read_address_size (file, &ctx, &head.address_size, &head.where))
+ if (!read_address_size (file->addr_64, &ctx, &head.address_size,
+ &head.where))
throw check_base::failed ();
head.head_size = ctx.ptr - cu_begin; // Length of the headers itself.
diff --git a/src/dwarflint/low.c b/src/dwarflint/low.c
index 51ba468..6766d4d 100644
--- a/src/dwarflint/low.c
+++ b/src/dwarflint/low.c
@@ -422,7 +422,7 @@ check_aranges_structural (struct elf_file *file,
/* Address size. */
int address_size;
- if (!read_address_size (file, &sub_ctx, &address_size, &where))
+ if (!read_address_size (file->addr_64, &sub_ctx, &address_size, &where))
{
retval = false;
goto next;
--
1.7.1.1