diff options
author | Mark Wielaard <mjw@redhat.com> | 2015-06-13 17:47:41 -0400 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2015-06-15 09:25:21 +0200 |
commit | d025d5e5b57fb59c56aa4d57b7fc138720a8e454 (patch) | |
tree | 3c0b2a1dc3735c698db95f32dc2d6b6715283132 /gas/testsuite | |
parent | 3a062fa1eeee8296dece36a9bb7ecc8d4500de18 (diff) | |
download | gdb-d025d5e5b57fb59c56aa4d57b7fc138720a8e454.zip gdb-d025d5e5b57fb59c56aa4d57b7fc138720a8e454.tar.gz gdb-d025d5e5b57fb59c56aa4d57b7fc138720a8e454.tar.bz2 |
gas: Don't use frag_align but use plain padding to align .debug_aranges.
out_debug_aranges uses frag_align to make sure the addresses start
out aligned. Using frag_align will call frag_var[_init], which will
end up calling TC_FRAG_INIT. On arm and aarch64 TC_FRAG_INIT will
generate a $d mapping symbol for the .debug_aranges to show that at
that point a sequence of data items starts.
Such a symbol pointing into a non-allocated debug section will confuse
eu-strip -g. And it seems inefficient and wrong in general to have
additional mapping symbols for debug sections, which won't contain
actual code in the first place.
Just keep track of the aranges header size and use plain padding to
align the addresses which avoids generating any mapping symbols on
aarch64 and arm.
Includes a testcase for aarch64 that PASS with this patch and shows
the extra $d mapping symbol in .debug_aranges before.
gas/ChangeLog
* dwarf2dbg.c (out_header): Document EXPR->X_add_number value,
out_debug_aranges depends on it.
(out_debug_aranges): Track size of header to properly pad header
for address alignment.
gas/testsuite/ChangeLog
* gas/aarch64/dwarf.d: New.
* gas/aarch64/dwarf.s: New.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/dwarf.d | 27 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/dwarf.s | 6 |
3 files changed, 38 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 81e3836..6d6a90c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-13 Mark Wielaard <mjw@redhat.com> + + * gas/aarch64/dwarf.d: New. + * gas/aarch64/dwarf.s: New. + 2015-06-03 Matthew Wahab <matthew.wahab@arm.com> * gas/arm/armv8-a+rdma.d: New. diff --git a/gas/testsuite/gas/aarch64/dwarf.d b/gas/testsuite/gas/aarch64/dwarf.d new file mode 100644 index 0000000..46aa6d0 --- /dev/null +++ b/gas/testsuite/gas/aarch64/dwarf.d @@ -0,0 +1,27 @@ +#readelf: -s --debug-dump=aranges +#as: -g + +Symbol table '.symtab' contains 10 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 + 2: 0000000000000000 0 SECTION LOCAL DEFAULT 2 + 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 + 4: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x + 5: 0000000000000000 0 SECTION LOCAL DEFAULT 6 + 6: 0000000000000000 0 SECTION LOCAL DEFAULT 8 + 7: 0000000000000000 0 SECTION LOCAL DEFAULT 4 + 8: 0000000000000000 0 SECTION LOCAL DEFAULT 9 + 9: 0000000000000000 8 FUNC GLOBAL DEFAULT 1 testfunc +Contents of the .debug_aranges section: + + Length: 44 + Version: 2 + Offset into .debug_info: 0x0 + Pointer Size: 8 + Segment Size: 0 + + Address Length + 0000000000000000 0000000000000008 + 0000000000000000 0000000000000000 + diff --git a/gas/testsuite/gas/aarch64/dwarf.s b/gas/testsuite/gas/aarch64/dwarf.s new file mode 100644 index 0000000..6660205 --- /dev/null +++ b/gas/testsuite/gas/aarch64/dwarf.s @@ -0,0 +1,6 @@ +.globl testfunc +testfunc: + nop + ret +.type testfunc, @function +.size testfunc, .-testfunc |