aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-04-29 10:03:56 +0100
committerNick Clifton <nickc@redhat.com>2024-04-29 10:04:53 +0100
commitd1765f5db3f9d1c75a3e1b06f0182db40afbbdc9 (patch)
tree1548d296cdd63a329c013d6c3d222a0f92ffe3eb
parentc541d53765bdea821b06b929ed5d13d00dc42f22 (diff)
downloadbinutils-d1765f5db3f9d1c75a3e1b06f0182db40afbbdc9.zip
binutils-d1765f5db3f9d1c75a3e1b06f0182db40afbbdc9.tar.gz
binutils-d1765f5db3f9d1c75a3e1b06f0182db40afbbdc9.tar.bz2
Fix initiali state of DWARF v5 line number table in BFD library
PR 30783
-rw-r--r--bfd/dwarf2.c7
-rw-r--r--ld/testsuite/ld-x86-64/pr27587.err2
2 files changed, 4 insertions, 5 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 8eb7b11..151ed02 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -2916,10 +2916,9 @@ decode_line_info (struct comp_unit *unit)
if (table->num_files)
{
- if (table->use_dir_and_file_0)
- filename = concat_filename (table, 0);
- else
- filename = concat_filename (table, 1);
+ /* PR 30783: Always start with a file index of 1, even
+ for DWARF-5. */
+ filename = concat_filename (table, 1);
}
/* Decode the table. */
diff --git a/ld/testsuite/ld-x86-64/pr27587.err b/ld/testsuite/ld-x86-64/pr27587.err
index 9ccca0a..b5c6fba 100644
--- a/ld/testsuite/ld-x86-64/pr27587.err
+++ b/ld/testsuite/ld-x86-64/pr27587.err
@@ -1,3 +1,3 @@
#...
-.*pr27587/<artificial>:4:\(.*\): undefined reference to `stack_size'
+.*pr27587/pr27587.i:4:\(.*\): undefined reference to `stack_size'
#...