This commit was manufactured by cvs2svn to create branch 'binutils-
[external/binutils.git] / gold / testsuite / Makefile.am
index 31b39be..72917f9 100644 (file)
@@ -631,11 +631,11 @@ check_PROGRAMS += weak_alias_test
 weak_alias_test_SOURCES = weak_alias_test_main.cc
 weak_alias_test_DEPENDENCIES = \
        gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
-       weak_alias_test_3.o weak_alias_test_4.so
+       weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so
 weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 weak_alias_test_LDADD = \
        weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
-       weak_alias_test_4.so
+       weak_alias_test_4.so weak_alias_test_5.so
 weak_alias_test_1_pic.o: weak_alias_test_1.cc
        $(CXXCOMPILE) -c -fpic -o $@ $<
 weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
@@ -650,6 +650,11 @@ weak_alias_test_4_pic.o: weak_alias_test_4.cc
        $(CXXCOMPILE) -c -fpic -o $@ $<
 weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
        $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
+weak_alias_test_5_pic.o: weak_alias_test_5.cc
+       $(CXXCOMPILE) -c -fpic -o $@ $<
+weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld
+       $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \
+               -Wl,--version-script,$(srcdir)/weak_alias_test.script
 
 check_SCRIPTS += weak_plt.sh
 check_PROGRAMS += weak_plt
@@ -1000,6 +1005,18 @@ flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
 
 endif HAVE_ZLIB
 
+# Test -TText and -Tdata.
+check_PROGRAMS += flagstest_o_ttext_1
+flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld
+       $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000
+
+# This version won't be runnable, because there is no way to put the
+# PT_PHDR segment at file offset 0.  We just make sure that we can
+# build it without error.
+check_DATA += flagstest_o_ttext_2
+flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld
+       $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010
+
 # Test symbol versioning.
 check_PROGRAMS += ver_test
 ver_test_SOURCES = ver_test_main.cc
@@ -1158,6 +1175,14 @@ relro_test_pic.o: relro_test.cc
 relro_test.stdout: relro_test.so
        $(TEST_READELF) -SlW relro_test.so > relro_test.stdout
 
+check_PROGRAMS += relro_now_test
+relro_now_test_SOURCES = relro_test_main.cc
+relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so
+relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now
+relro_now_test_LDADD = relro_now_test.so
+relro_now_test.so: gcctestdir/ld relro_test_pic.o
+       $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o
+
 check_PROGRAMS += relro_strip_test
 relro_strip_test_SOURCES = relro_test_main.cc
 relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
@@ -1196,6 +1221,16 @@ justsyms_2.o: justsyms_2.cc
 justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
        gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
 
+check_PROGRAMS += justsyms_exec
+justsyms_exec_SOURCES = justsyms_exec.c
+justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib
+justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib
+justsyms_exec_LDADD =
+justsyms_lib.o: justsyms_lib.c
+       $(COMPILE) -c -o $@ $<
+justsyms_lib: justsyms_lib.o gcctestdir/ld
+       gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o
+
 check_PROGRAMS += binary_test
 MOSTLYCLEANFILES += binary.txt
 binary_test_SOURCES = binary_test.cc
@@ -1629,6 +1664,7 @@ ifuncmain1pie.o: ifuncmain1.c
        $(COMPILE) -c -fpie -o $@ $<
 
 if HAVE_STATIC
+if IFUNC_STATIC
 check_PROGRAMS += ifuncmain1static
 ifuncmain1static_SOURCES = ifuncmain1.c
 ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
@@ -1639,6 +1675,7 @@ check_PROGRAMS += ifuncmain1picstatic
 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
 endif
+endif
 
 check_PROGRAMS += ifuncmain1
 ifuncmain1_SOURCES = ifuncmain1.c
@@ -1687,6 +1724,7 @@ ifuncdep2pic.o: ifuncdep2.c
        $(COMPILE) -c -fpic -o $@ $<
 
 if HAVE_STATIC
+if IFUNC_STATIC
 check_PROGRAMS += ifuncmain2static
 ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
@@ -1697,6 +1735,7 @@ check_PROGRAMS += ifuncmain2picstatic
 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
 endif
+endif
 
 check_PROGRAMS += ifuncmain2
 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
@@ -1723,6 +1762,7 @@ ifuncmain4pic.o: ifuncmain4.c
        $(COMPILE) -c -fpic -o $@ $<
 
 if HAVE_STATIC
+if IFUNC_STATIC
 check_PROGRAMS += ifuncmain4static
 ifuncmain4static_SOURCES = ifuncmain4.c
 ifuncmain4static_DEPENDENCIES = gcctestdir/ld
@@ -1733,6 +1773,7 @@ check_PROGRAMS += ifuncmain4picstatic
 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
 endif
+endif
 
 check_PROGRAMS += ifuncmain4
 ifuncmain4_SOURCES = ifuncmain4.c
@@ -1755,6 +1796,7 @@ ifuncdep5.o: ifuncmod5.c
        $(COMPILE) -c -o $@ $<
 
 if HAVE_STATIC
+if IFUNC_STATIC
 check_PROGRAMS += ifuncmain5static
 ifuncmain5static_SOURCES = ifuncmain5.c
 ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
@@ -1765,6 +1807,7 @@ check_PROGRAMS += ifuncmain5picstatic
 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
 endif
+endif
 
 check_PROGRAMS += ifuncmain5
 ifuncmain5_SOURCES = ifuncmain5.c
