gas: Don't use frag_align but use plain padding to align .debug_aranges.
authorMark Wielaard <mjw@redhat.com>
Sat, 13 Jun 2015 21:47:41 +0000 (17:47 -0400)
committerMark Wielaard <mjw@redhat.com>
Mon, 15 Jun 2015 07:25:21 +0000 (09:25 +0200)
commitd025d5e5b57fb59c56aa4d57b7fc138720a8e454
tree3c0b2a1dc3735c698db95f32dc2d6b6715283132
parent3a062fa1eeee8296dece36a9bb7ecc8d4500de18
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.
gas/ChangeLog
gas/dwarf2dbg.c
gas/testsuite/ChangeLog
gas/testsuite/gas/aarch64/dwarf.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/dwarf.s [new file with mode: 0644]
This page took 0.026672 seconds and 4 git commands to generate.