aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-08-01 15:04:41 +0000
committerDaniel Jacobowitz <drow@false.org>2002-08-01 15:04:41 +0000
commit70ee46581bf305c387bc3880ba85222ed468b8f5 (patch)
treecc6df8019d968f6380367e53a7014b2f32ef3b35 /gas/dwarf2dbg.c
parent24a1ba0f489e4c0e846ba86533e0f618d2c289a4 (diff)
downloadfsf-binutils-gdb-70ee46581bf305c387bc3880ba85222ed468b8f5.zip
fsf-binutils-gdb-70ee46581bf305c387bc3880ba85222ed468b8f5.tar.gz
fsf-binutils-gdb-70ee46581bf305c387bc3880ba85222ed468b8f5.tar.bz2
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.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c11
1 files changed, 9 insertions, 2 deletions
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. */