@@ -1803,6 +1846,7 @@ ifuncmain7pie.o: ifuncmain7.c
        $(COMPILE) -c -fpie -o $@ $<
 
 if HAVE_STATIC
+if IFUNC_STATIC
 check_PROGRAMS += ifuncmain7static
 ifuncmain7static_SOURCES = ifuncmain7.c
 ifuncmain7static_DEPENDENCIES = gcctestdir/ld
@@ -1813,6 +1857,7 @@ check_PROGRAMS += ifuncmain7picstatic
 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
 endif
+endif
 
 check_PROGRAMS += ifuncmain7
 ifuncmain7_SOURCES = ifuncmain7.c
@@ -1828,6 +1873,18 @@ check_PROGRAMS += ifuncmain7pie
 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
 
+check_PROGRAMS += ifuncvar
+ifuncvar1_pic.o: ifuncvar1.c
+       $(COMPILE) -c -fpic -o $@ $<
+ifuncvar2_pic.o: ifuncvar2.c   
+       $(COMPILE) -c -fpic -o $@ $<
+ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
+       $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o
+ifuncvar_SOURCES = ifuncvar3.c
+ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
+ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+ifuncvar_LDADD = ifuncvar.so
+
 endif IFUNC
 
 # Test that strong reference to a weak symbol in a DSO remains strong.
@@ -1893,22 +1950,33 @@ memory_test.stdout: memory_test
 
 if DEFAULT_TARGET_X86_64
 
+two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
+       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+two_file_test_1_ndebug.o: two_file_test_1.cc
+       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+two_file_test_1b_ndebug.o: two_file_test_1b.cc
+       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+two_file_test_2_ndebug.o: two_file_test_2.cc
+       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+two_file_test_main_ndebug.o: two_file_test_main.cc
+       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+
 check_PROGRAMS += incremental_test_2
 MOSTLYCLEANFILES += two_file_test_tmp_2.o
-incremental_test_2: two_file_test_1_v1.o two_file_test_1.o two_file_test_1b.o \
-                   two_file_test_2.o two_file_test_main.o gcctestdir/ld
-       cp -f two_file_test_1_v1.o two_file_test_tmp_2.o
-       $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o
+incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
+                   two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
+       cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
        @sleep 1
-       cp -f two_file_test_1.o two_file_test_tmp_2.o
-       $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o
+       cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
+       $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
 
 check_PROGRAMS += incremental_test_3
 MOSTLYCLEANFILES += two_file_test_tmp_3.o
 incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
                    two_file_test_2.o two_file_test_main.o gcctestdir/ld
        cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
-       $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
        @sleep 1
        cp -f two_file_test_1b.o two_file_test_tmp_3.o
        $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
@@ -1918,16 +1986,42 @@ MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
 incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
                    two_file_test_2.o two_file_test_main.o gcctestdir/ld
        cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
-       $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
        mv -f incremental_test_4 incremental_test_4.base
        @sleep 1
        cp -f two_file_test_2.o two_file_test_tmp_4.o
        $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
 
+check_PROGRAMS += incremental_test_5
+MOSTLYCLEANFILES += two_file_test_5.a
+incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
+                   two_file_test_2.o two_file_test_main.o gcctestdir/ld
+       cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
+       $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
+       @sleep 1
+       cp -f two_file_test_1b.o two_file_test_tmp_5.o
+       $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
+       $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
+
+# Test the --incremental-unchanged flag with an archive library.
+# The second link should not update the library.
+check_PROGRAMS += incremental_test_6
+MOSTLYCLEANFILES += two_file_test_6.a
+incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
+                   two_file_test_2.o two_file_test_main.o gcctestdir/ld
+       cp -f two_file_test_1b.o two_file_test_tmp_6.o
+       $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
+       @sleep 1
+       cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
+       $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
+       $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
+
 check_PROGRAMS += incremental_copy_test
 incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
        cp -f copy_test_v1.o copy_test_tmp.o
-       $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
        @sleep 1
        cp -f copy_test.o copy_test_tmp.o
        $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
@@ -1935,11 +2029,22 @@ incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
 check_PROGRAMS += incremental_common_test_1
 incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
        cp -f common_test_1_v1.o common_test_1_tmp.o
-       $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ common_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o
        @sleep 1
        cp -f common_test_1_v2.o common_test_1_tmp.o
        $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o
 
+check_PROGRAMS += incremental_comdat_test_1
+incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld
+       cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
+       @sleep 1
+       cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
+       @sleep 1
+       cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
+
 endif DEFAULT_TARGET_X86_64
 
 endif GCC
@@ -2338,6 +2443,20 @@ pr12826_1.o: pr12826_1.s
 pr12826_2.o: pr12826_2.s
        $(TEST_AS) -o $@ $<
 
+check_SCRIPTS += arm_unaligned_reloc.sh
+check_DATA += arm_unaligned_reloc.stdout
+
+arm_unaligned_reloc.stdout: arm_unaligned_reloc
+       $(TEST_OBJDUMP) -D $< > $@
+
+arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new
+       ../ld-new -o $@ $<
+
+arm_unaligned_reloc.o: arm_unaligned_reloc.s
+       $(TEST_AS) -o $@ $<
+
+MOSTLYCLEANFILES += arm_unaligned_reloc
+
 endif DEFAULT_TARGET_ARM
 
 endif NATIVE_OR_CROSS_LINKER