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

[GOLD] testsuite tweaks for powerpc


Various test tweaks for powerpc.
- Non-pic shared libs don't work.
- Adding synthetic syms lets the test see the ordering of code sections
  which is what the tests are checking, rather than the ordering of
  .opd entries.
- memory_test assumes 4k pages
- justsyms_exec looks at the address of a function, which on powerpc64
  is the descriptor in .opd, a data section.
- .toc input sections on powerpc64 need to be part of the .got output
  section.

Tested on x86_64 too.  OK?

	* configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
	* configure: Regenerate.
	* testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
	(plugin_final_layout.stdout): Likewise.
	(memory_test): Set page sizes to 0x1000.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/discard_locals_test.sh: Add FIXME comment.
	* testsuite/justsyms_exec.c: Disable function test for powerpc64.
	* testsuite/pr14265.t: Add .got output section statement.
	* testsuite/script_test_2.t: Likewise.
	* testsuite/script_test_3.t: Likewise.
	* testsuite/script_test_4.t: Likewise.
	* testsuite/script_test_5.t: Likewise.
	* testsuite/script_test_6.t: Likewise.
	* testsuite/script_test_7.t: Likewise.
	* testsuite/script_test_9.t: Likewise.

Index: gold/configure.ac
===================================================================
RCS file: /cvs/src/src/gold/configure.ac,v
retrieving revision 1.76
diff -u -p -r1.76 configure.ac
--- gold/configure.ac	19 Jul 2012 00:19:34 -0000	1.76
+++ gold/configure.ac	5 Sep 2012 03:20:04 -0000
@@ -304,7 +304,7 @@ dnl tell the unittest framework if we're
 dnl targets, so it doesn't try to run the tests that do that.
 AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
   case $target_cpu in
-    i?86) true;;
+    powerpc*) false;;
     x86_64) false;;
     sparc64) false;;
     *) true;;
