From 864a1b5697c632281022d564dae8811962269415 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 5 Sep 2012 11:01:43 +0000 Subject: [PATCH] * 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. --- gold/ChangeLog | 19 +++++++++++++++++++ gold/configure | 2 +- gold/configure.ac | 2 +- gold/testsuite/Makefile.am | 6 +++--- gold/testsuite/Makefile.in | 10 +++++----- gold/testsuite/discard_locals_test.sh | 2 ++ gold/testsuite/justsyms_exec.c | 3 +++ gold/testsuite/pr14265.t | 2 ++ gold/testsuite/script_test_2.t | 1 + gold/testsuite/script_test_3.t | 1 + gold/testsuite/script_test_4.t | 1 + gold/testsuite/script_test_5.t | 1 + gold/testsuite/script_test_6.t | 1 + gold/testsuite/script_test_7.t | 1 + gold/testsuite/script_test_9.t | 1 + 15 files changed, 43 insertions(+), 10 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index faa228ec364..72f3085c835 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,22 @@ +2012-09-05 Alan Modra + + * 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. + 2012-09-05 Alan Modra * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const. diff --git a/gold/configure b/gold/configure index 0bffe088c86..dff9cacccde 100755 --- a/gold/configure +++ b/gold/configure @@ -6279,7 +6279,7 @@ fi if case $target_cpu in - i?86) true;; + powerpc*) false;; x86_64) false;; sparc64) false;; *) true;; diff --git a/gold/configure.ac b/gold/configure.ac index 05e807b6443..69fe2091595 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -304,7 +304,7 @@ dnl tell the unittest framework if we're compiling for one of those 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;; diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 146c7e03b85..4840f080dc8 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -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_layout.cc 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 memory_test memory_test.o 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 $< > $@ diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index b937ff0e952..27b3a90830d 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -330,7 +330,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.syms \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_9.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_final_layout.stdout \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_final_layout.readelf.stdout +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_final_layout_readelf.stdout # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_36 = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_1.err \ @@ -4316,7 +4316,7 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@final_layout: final_layout.o final_layout_sequence.txt gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt final_layout.o @GCC_TRUE@@NATIVE_LINKER_TRUE@final_layout.stdout: final_layout -@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_NM) -n final_layout > final_layout.stdout +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_NM) -n --synthetic final_layout > final_layout.stdout @GCC_TRUE@@NATIVE_LINKER_TRUE@icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld @@ -4875,8 +4875,8 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout.stdout: plugin_final_layout -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout.readelf.stdout: plugin_final_layout +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout_readelf.stdout: plugin_final_layout @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_section_order.so: plugin_section_order.o @@ -5084,7 +5084,7 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@memory_test.o: memory_test.s @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -o $@ -c $< @GCC_TRUE@@NATIVE_LINKER_TRUE@memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t -@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -T $(srcdir)/memory_test.t -o $@ memory_test.o @GCC_TRUE@@NATIVE_LINKER_TRUE@memory_test.stdout: memory_test @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -lWS $< > $@ @GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test.o: gdb_index_test.cc diff --git a/gold/testsuite/discard_locals_test.sh b/gold/testsuite/discard_locals_test.sh index 3fc679a4585..0d0a118472d 100755 --- a/gold/testsuite/discard_locals_test.sh +++ b/gold/testsuite/discard_locals_test.sh @@ -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" diff --git a/gold/testsuite/justsyms_exec.c b/gold/testsuite/justsyms_exec.c index 6155147d8c6..66702863b7f 100644 --- a/gold/testsuite/justsyms_exec.c +++ b/gold/testsuite/justsyms_exec.c @@ -47,7 +47,10 @@ check(void *sym, long v, const char *name) int main(void) { +#ifndef __powerpc64__ + /* PowerPC64 uses function descriptors. */ check(exported_func, 0x1000200, "exported_func"); +#endif check(&exported_data, 0x2000000, "exported_data"); return errs; } diff --git a/gold/testsuite/pr14265.t b/gold/testsuite/pr14265.t index eec56e77299..e6d163af5ca 100644 --- a/gold/testsuite/pr14265.t +++ b/gold/testsuite/pr14265.t @@ -15,6 +15,8 @@ SECTIONS KEEP(*(.foo2.*)) __foo2_end = .; } + + .got : { *(.got .toc) } } diff --git a/gold/testsuite/script_test_2.t b/gold/testsuite/script_test_2.t index 6a0188f8bc4..81ed9aadab4 100644 --- a/gold/testsuite/script_test_2.t +++ b/gold/testsuite/script_test_2.t @@ -32,6 +32,7 @@ SECTIONS . += 0x100000; . = ALIGN(0x100); .data : { *(.data) } + .got : { *(.got .toc) } .bss : { *(.bss) } /* Now the real test. */ diff --git a/gold/testsuite/script_test_3.t b/gold/testsuite/script_test_3.t index c97099cfaed..9c75194c49e 100644 --- a/gold/testsuite/script_test_3.t +++ b/gold/testsuite/script_test_3.t @@ -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; diff --git a/gold/testsuite/script_test_4.t b/gold/testsuite/script_test_4.t index 98417733b8d..f5569c5e2d7 100644 --- a/gold/testsuite/script_test_4.t +++ b/gold/testsuite/script_test_4.t @@ -37,6 +37,7 @@ SECTIONS . = ALIGN(0x100); .dynamic : { *(.dynamic) } .data : { *(.data) } + .got : { *(.got .toc) } . += 0x100000; . = ALIGN(0x100); .bss : { *(.bss) } diff --git a/gold/testsuite/script_test_5.t b/gold/testsuite/script_test_5.t index fe67c4e5f86..4a7d13f6e67 100644 --- a/gold/testsuite/script_test_5.t +++ b/gold/testsuite/script_test_5.t @@ -37,6 +37,7 @@ SECTIONS . = ALIGN(0x100); .dynamic : { *(.dynamic) } .data : { *(.data) } + .got : { *(.got .toc) } . += 0x100000; . = ALIGN(0x100); .bss : { *(.bss) } diff --git a/gold/testsuite/script_test_6.t b/gold/testsuite/script_test_6.t index 01a8a171fd5..d3127e39fee 100644 --- a/gold/testsuite/script_test_6.t +++ b/gold/testsuite/script_test_6.t @@ -38,6 +38,7 @@ SECTIONS . = ALIGN(0x100); .dynamic : { *(.dynamic) } .data : { *(.data) } + .got : { *(.got .toc) } . += 0x100000; . = ALIGN(0x100); .bss : { *(.bss) } diff --git a/gold/testsuite/script_test_7.t b/gold/testsuite/script_test_7.t index 7adcf5fdf5e..ab2bbeea381 100644 --- a/gold/testsuite/script_test_7.t +++ b/gold/testsuite/script_test_7.t @@ -38,6 +38,7 @@ SECTIONS . = SEGMENT_START(".data", 0x10200000); .data : { *(.data) } + .got : { *(.got .toc) } . = SEGMENT_START(".bss", 0x10400000); .bss : { *(.bss) } diff --git a/gold/testsuite/script_test_9.t b/gold/testsuite/script_test_9.t index df055ba0f26..e7138b274d4 100644 --- a/gold/testsuite/script_test_9.t +++ b/gold/testsuite/script_test_9.t @@ -16,6 +16,7 @@ SECTIONS .data : { } :data + .got : { *(.got .toc) } .tdata : { *(.tdata*) -- 2.30.2