--- ./libgo/testsuite/gotest_orig	2018-09-11 06:06:24 +0000
+++ ./libgo/testsuite/gotest	2018-09-11 06:09:09 +0000
@@ -17,6 +17,7 @@
 
 GC=${GC:-gccgo}
 GL=${GL:-${GC-gccgo}}
+GL="${GL} -Wl,-bernotok -static-libgo -Wl,-bbigtoc"
 GOLIBS=${GOLIBS:-}
 export GC GL GOLIBS
 
@@ -514,7 +515,7 @@
 	    text="[TD]"
 	fi
 
-	symtogo='sed -e s/_test\([^A-Za-z0-9]\)/XXXtest\1/ -e s/.*_\([^_]*\.\)/\1/ -e s/XXXtest/_test/'
+	symtogo='sed -e s/_test\([^A-Za-z0-9]\)/XXXtest\1/ -e s/.*_\([^_]*\.\)/\1/ -e s/XXXtest/_test/ -e s/^\.//'
 
 	# test functions are named TestFoo
 	# the grep -v eliminates methods and other special names
@@ -614,6 +615,8 @@
 	${GL} *.o ${GOLIBS}
 
 	set +e
+	cp a.out a.out.ORIGIN
+	(strip -X32_64 -t a.out || true)
 	if test "$bench" = ""; then
 		if test "$trace" = "true"; then
 		    echo ./a.out -test.short -test.timeout=${timeout}s "$@"
