bfd: Improve lookup of file / line information for errors
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 19 Dec 2016 15:27:59 +0000 (15:27 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 16 Feb 2017 13:06:14 +0000 (13:06 +0000)
commit3239a4231ff79bf8b67b8faaf414b1667486167c
tree88a7b27c57573dc2965452648e51eb159ecb8c5a
parent90ed9b8bc136c80116273d1aae5a31fbd415af27
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
bfd/ChangeLog
bfd/dwarf2.c
ld/ChangeLog
ld/testsuite/ld-elf/dwarf2.err
ld/testsuite/ld-elf/shared.exp
This page took 0.025521 seconds and 4 git commands to generate.