diff options
author | Roland McGrath <roland@redhat.com> | 2009-04-15 14:47:13 -0700 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2009-04-15 14:47:13 -0700 |
commit | 2fb9051edd6addafe902669ba0bd47f3921a31d1 (patch) | |
tree | f88955064bb92c5d6aa549f523278d5117924e60 | |
parent | eb9ba470ff1f65a85f47cd6c325acf836abd2af8 (diff) | |
download | elfutils-2fb9051edd6addafe902669ba0bd47f3921a31d1.tar.gz |
Fix 32/64 CIE header format CIE_id matching.
-rw-r--r-- | libdw/ChangeLog | 5 | ||||
-rw-r--r-- | libdw/dwarf.h | 3 | ||||
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/readelf.c | 10 |
4 files changed, 19 insertions, 4 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 77123b57..93a59673 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2009-04-15 Roland McGrath <roland@redhat.com> + + * dwarf.h (DW_CIE_ID): Removed. + (DW_CIE_ID_32, DW_CIE_ID_64): New constants replace it. + 2009-04-01 Roland McGrath <roland@redhat.com> * dwarf.h: Add DW_CFA_GNU_negative_offset_extended. diff --git a/libdw/dwarf.h b/libdw/dwarf.h index 3b9d40c9..0546e3eb 100644 --- a/libdw/dwarf.h +++ b/libdw/dwarf.h @@ -677,7 +677,8 @@ enum /* ID indicating CIE as opposed to FDE in .debug_frame. */ enum { - DW_CIE_ID = 0xffffffff + DW_CIE_ID_32 = 0xffffffffU, /* In 32-bit format CIE header. */ + DW_CIE_ID_64 = 0xffffffffffffffffULL /* In 64-bit format CIE header. */ }; diff --git a/src/ChangeLog b/src/ChangeLog index 16673f14..fe8b0362 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-04-15 Roland McGrath <roland@redhat.com> + + * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in + 64-bit format header, DW_CIE_ID_32 in 32-bit format header. + 2009-04-14 Roland McGrath <roland@redhat.com> * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM diff --git a/src/readelf.c b/src/readelf.c index 773fc7d7..1c790650 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4676,9 +4676,13 @@ print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, if (unlikely (cieend > dataend || readp + 8 > dataend)) goto invalid_data; - Dwarf_Word cie_id; + Dwarf_Off cie_id; if (length == 4) - cie_id = read_4ubyte_unaligned_inc (dbg, readp); + { + cie_id = read_4ubyte_unaligned_inc (dbg, readp); + if (!is_eh_frame && cie_id == DW_CIE_ID_32) + cie_id = DW_CIE_ID_64; + } else cie_id = read_8ubyte_unaligned_inc (dbg, readp); @@ -4689,7 +4693,7 @@ print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, Dwarf_Word initial_location = 0; Dwarf_Word vma_base = 0; - if (cie_id == (is_eh_frame ? 0 : DW_CIE_ID)) + if (cie_id == (is_eh_frame ? 0 : DW_CIE_ID_64)) { uint_fast8_t version = *readp++; const char *const augmentation = (const char *) readp; |