]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix 32/64 CIE header format CIE_id matching.
authorRoland McGrath <roland@redhat.com>
Wed, 15 Apr 2009 21:47:13 +0000 (14:47 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 15 Apr 2009 21:47:13 +0000 (14:47 -0700)
libdw/ChangeLog
libdw/dwarf.h
src/ChangeLog
src/readelf.c

index 77123b574e1f55e5013b7bf685367a1d599943e3..93a5967333b28aec6973109046199f4b19a2fa13 100644 (file)
@@ -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.
index 3b9d40c9fe239bc66072431302cd7c92aa8bd141..0546e3ebde2b9befc09c225246e45a8b9d4ceaa4 100644 (file)
@@ -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.  */
   };
 
 
index 16673f14e358a31422e779223f85d29b11519778..fe8b036238788e5e6c721051091d3c779054107d 100644 (file)
@@ -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
index 773fc7d780f4ceee544ff386b41136ecaf2235a7..1c790650f75d0d4be97b9127f48ea5f22c6b1099 100644 (file)
@@ -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;