aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-09-08 09:56:39 +0100
committerNick Clifton <nickc@redhat.com>2022-09-08 09:56:39 +0100
commit2caffd34df293680755ebad35c618ee68686fcf1 (patch)
treee62cf8e28286f80ddb70c6c588c71671c168646e
parentf42546b6cc7468ac7d929181ed7b965ab60958ac (diff)
downloadfsf-binutils-gdb-2caffd34df293680755ebad35c618ee68686fcf1.zip
fsf-binutils-gdb-2caffd34df293680755ebad35c618ee68686fcf1.tar.gz
fsf-binutils-gdb-2caffd34df293680755ebad35c618ee68686fcf1.tar.bz2
i686-w64-mingw32-objdump -WL returns incorrect file paths
PR 29523 * dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5 directory and filename tables.
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/dwarf.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cfb6417..5f8403b 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-08 Nick Clifton <nickc@redhat.com>
+
+ PR 29523
+ * dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5
+ directory and filename tables.
+
2022-09-02 Aaron Merey <amerey@redhat.com>
PR 29075
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 71d8bc9..f90f4ef 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5215,6 +5215,8 @@ display_debug_lines_decoded (struct dwarf_section * section,
ix, n_directories);
directory = _("<corrupt>");
}
+ else if (linfo.li_version >= 5)
+ directory = (char *) directory_table[ix];
else
directory = (char *) directory_table[ix - 1];
@@ -5385,6 +5387,7 @@ display_debug_lines_decoded (struct dwarf_section * section,
if (linfo.li_version < 5)
--file;
+
if (file_table == NULL || n_files == 0)
printf (_("\n [Use file table entry %d]\n"), file);
/* PR 20439 */
@@ -5406,6 +5409,10 @@ display_debug_lines_decoded (struct dwarf_section * section,
dir, n_directories);
printf (_("\n <over large directory table entry %u>\n"), dir);
}
+ else if (linfo.li_version >= 5)
+ printf ("\n%s/%s:\n",
+ /* The directory index starts counting at 0. */
+ directory_table[dir], file_table[file].name);
else
printf ("\n%s/%s:\n",
/* The directory index starts counting at 1. */