>From d03d6aef5f84b668905fc993c830c70c6efef40c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 22 Jan 2012 16:05:03 +0100 Subject: [PATCH] Handle DW_FORM_sec_offset in dwarf_formudata. --- libdw/ChangeLog | 4 ++++ libdw/dwarf_formudata.c | 7 +++++-- src/ChangeLog | 4 ++++ src/readelf.c | 3 --- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index cfc5c89..08afc63 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2012-01-22 Mark Wielaard + + * dwarf_formudata.c (dwarf_formudata): Handle DW_FORM_sec_offset. + 2011-11-31 Mark Wielaard * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk. diff --git a/libdw/dwarf_formudata.c b/libdw/dwarf_formudata.c index 573a578..948c184 100644 --- a/libdw/dwarf_formudata.c +++ b/libdw/dwarf_formudata.c @@ -1,5 +1,5 @@ /* Return unsigned constant represented by attribute. - Copyright (C) 2003-2010 Red Hat, Inc. + Copyright (C) 2003-2010, 2012 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -134,9 +134,12 @@ dwarf_formudata (attr, return_uval) case DW_FORM_data4: case DW_FORM_data8: + case DW_FORM_sec_offset: if (__libdw_read_address (attr->cu->dbg, cu_sec_idx (attr->cu), attr->valp, - attr->form == DW_FORM_data4 ? 4 : 8, + (attr->form == DW_FORM_sec_offset + ? attr->cu->offset_size + : attr->form == DW_FORM_data4 ? 4 : 8), return_uval)) return -1; break; diff --git a/src/ChangeLog b/src/ChangeLog index de6031f..804db92 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-01-22 Mark Wielaard + + * readelf.c (attr_callback): Don't special case DW_FORM_sec_offset. + 2012-01-21 Ulrich Drepper * addr2line.c: Update copyright year. diff --git a/src/readelf.c b/src/readelf.c index 10e25e3..8876688 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -5612,9 +5612,6 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) break; case DW_FORM_sec_offset: - attrp->form = cbargs->offset_size == 8 ? DW_FORM_data8 : DW_FORM_data4; - /* Fall through. */ - case DW_FORM_udata: case DW_FORM_sdata: case DW_FORM_data8: -- 1.7.7.5