summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-06-16 02:21:26 -0700
committerRoland McGrath <roland@redhat.com>2010-06-16 02:21:26 -0700
commitc70ebc0587ad1c549a3fe7f16a563bf4d6782aa7 (patch)
tree806d44aa2a8a4498a5e3c26a9058ff17f85aa6bd
parentb75f444e2a4a54436bea2fa21f022225b5d782e0 (diff)
downloadelfutils-c70ebc0587ad1c549a3fe7f16a563bf4d6782aa7.tar.gz
Check for CIE initial instructions that bogusly change the PC.
-rw-r--r--libdw/ChangeLog5
-rw-r--r--libdw/cfi.c1
-rw-r--r--libdw/dwarf_next_cfi.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index edb7cbff..18a423e5 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-16 Roland McGrath <roland@redhat.com>
+
+ * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
+ address.
+
2010-06-15 Roland McGrath <roland@redhat.com>
* dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like
diff --git a/libdw/cfi.c b/libdw/cfi.c
index 3cb378b6..aeb48e69 100644
--- a/libdw/cfi.c
+++ b/libdw/cfi.c
@@ -369,6 +369,7 @@ execute_cfi (Dwarf_CFI *cache,
}
/* We get here only for the cases that have just moved LOC. */
+ cfi_assert (cie->initial_state != NULL);
if (find_pc >= loc)
/* This advance has not yet reached FIND_PC. */
fs->start = loc;
diff --git a/libdw/dwarf_next_cfi.c b/libdw/dwarf_next_cfi.c
index 1ffa6699..fa7d09a7 100644
--- a/libdw/dwarf_next_cfi.c
+++ b/libdw/dwarf_next_cfi.c
@@ -156,8 +156,8 @@ dwarf_next_cfi (e_ident, data, eh_frame_p, off, next_off, entry)
++bytes;
/* The address size for CFI is implicit in the ELF class. */
- unsigned int address_size = e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
- unsigned int segment_size = 0;
+ uint_fast8_t address_size = e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+ uint_fast8_t segment_size = 0;
if (version >= 4)
{
if (unlikely (limit - bytes < 5))