diff options
author | Jan Beulich <jbeulich@suse.com> | 2022-03-23 08:48:24 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2022-03-23 08:48:24 +0100 |
commit | 17404258855da21324ab01e01cd650573c7ba22c (patch) | |
tree | 20ad4d3dadf5d4691242c98ea67c408f2790247f /gas | |
parent | 8728bc3d87b8e785689f234ac1f9b73fe6c1fdd1 (diff) | |
download | gdb-17404258855da21324ab01e01cd650573c7ba22c.zip gdb-17404258855da21324ab01e01cd650573c7ba22c.tar.gz gdb-17404258855da21324ab01e01cd650573c7ba22c.tar.bz2 |
gas/Dwarf5: re-use file 0 line string table entry when faking file 0
No need to emit the same string a 2nd time for file 1 in this case.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/dwarf2dbg.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index c0a052d..fee56c2 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -2137,7 +2137,7 @@ out_dir_and_file_list (segT line_seg, int sizeof_offset) bool emit_timestamps = true; bool emit_filesize = true; segT line_str_seg = NULL; - symbolS *line_strp; + symbolS *line_strp, *file0_strp = NULL; /* Output the Directory Table. */ if (DWARF2_LINE_VERSION >= 5) @@ -2301,9 +2301,17 @@ out_dir_and_file_list (segT line_seg, int sizeof_offset) } else { - line_strp = add_line_strp (line_str_seg, fullfilename); + if (!file0_strp) + line_strp = add_line_strp (line_str_seg, fullfilename); + else + line_strp = file0_strp; subseg_set (line_seg, 0); TC_DWARF2_EMIT_OFFSET (line_strp, sizeof_offset); + if (i == 0 && files_in_use > 1 + && files[0].filename == files[1].filename) + file0_strp = line_strp; + else + file0_strp = NULL; } /* Directory number. */ |