binutils/
Support unordered .debug_info references to .debug_ranges. * dwarf.c (struct range_entry, range_entry_compar): New. (display_debug_ranges): Remove variables last_offset, first, j, seen_first_offset, use_debug_info and next. New variables range_entries and range_entry_fill. Create the sorted copy range_entries. Remove the FIXME error on detected unordered references. * dwarf.h (debug_info <range_lists>): New comment. binutils/testsuite/ * binutils-all/objcopy.exp (testranges): New test. * binutils-all/testranges.d, binutils-all/testranges.s: New files.
This commit is contained in:
parent
140033b391
commit
01a8f077ed
7 changed files with 197 additions and 108 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-07-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* binutils-all/objcopy.exp (testranges): New test.
|
||||
* binutils-all/testranges.d, binutils-all/testranges.s: New files.
|
||||
|
||||
2009-06-25 Christopher Faylor <me+cygwin@cgf.cx>
|
||||
|
||||
* binutils-all/objcopy.exp: Move XFAIL from objcopy_test to
|
||||
|
|
|
@ -874,3 +874,4 @@ if [is_elf_format] {
|
|||
run_dump_test "localize-hidden-1"
|
||||
}
|
||||
run_dump_test "localize-hidden-2"
|
||||
run_dump_test "testranges"
|
||||
|
|
14
binutils/testsuite/binutils-all/testranges.d
Normal file
14
binutils/testsuite/binutils-all/testranges.d
Normal file
|
@ -0,0 +1,14 @@
|
|||
#PROG: objcopy
|
||||
#source: testranges.s
|
||||
#readelf: -wR --wide
|
||||
#name: unordered .debug_info references to .debug_ranges
|
||||
|
||||
Contents of the .debug_ranges section:
|
||||
|
||||
Offset Begin End
|
||||
00000000 00000001 00000002
|
||||
00000000 <End of list>
|
||||
00000010 00000000 00000002
|
||||
00000010 <End of list>
|
||||
|
||||
#pass
|
57
binutils/testsuite/binutils-all/testranges.s
Normal file
57
binutils/testsuite/binutils-all/testranges.s
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Test .debug_info can reference .debug_ranges entries without ordering the
|
||||
# offsets strictly as increasing.
|
||||
|
||||
.text
|
||||
start:
|
||||
.byte 1
|
||||
sub:
|
||||
.byte 2
|
||||
end:
|
||||
|
||||
.section .debug_ranges,"",@progbits
|
||||
range:
|
||||
|
||||
range_sub:
|
||||
.long sub, end
|
||||
.long 0, 0 # range terminator
|
||||
|
||||
range_cu:
|
||||
.long start, end
|
||||
.long 0, 0 # range terminator
|
||||
|
||||
.section .debug_info,"",@progbits
|
||||
.long debugE - debugS # Length of Compilation Unit Info
|
||||
debugS:
|
||||
.value 0x2 # DWARF version number
|
||||
.long abbrev0 # Offset Into Abbrev. Section
|
||||
.byte 0x4 # Pointer Size (in bytes)
|
||||
|
||||
.uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
|
||||
.long range_cu - range # DW_AT_ranges
|
||||
|
||||
.uleb128 0x2 # (DIE (0x6d) DW_TAG_subprogram)
|
||||
.ascii "A\0" # DW_AT_name
|
||||
.long range_sub - range # DW_AT_ranges
|
||||
debugE:
|
||||
|
||||
.section .debug_abbrev,"",@progbits
|
||||
abbrev0:
|
||||
.uleb128 0x1 # (abbrev code)
|
||||
.uleb128 0x11 # (TAG: DW_TAG_compile_unit)
|
||||
.byte 0x0 # DW_children_no
|
||||
.uleb128 0x55 # (DW_AT_ranges)
|
||||
.uleb128 0x6 # (DW_FORM_data4)
|
||||
.byte 0x0
|
||||
.byte 0x0
|
||||
|
||||
.uleb128 0x2 # (abbrev code)
|
||||
.uleb128 0x2e # (TAG: DW_TAG_subprogram)
|
||||
.byte 0x0 # DW_children_no
|
||||
.uleb128 0x3 # (DW_AT_name)
|
||||
.uleb128 0x8 # (DW_FORM_string)
|
||||
.uleb128 0x55 # (DW_AT_ranges)
|
||||
.uleb128 0x6 # (DW_FORM_data4)
|
||||
.byte 0x0
|
||||
.byte 0x0
|
||||
|
||||
.byte 0x0 # abbrevs terminator
|
Loading…
Add table
Add a link
Reference in a new issue