[GOLD] discard_locals test

Alan Modra amodra@gmail.com
Wed Mar 6 11:54:00 GMT 2013


This test no doubt was written for x86, where the object happens to
have a relocation referencing .LC0 (and thus that local symbols needs
to be kept).  OK to apply?

	* testsuite/discard_locals_relocatable_test.c: Add a powerpc
	relocation referencing .LC0.
	* testsuite/discard_locals_test.sh: Remove FIXMEs.

Index: gold/testsuite/discard_locals_relocatable_test.c
===================================================================
RCS file: /cvs/src/src/gold/testsuite/discard_locals_relocatable_test.c,v
retrieving revision 1.1
diff -u -p -r1.1 discard_locals_relocatable_test.c
--- gold/testsuite/discard_locals_relocatable_test.c	3 Mar 2010 19:31:54 -0000	1.1
+++ gold/testsuite/discard_locals_relocatable_test.c	6 Mar 2013 09:51:12 -0000
@@ -31,6 +31,15 @@
    in the output object file. */
 asm (".Lshould_be_discarded:");
 
+#ifdef __powerpc__
+/* Test wants to keep one local.  Satisfy it.  */
+#ifdef __powerpc64__
+asm (".reloc 0,R_PPC64_NONE,.LC0");
+#else
+asm (".reloc 0,R_PPC_NONE,.LC0");
+#endif
+#endif
+
 extern void print_func (const char* s);
 
 extern int func (void);
Index: gold/testsuite/discard_locals_test.sh
===================================================================
RCS file: /cvs/src/src/gold/testsuite/discard_locals_test.sh,v
retrieving revision 1.3
diff -u -p -r1.3 discard_locals_test.sh
--- gold/testsuite/discard_locals_test.sh	5 Sep 2012 11:01:43 -0000	1.3
+++ gold/testsuite/discard_locals_test.sh	6 Mar 2013 09:51:12 -0000
@@ -55,10 +55,8 @@ check_non_discarded()
 
 check_discarded     "discard_locals_test.syms" "should_be_discarded"
 
-# FIXME: gcc doesn't generate a .LC0 sym for powerpc64
 check_non_discarded "discard_locals_relocatable_test1.syms" ".LC0"
 check_discarded     "discard_locals_relocatable_test1.syms" "should_be_discarded"
-# FIXME: gcc doesn't generate a .LC0 sym for powerpc64
 check_non_discarded "discard_locals_relocatable_test2.syms" ".LC0"
 check_discarded     "discard_locals_relocatable_test2.syms" "should_be_discarded"
 

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list