diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2006-10-10 10:45:45 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2006-10-10 10:45:45 +0000 |
commit | d4bfc77bca2a75b638db352482460c48b082cbcc (patch) | |
tree | 96bf9ecf5cad2b67c3a43b4ea24236b4216bb3c9 /binutils | |
parent | 9e35dae42503f6cef9a1f87e31a6f1111f3cb508 (diff) | |
download | gdb-d4bfc77bca2a75b638db352482460c48b082cbcc.zip gdb-d4bfc77bca2a75b638db352482460c48b082cbcc.tar.gz gdb-d4bfc77bca2a75b638db352482460c48b082cbcc.tar.bz2 |
* dwarf.c (display_debug_loc): Don't dereference loc_offsets when
there are no location lists.
(display_debug_ranges): Similar for range_lists.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/dwarf.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 0509d7a..0b454bd 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2006-10-10 Andreas Schwab <schwab@suse.de> + + * dwarf.c (display_debug_loc): Don't dereference loc_offsets when + there are no location lists. + (display_debug_ranges): Similar for range_lists. + 2006-10-04 H.J. Lu <hongjiu.lu@intel.com> * readelf.c (debug_apply_rela_addends): Don't ignore relocation diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 8a98aecb..117d2a5 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -2315,7 +2315,8 @@ display_debug_loc (struct dwarf_section *section, void *file) error (_("No location lists in .debug_info section!\n")); /* DWARF sections under Mach-O have non-zero addresses. */ - if (debug_information [first].loc_offsets [0] != section->address) + if (debug_information [first].num_loc_offsets > 0 + && debug_information [first].loc_offsets [0] != section->address) warn (_("Location lists in %s section start at 0x%lx\n"), section->name, debug_information [first].loc_offsets [0]); @@ -2686,7 +2687,8 @@ display_debug_ranges (struct dwarf_section *section, error (_("No range lists in .debug_info section!\n")); /* DWARF sections under Mach-O have non-zero addresses. */ - if (debug_information [first].range_lists [0] != section->address) + if (debug_information [first].num_range_lists > 0 + && debug_information [first].range_lists [0] != section->address) warn (_("Range lists in %s section start at 0x%lx\n"), section->name, debug_information [first].range_lists [0]); |