From: Daniel Jacobowitz Date: Thu, 1 Aug 2002 15:04:41 +0000 (+0000) Subject: 2002-08-01 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70ee46581bf305c387bc3880ba85222ed468b8f5;p=binutils-gdb.git 2002-08-01 H.J. Lu Daniel Jacobowitz * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced .debug_line section unless it has line information. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 35862576ffb..5fe5f166522 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2002-08-01 H.J. Lu + Daniel Jacobowitz + + * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced + .debug_line section unless it has line information. + 2002-07-31 Ian Dall * config/tc-ns32k.h (md_pcrel_adjust): Supply prototype. diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index b27652c9f9d..0f459a54de5 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1248,8 +1248,15 @@ dwarf2_finish () segT line_seg; struct line_seg *s; - /* If no debug information was recorded, nothing to do. */ - if (all_segs == NULL && files_in_use <= 1) + /* We don't need to do anything unless: + - Some debug information was recorded via .file/.loc + - or, we are generating DWARF2 information ourself (--gdwarf2) + - or, there is a user-provided .debug_info section which could + reference the file table in the .debug_line section we generate + below. */ + if (all_segs == NULL + && debug_type != DEBUG_DWARF2 + && bfd_get_section_by_name (stdoutput, ".debug_info") == NULL) return; /* Calculate the size of an address for the target machine. */