aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-05-04 13:50:05 +0100
committerNick Clifton <nickc@redhat.com>2020-05-04 13:50:05 +0100
commit070b775f03ebdab6d0d007787fe19b916af4439c (patch)
tree92c9989fde303f3bfc75f68cc049f9535a3c2e8f /gas/dwarf2dbg.c
parentfe05f369f0df7cad0a6500b79879addaad2e364d (diff)
downloadgdb-070b775f03ebdab6d0d007787fe19b916af4439c.zip
gdb-070b775f03ebdab6d0d007787fe19b916af4439c.tar.gz
gdb-070b775f03ebdab6d0d007787fe19b916af4439c.tar.bz2
GAS: Do not create an entry for the default directory if the directory table is empty. Improve readelf's decoding of empty directory and file name tables.
PR 25917 * dwarf.c (display_debug_lines_decoded): Warn if encountering a supicious number of entries for DWARF-5 format directory and file name tables. Do not display file name table header if the table is empty. Do not allocate space for empty tables.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 213f382..071450e 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1981,7 +1981,6 @@ out_dir_and_file_list (void)
bfd_boolean emit_filesize = TRUE;
/* Output the Directory Table. */
-
if (DWARF2_LINE_VERSION >= 5)
{
out_byte (1);
@@ -1993,7 +1992,7 @@ out_dir_and_file_list (void)
}
/* Emit directory list. */
- if (DWARF2_LINE_VERSION >= 5)
+ if (DWARF2_LINE_VERSION >= 5 && dirs_in_use > 0)
{
if (dirs == NULL || dirs[0] == NULL)
dir = remap_debug_filename (".");
@@ -2017,7 +2016,6 @@ out_dir_and_file_list (void)
out_byte ('\0');
/* Output the File Name Table. */
-
if (DWARF2_LINE_VERSION >= 5)
{
unsigned int columns = 4;
@@ -2045,7 +2043,6 @@ out_dir_and_file_list (void)
/* The number of format entries to follow. */
out_byte (columns);
-
/* The format of the file name. */
out_uleb128 (DW_LNCT_path);
/* FIXME: it would be better to store these strings in