aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-02-06 11:12:02 +0000
committerNick Clifton <nickc@redhat.com>2015-02-06 11:12:54 +0000
commit5929c344f957f93253efa4c3495a996789d48ae7 (patch)
tree58ccb0820dc7aa39ca8d4a9645d7219421d32f1f /binutils
parent77f41761432a70930ea0a917a2f135b392af34f5 (diff)
downloadgdb-5929c344f957f93253efa4c3495a996789d48ae7.zip
gdb-5929c344f957f93253efa4c3495a996789d48ae7.tar.gz
gdb-5929c344f957f93253efa4c3495a996789d48ae7.tar.bz2
Fixes illegal memory accesses triggereb by running a 32-bit binary version of objdump compiled on a 64-bit host.
PR binutils/17512 * dwarf.c (display_debug_frames): Fix range checks to work on 32-bit binaries complied on a 64-bit host. * peXXigen.c (rsrc_print_resource_entries): Add range check for addresses that wrap around the address space. (rsrc_parse_entry): Likewise.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/dwarf.c11
2 files changed, 13 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 5182809..6cd306a 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-06 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * dwarf.c (display_debug_frames): Fix range checks to work on
+ 32-bit binaries complied on a 64-bit host.
+
2015-02-05 Alan Modra <amodra@gmail.com>
PR binutils/17926
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index aa19725..2edacb8 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5949,6 +5949,7 @@ display_debug_frames (struct dwarf_section *section,
{
unsigned int reg, op, opa;
unsigned long temp;
+ unsigned char * new_start;
op = *start++;
opa = op & 0x3f;
@@ -6019,26 +6020,28 @@ display_debug_frames (struct dwarf_section *section,
break;
case DW_CFA_def_cfa_expression:
temp = LEB ();
- if (start + temp < start)
+ new_start = start + temp;
+ if (new_start < start)
{
warn (_("Corrupt CFA_def expression value: %lu\n"), temp);
start = block_end;
}
else
- start += temp;
+ start = new_start;
break;
case DW_CFA_expression:
case DW_CFA_val_expression:
reg = LEB ();
temp = LEB ();
- if (start + temp < start)
+ new_start = start + temp;
+ if (new_start < start)
{
/* PR 17512: file:306-192417-0.005. */
warn (_("Corrupt CFA expression value: %lu\n"), temp);
start = block_end;
}
else
- start += temp;
+ start = new_start;
if (frame_need_space (fc, reg) >= 0)
fc->col_type[reg] = DW_CFA_undefined;
break;