aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2016-12-19 15:27:59 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2017-02-16 13:06:14 +0000
commit3239a4231ff79bf8b67b8faaf414b1667486167c (patch)
tree88a7b27c57573dc2965452648e51eb159ecb8c5a /ld
parent90ed9b8bc136c80116273d1aae5a31fbd415af27 (diff)
downloadgdb-3239a4231ff79bf8b67b8faaf414b1667486167c.zip
gdb-3239a4231ff79bf8b67b8faaf414b1667486167c.tar.gz
gdb-3239a4231ff79bf8b67b8faaf414b1667486167c.tar.bz2
bfd: Improve lookup of file / line information for errors
When looking up file and line information (used from the linker to report error messages) if no symbol is passed in, then use the symbol list to look for a matching symbol. If a matching symbol is found then use this to look up the file / line information. This should improve errors when looking up file / line information for data sections. Hopefully we should find a matching data symbol, which should, in turn (we hope) match a DW_TAG_variable in the DWARF, this should allow us to give accurate file / line errors for data symbols. As the hope is to find a matching DW_TAG_variable in the DWARF then we ignore section symbols, and prefer global symbols to locals. bfd/ChangeLog: * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup before trying to fine matching file and line information. ld/ChangeLog: * testsuite/ld-elf/shared.exp: Update expected results. * testsuite/ld-elf/dwarf2.err: Likewise
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/testsuite/ld-elf/dwarf2.err9
-rw-r--r--ld/testsuite/ld-elf/shared.exp4
3 files changed, 12 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 696e08af..7d47397 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
+ * testsuite/ld-elf/shared.exp: Update expected results.
+ * testsuite/ld-elf/dwarf2.err: Likewise
+
+2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
+
* testsuite/ld-elf/dwarf.exp (build_tests): Add new tests.
* testsuite/ld-elf/dwarf2.err: New file.
* testsuite/ld-elf/dwarf2a.c: New file.
diff --git a/ld/testsuite/ld-elf/dwarf2.err b/ld/testsuite/ld-elf/dwarf2.err
index 872d282..b4ea67f 100644
--- a/ld/testsuite/ld-elf/dwarf2.err
+++ b/ld/testsuite/ld-elf/dwarf2.err
@@ -1,4 +1,5 @@
-tmpdir/dwarf2b\.o:\(\.data\+0x0\): multiple definition of `global_var'
-tmpdir/dwarf2a\.o:\(\.data\+0x0\): first defined here
-tmpdir/dwarf2b\.o:\(\.data\+0x4\): multiple definition of `other_var'
-tmpdir/dwarf2a\.o:\(\.data\+0x4\): first defined here
+tmpdir/dwarf2b\.o:.*dwarf2b\.c:1: multiple definition of `global_var'
+tmpdir/dwarf2a\.o:.*dwarf2a\.c:1: first defined here
+tmpdir/dwarf2b\.o:.*dwarf2b\.c:2: multiple definition of `other_var'
+tmpdir/dwarf2a\.o:.*dwarf2a\.c:2: first defined here
+#... \ No newline at end of file
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 9d5a9d9..3b8ab18 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -105,7 +105,7 @@ set build_tests {
"-shared" "-fPIC"
{beginwarn.c end.c}
{{readelf {-S --wide} libbarw.rd}
- {warning "^.*\\): warning: function foo is deprecated$"}}
+ {warning "^.*beginwarn.c:7: warning: function foo is deprecated$"}}
"libbarw.so" "c"}
{"Build hidden libbar.so"
"-shared" "-fPIC"
@@ -350,7 +350,7 @@ set run_tests [list \
[list "Run warn with versioned libfoo.so" \
"-Wl,--no-as-needed tmpdir/beginwarn.o tmpdir/libfoov.so" "" \
{main.c} "warn" "warn.out" \
- "" "c" {^.*\): warning: function foo is deprecated$} ] \
+ "" "c" {^.*beginwarn.c:7: warning: function foo is deprecated$} ] \
[list "Run protected with versioned libfoo.so" \
"-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoov.so tmpdir/endprotected.o" "" \
{main.c} "protected" "normal.out" ] \