aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-11-17 12:41:36 +1030
committerAlan Modra <amodra@gmail.com>2020-11-18 23:46:39 +1030
commit058430b4a1ed7441dfc2e167bfdb9dc89ea9a209 (patch)
tree9b7ec856174062c736b1255b25f7f7e0edae6621 /gas/dwarf2dbg.c
parent99fabbc9739a87ba3433e66792e93b773896790e (diff)
downloadgdb-058430b4a1ed7441dfc2e167bfdb9dc89ea9a209.zip
gdb-058430b4a1ed7441dfc2e167bfdb9dc89ea9a209.tar.gz
gdb-058430b4a1ed7441dfc2e167bfdb9dc89ea9a209.tar.bz2
Re: Stop Gas from generating line info or address ranges
* doc/as.texi (.nop): Document optional size arg. * dwarf2dbg.c (dwarf2_gen_line_info_1): Only check SEC_ALLOC when ELF. Warn whenever dwarf line number information is ignored. * frags.c (frag_offset_ignore_align_p): New function. * frags.h (frag_offset_ignore_align_p): Declare. * read.c (s_nop): Extend to support optional size arg. * testsuite/gas/elf/dwarf2-20.d: Expect warnings, and exact range. * testsuite/gas/elf/dwarf2-20.s: Emit 16 bytes worth of nops. * testsuite/gas/m68hc11/indexed12.d: Expect warnings.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 25ebc94..e927c50 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -504,16 +504,18 @@ dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc)
{
struct line_subseg *lss;
struct line_entry *e;
- flagword need_flags = SEC_ALLOC | SEC_LOAD | SEC_CODE;
+ flagword need_flags = SEC_LOAD | SEC_CODE;
- /* PR 26850: Do not record LOCs in non-executable, non-allocated,
- or non-loaded sections. */
+ /* PR 26850: Do not record LOCs in non-executable or non-loaded
+ sections. SEC_ALLOC isn't tested for non-ELF because obj-coff.c
+ obj_coff_section is careless in setting SEC_ALLOC. */
+ if (IS_ELF)
+ need_flags |= SEC_ALLOC;
if ((now_seg->flags & need_flags) != need_flags)
{
- if (! SEG_NORMAL (now_seg))
- /* FIXME: Add code to suppress multiple warnings ? */
- as_warn ("dwarf line number information for %s ignored",
- segment_name (now_seg));
+ /* FIXME: Add code to suppress multiple warnings ? */
+ as_warn ("dwarf line number information for %s ignored",
+ segment_name (now_seg));
return;
}