This is the mail archive of the binutils-cvs@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]

[binutils-gdb] Workaround GCC 7 bug with debug line numbers causing debug_msg.sh failure.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0af4ccfc5bc7ded4d87f813e3754486eb5a75349

commit 0af4ccfc5bc7ded4d87f813e3754486eb5a75349
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Fri Dec 1 22:53:08 2017 -0800

    Workaround GCC 7 bug with debug line numbers causing debug_msg.sh failure.
    
    gold/
    	PR gold/21841
    	* testsuite/debug_msg.sh: Adjust expected line numbers.
    	* testsuite/odr_violation2.cc (DummyFunction): New function.

Diff:
---
 gold/ChangeLog                   | 6 ++++++
 gold/testsuite/debug_msg.sh      | 6 +++---
 gold/testsuite/odr_violation2.cc | 8 ++++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 0da0697..3e8eb10 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,11 @@
 2017-12-01  Cary Coutant  <ccoutant@gmail.com>
 
+	PR gold/21841
+	* testsuite/debug_msg.sh: Adjust expected line numbers.
+	* testsuite/odr_violation2.cc (DummyFunction): New function.
+
+2017-12-01  Cary Coutant  <ccoutant@gmail.com>
+
 	PR gold/22309
 	* testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): Compile with
 	no EH information.
diff --git a/gold/testsuite/debug_msg.sh b/gold/testsuite/debug_msg.sh
index 032397b..5668d8e 100755
--- a/gold/testsuite/debug_msg.sh
+++ b/gold/testsuite/debug_msg.sh
@@ -88,7 +88,7 @@ check_missing debug_msg.err "odr_violation1.cc:1[6-8]"
 check_missing debug_msg.err "odr_violation2.cc:2[3-5]"
 check debug_msg.err ": symbol 'SometimesInlineFunction(int)' defined in multiple places (possible ODR violation):"
 check debug_msg.err "debug_msg.cc:6[89]"
-check debug_msg.err "odr_violation2.cc:2[7-9]"
+check debug_msg.err "odr_violation2.cc:3[0-7]"
 
 # Check for the same error messages when using --compressed-debug-sections.
 if test -r debug_msg_cdebug.err
@@ -114,7 +114,7 @@ then
   check_missing debug_msg_cdebug.err "odr_violation2.cc:2[3-5]"
   check debug_msg_cdebug.err ": symbol 'SometimesInlineFunction(int)' defined in multiple places (possible ODR violation):"
   check debug_msg_cdebug.err "debug_msg.cc:6[89]"
-  check debug_msg_cdebug.err "odr_violation2.cc:2[7-9]"
+  check debug_msg_cdebug.err "odr_violation2.cc:3[0-7]"
 fi
 
 # When linking together .so's, we don't catch the line numbers, but we
@@ -132,7 +132,7 @@ check_missing debug_msg_so.err "odr_violation1.cc:1[6-8]"
 check_missing debug_msg_so.err "odr_violation2.cc:2[3-5]"
 check debug_msg_so.err ": symbol 'SometimesInlineFunction(int)' defined in multiple places (possible ODR violation):"
 check debug_msg_so.err "debug_msg.cc:6[89]"
-check debug_msg_so.err "odr_violation2.cc:2[7-9]"
+check debug_msg_so.err "odr_violation2.cc:3[0-7]"
 
 # These messages shouldn't need any debug info to detect:
 check debug_msg_ndebug.err "debug_msg_ndebug.so: error: undefined reference to 'undef_fn1()'"
diff --git a/gold/testsuite/odr_violation2.cc b/gold/testsuite/odr_violation2.cc
index e3d30f3..aa9868f 100644
--- a/gold/testsuite/odr_violation2.cc
+++ b/gold/testsuite/odr_violation2.cc
@@ -23,6 +23,14 @@ void SortDescending(int array[], int size) {
 extern "C" int OverriddenCFunction(int i) {
   return i * i;
 }
+
+// Extra lines to put SometimeInlineFunction at line 30+.
+
+// And a dummy function to workaround a GCC 7 bug with debug line numbers.
+int DummyFunction(int i) {
+  return i ^ 0x5555;
+}
+
 // This is inline in debug_msg.cc, which makes it a weak symbol too.
 int SometimesInlineFunction(int i) {
   return i * i;


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