summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2009-04-15 14:47:13 -0700
committerRoland McGrath <[email protected]>2009-04-15 14:47:13 -0700
commit2fb9051edd6addafe902669ba0bd47f3921a31d1 (patch)
treef88955064bb92c5d6aa549f523278d5117924e60 /src/readelf.c
parenteb9ba470ff1f65a85f47cd6c325acf836abd2af8 (diff)
Fix 32/64 CIE header format CIE_id matching.
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c10
1 files changed, 7 insertions, 3 deletions
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;