PR 11855
[deliverable/binutils-gdb.git] / gold / testsuite / Makefile.am
index afb704d15544120364dacf78ff6212847cdfeb89..c1eddcdb14433595c9cb3d2484ffb136c641ace7 100644 (file)
@@ -193,6 +193,18 @@ icf_safe_so_test_1.stdout: icf_safe_so_test
 icf_safe_so_test_2.stdout: icf_safe_so_test
        $(TEST_READELF) -h icf_safe_so_test > icf_safe_so_test_2.stdout
 
+check_SCRIPTS += final_layout.sh
+check_DATA += final_layout.stdout
+MOSTLYCLEANFILES += final_layout
+final_layout.o: final_layout.cc
+       $(CXXCOMPILE) -O0 -c -ffunction-sections  -fdata-sections -g -o $@ $<
+final_layout_sequence.txt:
+       (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > 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) final_layout > final_layout.stdout
+
 check_PROGRAMS += icf_virtual_function_folding_test
 MOSTLYCLEANFILES += icf_virtual_function_folding_test
 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
@@ -220,6 +232,18 @@ icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
 icf_string_merge_test.stdout: icf_string_merge_test
        $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
 
+check_SCRIPTS += icf_sht_rel_addend_test.sh
+check_DATA += icf_sht_rel_addend_test.stdout
+MOSTLYCLEANFILES += icf_sht_rel_addend_test
+icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
+       $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
+icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
+       $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
+icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
+       $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
+icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
+       $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
+
 check_PROGRAMS += basic_test
 check_PROGRAMS += basic_static_test
 check_PROGRAMS += basic_pic_test
@@ -1054,6 +1078,14 @@ relro_test.so: gcctestdir/ld relro_test_pic.o
 relro_test_pic.o: relro_test.cc
        $(CXXCOMPILE) -c -fpic -o $@ $<
 
+check_PROGRAMS += relro_strip_test
+relro_strip_test_SOURCES = relro_test_main.cc
+relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
+relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+relro_strip_test_LDADD = relro_strip_test.so
+relro_strip_test.so: relro_test.so
+       $(TEST_STRIP) -o $@ $<
+
 check_PROGRAMS += relro_script_test
 relro_script_test_SOURCES = relro_test_main.cc
 relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
@@ -1302,6 +1334,34 @@ plugin_test_7_2.o: plugin_test_7_2.c
        $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
 plugin_test_7.err: plugin_test_7
 
+# Test plugins with -r.
+check_PROGRAMS += plugin_test_8
+plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so
+       ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o
+plugin_test_8: plugin_test_8.o gcctestdir/ld
+       $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o
+
+# Test that symbols known in the IR file but not in the replacement file
+# produce an unresolved symbol error.
+check_DATA += plugin_test_9.err
+MOSTLYCLEANFILES += plugin_test_9.err
+plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so
+       @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms "2>$@"
+       @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms 2>$@; then \
+         echo 1>&2 "Link of plugin_test_9 should have failed"; \
+         rm -f $@; \
+         exit 1; \
+       fi
+# Make a .syms file that claims to define the symbol _Z4t16av.
+two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o
+       cp two_file_test_1.syms $@.tmp
+       grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp
+       mv -f $@.tmp $@
+# Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
+MOSTLYCLEANFILES += two_file_test_1c.o
+two_file_test_1c.o: two_file_test_1.o
+       cp two_file_test_1.o $@
+
 plugin_test.so: plugin_test.o
        $(LINK) -Bgcctestdir/ -shared plugin_test.o
 plugin_test.o: plugin_test.c
This page took 0.023882 seconds and 4 git commands to generate.