libgo patch committed: Only look for data symbols on big-endian PPC64 non-AIX

Message ID CAOyqgcUFEc-nNmXyQJiCGZHxS2h72tOwKKVcGM4LhFdwkTtCPw@mail.gmail.com
State New
Headers show
Series
  • libgo patch committed: Only look for data symbols on big-endian PPC64 non-AIX
Related show

Commit Message

Ian Lance Taylor April 20, 2018, 8:40 p.m.
The libgo gotest script runs nm to find tests to run.  It normally
looks only for T (text) symbols, but on ppc64 also looks for D (data)
symbols, because on PPC64 ELF ABI v1 function symbols are actually
descriptors in the data segment.  This patch changes the script to not
do this on AIX, and to not do it for ppc64le which always uses ELF ABI
v2.  Bootstrapped and ran libgo testsuite on x86_64-pc-linux-gnu.
Committed to mainline.

Ian

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 259452)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-b367349d85f315e94e10ee2d76a7c6a46b993dcb
+7b37b9c3f9338a1387ee1e2301de89c3d2d87d2b
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/testsuite/gotest
===================================================================
--- libgo/testsuite/gotest	(revision 259359)
+++ libgo/testsuite/gotest	(working copy)
@@ -506,9 +506,13 @@  localname() {
 
 {
 	text="T"
-	case "$goarch" in
-	ppc64*) text="[TD]" ;;
-	esac
+
+	# On systems using PPC64 ELF ABI v1 function symbols show up
+	# as descriptors in the data section.  We assume that $goarch
+	# distinguishes v1 (ppc64) from v2 (ppc64le).
+	if test "$goos" != "aix" && test "$goarch" = "ppc64"; then
+	    text="[TD]"
+	fi
 
 	symtogo='sed -e s/_test\([^A-Za-z0-9]\)/XXXtest\1/ -e s/.*_\([^_]*\.\)/\1/ -e s/XXXtest/_test/'