This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] bfd/dwarf: Improve use of previously loaded dwarf information


On Mon, Feb 13, 2017 at 11:30:08AM +0000, Andrew Burgess wrote:
> --- /dev/null
> +++ b/ld/testsuite/ld-elf/dwarf3.c
> @@ -0,0 +1,13 @@
> +/* This test is actually used to test for a segfault that came from the bfd
> +   dwarf parsing code in the case when there is _no_ dwarf info.  */
[snip]

If the above is indeed the aim of the test, then I think we should
relax the test a little.  Some targets (eg. alpha-linux and
hppa-linux) don't emit STT_FILE symbols in objects, in which case
_bfd_elf_find_function cannot return a filename.  The result is
something like:

tmpdir/dwarf3.o: In function `main':
(.text.startup+0x8): undefined reference to `bar'
(.text.startup+0x10): undefined reference to `bar'

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7d47397..12c93c4 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-17  Alan Modra  <amodra@gmail.com>
+
+	* testsuite/ld-elf/dwarf2.err: Add missing newline at end.
+	* testsuite/ld-elf/dwarf3.err: Likewise.  Allow match without filename.
+
 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* testsuite/ld-elf/shared.exp: Update expected results.
diff --git a/ld/testsuite/ld-elf/dwarf2.err b/ld/testsuite/ld-elf/dwarf2.err
index b4ea67f..6b97ee6 100644
--- a/ld/testsuite/ld-elf/dwarf2.err
+++ b/ld/testsuite/ld-elf/dwarf2.err
@@ -2,4 +2,4 @@ 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/dwarf3.err b/ld/testsuite/ld-elf/dwarf3.err
index 6027431..6f5a8cc 100644
--- a/ld/testsuite/ld-elf/dwarf3.err
+++ b/ld/testsuite/ld-elf/dwarf3.err
@@ -1,4 +1,4 @@
 .*/dwarf3\.o: In function `main':
-.*dwarf3.c:\(\.text.*\+0x[0-9a-f]+\): undefined reference to `bar'
-.*dwarf3.c:\(\.text.*\+0x[0-9a-f]+\): undefined reference to `bar'
-#...
\ No newline at end of file
+.*\(\.text.*\+0x[0-9a-f]+\): undefined reference to `bar'
+.*\(\.text.*\+0x[0-9a-f]+\): undefined reference to `bar'
+#...

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]