[GOLD] debug_msg test

Cary Coutant ccoutant@google.com
Thu Mar 7 19:00:00 GMT 2013


> Yes, I'm sure we don't have a problem with the dwarf info.  (Or at
> least, it's not an easy problem to fix.)  PowerPC64 doesn't have a
> linker managed GOT like most other targets.  Instead the compiler
> manages the GOT (and calls it TOC).  That results in no relocation
> on the actual code referencing a variable, but one in the TOC section
> instead.  Like a linker managed GOT, a TOC entry can serve multiple
> references to a given symbol, so there isn't really any way to
> associate a TOC entry with a particular source/line.  I suppose we
> could modify gcc to output one source/line combo on TOC entries, but
> we don't do that currently.
>
> A similar situation happens on ppc32 with -fPIC and the .got2 section,
> which again is a compiler managed GOT.

It sounds like it's impractical, then, to get a line number in this
case, so I'd suggest suppressing that one check for powerpc.

Something like the attached should work.

        * testsuite/Makefile.am: Export DEFAULT_TARGET to test scripts.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/debug_msg.sh: Delete duplicate tests.  Don't check undef_int
        error message match for powerpc where the source file and line number
        aren't available.

-cary
-------------- next part --------------
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 499dba6..6da0438 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -53,6 +53,26 @@ TEST_AR = $(top_builddir)/../binutils/ar
 TEST_NM = $(top_builddir)/../binutils/nm-new
 TEST_AS = $(top_builddir)/../gas/as-new
 
+# Make the default target available to scripts as $DEFAULT_TARGET.
+if DEFAULT_TARGET_ARM
+export DEFAULT_TARGET = arm
+endif
+if DEFAULT_TARGET_I386
+export DEFAULT_TARGET = i386
+endif
+if DEFAULT_TARGET_POWERPC
+export DEFAULT_TARGET = powerpc
+endif
+if DEFAULT_TARGET_SPARC
+export DEFAULT_TARGET = sparc
+endif
+if DEFAULT_TARGET_X86_64
+export DEFAULT_TARGET = x86_64
+endif
+if DEFAULT_TARGET_TILEGX
+export DEFAULT_TARGET = tilegx
+endif
+
 if PLUGINS
 LIBDL = -ldl
 endif
diff --git a/gold/testsuite/debug_msg.sh b/gold/testsuite/debug_msg.sh
index c0d03b3..8c10d31 100755
--- a/gold/testsuite/debug_msg.sh
+++ b/gold/testsuite/debug_msg.sh
@@ -66,10 +66,10 @@ check debug_msg.err ".*/debug_msg.cc:50: error: undefined reference to 'undef_fn
 check debug_msg.err ".*/debug_msg.cc:55: error: undefined reference to 'undef_fn2()'"
 check debug_msg.err ".*/debug_msg.cc:43: error: undefined reference to 'undef_fn1()'"
 check debug_msg.err ".*/debug_msg.cc:44: error: undefined reference to 'undef_fn2()'"
-check debug_msg.err ".*/debug_msg.cc:.*: error: undefined reference to 'undef_int'"
-check debug_msg.err ".*/debug_msg.cc:43: error: undefined reference to 'undef_fn1()'"
-check debug_msg.err ".*/debug_msg.cc:44: error: undefined reference to 'undef_fn2()'"
-check debug_msg.err ".*/debug_msg.cc:.*: error: undefined reference to 'undef_int'"
+if test "$DEFAULT_TARGET" != "powerpc"
+then
+  check debug_msg.err ".*/debug_msg.cc:.*: error: undefined reference to 'undef_int'"
+fi
 
 # Check we detected the ODR (One Definition Rule) violation.
 check debug_msg.err ": symbol 'Ordering::operator()(int, int)' defined in multiple places (possible ODR violation):"
@@ -100,10 +100,10 @@ then
   check debug_msg_cdebug.err ".*/debug_msg.cc:55: error: undefined reference to 'undef_fn2()'"
   check debug_msg_cdebug.err ".*/debug_msg.cc:43: error: undefined reference to 'undef_fn1()'"
   check debug_msg_cdebug.err ".*/debug_msg.cc:44: error: undefined reference to 'undef_fn2()'"
-  check debug_msg_cdebug.err ".*/debug_msg.cc:.*: error: undefined reference to 'undef_int'"
-  check debug_msg_cdebug.err ".*/debug_msg.cc:43: error: undefined reference to 'undef_fn1()'"
-  check debug_msg_cdebug.err ".*/debug_msg.cc:44: error: undefined reference to 'undef_fn2()'"
-  check debug_msg_cdebug.err ".*/debug_msg.cc:.*: error: undefined reference to 'undef_int'"
+  if test "$DEFAULT_TARGET" != "powerpc"
+  then
+    check debug_msg_cdebug.err ".*/debug_msg.cc:.*: error: undefined reference to 'undef_int'"
+  fi
   check debug_msg_cdebug.err ": symbol 'Ordering::operator()(int, int)' defined in multiple places (possible ODR violation):"
   check debug_msg_cdebug.err "odr_violation1.cc:6"
   check debug_msg_cdebug.err "odr_violation2.cc:12"


More information about the Binutils mailing list