Fix 32/64 CIE header format CIE_id matching.
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 77123b5..93a5967 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 3b9d40c..0546e3e 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -677,7 +677,8 @@
/* 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 16673f1..fe8b036 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 773fc7d..1c79065 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4676,9 +4676,13 @@
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 @@
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;