Index: gold/testsuite/Makefile.am
===================================================================
RCS file: /cvs/src/src/gold/testsuite/Makefile.am,v
retrieving revision 1.196
diff -u -p -r1.196 Makefile.am
--- gold/testsuite/Makefile.am	24 Aug 2012 18:35:34 -0000	1.196
+++ gold/testsuite/Makefile.am	5 Sep 2012 03:20:05 -0000
@@ -228,7 +228,7 @@ final_layout_sequence.txt:
 final_layout: final_layout.o final_layout_sequence.txt gcctestdir/ld
 	$(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt final_layout.o
 final_layout.stdout: final_layout
-	$(TEST_NM) -n final_layout > final_layout.stdout
+	$(TEST_NM) -n --synthetic final_layout > final_layout.stdout
 
 check_PROGRAMS += icf_virtual_function_folding_test
 MOSTLYCLEANFILES += icf_virtual_function_folding_test
@@ -1535,7 +1535,7 @@ plugin_final_layout.o: plugin_final_layo
 plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
 	$(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
 plugin_final_layout.stdout: plugin_final_layout
-	$(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout
+	$(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout
 plugin_final_layout_readelf.stdout: plugin_final_layout
 	$(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout
 
@@ -1975,7 +1975,7 @@ MOSTLYCLEANFILES += memory_test.stdout m
 memory_test.o: memory_test.s
 	$(COMPILE) -o $@ -c $<
 memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t
-	$(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o
+	$(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -T $(srcdir)/memory_test.t -o $@ memory_test.o
 memory_test.stdout: memory_test
 	$(TEST_READELF) -lWS  $< > $@
 
Index: gold/testsuite/discard_locals_test.sh
===================================================================
RCS file: /cvs/src/src/gold/testsuite/discard_locals_test.sh,v
retrieving revision 1.2
diff -u -p -r1.2 discard_locals_test.sh
--- gold/testsuite/discard_locals_test.sh	3 Mar 2010 19:31:54 -0000	1.2
+++ gold/testsuite/discard_locals_test.sh	5 Sep 2012 03:20:05 -0000
@@ -55,8 +55,10 @@ 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"
 
Index: gold/testsuite/justsyms_exec.c
===================================================================
RCS file: /cvs/src/src/gold/testsuite/justsyms_exec.c,v
retrieving revision 1.1
diff -u -p -r1.1 justsyms_exec.c
--- gold/testsuite/justsyms_exec.c	2 Aug 2011 00:37:41 -0000	1.1
+++ gold/testsuite/justsyms_exec.c	5 Sep 2012 03:20:05 -0000
@@ -47,7 +47,10 @@ check(void *sym, long v, const char *nam
 int
 main(void)
 {
+#ifndef __powerpc64__
+  /* PowerPC64 uses function descriptors.  */
   check(exported_func, 0x1000200, "exported_func");
+#endif
   check(&exported_data, 0x2000000, "exported_data");
   return errs;
 }
Index: gold/testsuite/pr14265.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/pr14265.t,v
retrieving revision 1.1
diff -u -p -r1.1 pr14265.t
--- gold/testsuite/pr14265.t	14 Aug 2012 08:31:57 -0000	1.1
+++ gold/testsuite/pr14265.t	5 Sep 2012 03:20:05 -0000
@@ -15,6 +15,8 @@ SECTIONS
         KEEP(*(.foo2.*))
         __foo2_end = .;
     }
+
+    .got : { *(.got .toc) }
 }
 
 
Index: gold/testsuite/script_test_2.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_2.t,v
retrieving revision 1.4
diff -u -p -r1.4 script_test_2.t
--- gold/testsuite/script_test_2.t	31 Oct 2011 22:51:03 -0000	1.4
+++ gold/testsuite/script_test_2.t	5 Sep 2012 03:20:05 -0000
@@ -32,6 +32,7 @@ SECTIONS
   . += 0x100000;
   . = ALIGN(0x100);
   .data : { *(.data) }
+  .got : { *(.got .toc) }
   .bss : { *(.bss) }
 
   /* Now the real test.  */
Index: gold/testsuite/script_test_3.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_3.t,v
retrieving revision 1.5
diff -u -p -r1.5 script_test_3.t
--- gold/testsuite/script_test_3.t	15 Sep 2010 17:39:57 -0000	1.5
+++ gold/testsuite/script_test_3.t	5 Sep 2012 03:20:05 -0000
@@ -35,6 +35,7 @@ SECTIONS
   . = ALIGN(0x100);
   .dynamic : { *(.dynamic) } :data :dynamic
   .data : { *(.data) } :data
+  .got : { *(.got .toc) }
   .tdata : { *(.tdata*) } :data :tls
   .tbss : { *(.tbss*) } :data :tls
   . += 0x100000;
Index: gold/testsuite/script_test_4.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_4.t,v
retrieving revision 1.2
diff -u -p -r1.2 script_test_4.t
--- gold/testsuite/script_test_4.t	15 Sep 2010 17:39:57 -0000	1.2
+++ gold/testsuite/script_test_4.t	5 Sep 2012 03:20:05 -0000
@@ -37,6 +37,7 @@ SECTIONS
   . = ALIGN(0x100);
   .dynamic : { *(.dynamic) }
   .data : { *(.data) }
+  .got : { *(.got .toc) }
   . += 0x100000;
   . = ALIGN(0x100);
   .bss : { *(.bss) }
Index: gold/testsuite/script_test_5.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_5.t,v
retrieving revision 1.2
diff -u -p -r1.2 script_test_5.t
--- gold/testsuite/script_test_5.t	15 Sep 2010 17:39:57 -0000	1.2
+++ gold/testsuite/script_test_5.t	5 Sep 2012 03:20:05 -0000
@@ -37,6 +37,7 @@ SECTIONS
   . = ALIGN(0x100);
   .dynamic : { *(.dynamic) }
   .data : { *(.data) }
+  .got : { *(.got .toc) }
   . += 0x100000;
   . = ALIGN(0x100);
   .bss : { *(.bss) }
Index: gold/testsuite/script_test_6.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_6.t,v
retrieving revision 1.2
diff -u -p -r1.2 script_test_6.t
--- gold/testsuite/script_test_6.t	15 Sep 2010 17:39:57 -0000	1.2
+++ gold/testsuite/script_test_6.t	5 Sep 2012 03:20:05 -0000
@@ -38,6 +38,7 @@ SECTIONS
   . = ALIGN(0x100);
   .dynamic : { *(.dynamic) }
   .data : { *(.data) }
+  .got : { *(.got .toc) }
   . += 0x100000;
   . = ALIGN(0x100);
   .bss : { *(.bss) }
Index: gold/testsuite/script_test_7.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_7.t,v
retrieving revision 1.2
diff -u -p -r1.2 script_test_7.t
--- gold/testsuite/script_test_7.t	15 Sep 2010 17:39:57 -0000	1.2
+++ gold/testsuite/script_test_7.t	5 Sep 2012 03:20:05 -0000
@@ -38,6 +38,7 @@ SECTIONS
 
   . = SEGMENT_START(".data", 0x10200000);
   .data : { *(.data) }
+  .got : { *(.got .toc) }
 
   . = SEGMENT_START(".bss", 0x10400000);
   .bss : { *(.bss) }
Index: gold/testsuite/script_test_9.t
===================================================================
RCS file: /cvs/src/src/gold/testsuite/script_test_9.t,v
retrieving revision 1.2
diff -u -p -r1.2 script_test_9.t
--- gold/testsuite/script_test_9.t	2 Mar 2011 21:59:36 -0000	1.2
+++ gold/testsuite/script_test_9.t	5 Sep 2012 03:20:05 -0000
@@ -16,6 +16,7 @@ SECTIONS
   .data :
   {
   } :data
+  .got : { *(.got .toc) }
   .tdata :
   {
     *(.tdata*)

-- 
Alan Modra
Australia Development Lab, IBM


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