aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
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;
}