diff options
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/dwarf2dbg.c | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 3586257..5fe5f16 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2002-08-01 H.J. Lu <hjl@gnu.org> + Daniel Jacobowitz <drow@mvista.com> + + * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced + .debug_line section unless it has line information. + 2002-07-31 Ian Dall <ian@sibyl.beware.dropbear.id.au> * config/tc-ns32k.h (md_pcrel_adjust): Supply prototype. diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index b27652c..0f459a5 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. */ |