This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 0/3] Improve information in linker errors
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: binutils at sourceware dot org
- Cc: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Mon, 13 Feb 2017 11:30:06 +0000
- Subject: [PATCH 0/3] Improve information in linker errors
- Authentication-results: sourceware.org; auth=none
This series contains two significant patches that try to improve the
error messages, specifically, the file and line information, given in
linker errors.
The first patch is setup work, extending the checks we can do as part
of the run_cc_link_tests mechanism in the linker testsuite. I use
this to add come C based linker tests in the later patches.
The second patch fixes some issues with how we reuse stashed DWARF
data in _bfd_dwarf2_slurp_debug_info. We have problems with not fully
validating a bfd match before reusing cached data, further, we neglect
to call place_sections, which can cause issues if we do reuse cached
DWARF data.
The final patch improves on the case where we are looking up file and
line information for data symbols. In this case, we currently, alway
fallback to using section + OFFSET style messages, with this patch we
now try to give meaningful file:line type messages instead.
There's tests included for the improved functionality, and I've
updated the expected results in cases where things have changed. I've
tested against a wide range of targets and don't believe I've
introduced any regressions.
The only testing issue I did see was on an x86-64 target where I added
"-m32" to the CFLAGS at configure time, in this case the new C test
does not compile, however, NON of the run_cc_link_tests compile in
this case, so I think it's reasonable for me not to worry about this
at this time.
All feedback welcome.
Thanks,
Andrew
Andrew Burgess (3):
ld: Add additional checking for warnings/errors in testsuite
bfd/dwarf: Improve use of previously loaded dwarf information
bfd: Improve lookup of file / line information for errors
bfd/ChangeLog | 14 ++++++++
bfd/dwarf2.c | 55 +++++++++++++++++++++++++++--
ld/ChangeLog | 23 ++++++++++++
ld/testsuite/ld-elf/dwarf.exp | 6 ++++
ld/testsuite/ld-elf/dwarf2.err | 5 +++
ld/testsuite/ld-elf/dwarf2a.c | 8 +++++
ld/testsuite/ld-elf/dwarf2b.c | 10 ++++++
ld/testsuite/ld-elf/dwarf3.c | 13 +++++++
ld/testsuite/ld-elf/dwarf3.err | 4 +++
ld/testsuite/ld-elf/shared.exp | 8 +++--
ld/testsuite/ld-plugin/lto.exp | 6 ++--
ld/testsuite/lib/ld-lib.exp | 79 +++++++++++++++++++++++++++++++++++-------
12 files changed, 212 insertions(+), 19 deletions(-)
create mode 100644 ld/testsuite/ld-elf/dwarf2.err
create mode 100644 ld/testsuite/ld-elf/dwarf2a.c
create mode 100644 ld/testsuite/ld-elf/dwarf2b.c
create mode 100644 ld/testsuite/ld-elf/dwarf3.c
create mode 100644 ld/testsuite/ld-elf/dwarf3.err
--
2.5.1