[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/21809] New: gas outputs data symbol markers "$d" in .debug_fram
From: |
mark at klomp dot org |
Subject: |
[Bug gas/21809] New: gas outputs data symbol markers "$d" in .debug_frame |
Date: |
Fri, 21 Jul 2017 10:06:13 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=21809
Bug ID: 21809
Summary: gas outputs data symbol markers "$d" in .debug_frame
Product: binutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: gas
Assignee: unassigned at sourceware dot org
Reporter: mark at klomp dot org
Target Milestone: ---
On arm and aarch64:
$ echo "int main() { return 1; }" | gcc -g -xc -
$ eu-readelf -S ./a.out | grep debug_frame
[31] .debug_frame PROGBITS 00000000 0007c0 000030 0 0 0
4
$ eu-readelf -s ./a.out | grep '$d' | grep 31
67: 00000010 0 NOTYPE LOCAL DEFAULT 31 $d
Note that theoretically it is allowed to have a data marker symbol at the start
of the section if the whole section contains data. But it is redundant and
optional. Also this symbol doesn't point to the start of the section but some
way in.
This is caused by the use of frag_align () in gas/dw2gencfi.c.
It is similar to an issue fixed with .debug_aranges:
commit d025d5e5b57fb59c56aa4d57b7fc138720a8e454
Author: Mark Wielaard <address@hidden>
Date: Sat Jun 13 17:47:41 2015 -0400
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.
It is however not as to remove all uses of frag_align () and replace them with
simple padding in dw2gencfi.c.
It would best if aarch64_init_frag and arm_init_frag could be changed to not
emit marker symbols if the frag is associated with a data only section (like
SEC_DEBUGGING).
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/21809] New: gas outputs data symbol markers "$d" in .debug_frame,
mark at klomp dot org <=