X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gold%2Ftestsuite%2FMakefile.am;h=e8d03f5f2b3372d17c3736d6f545d7e9e32a774a;hb=48c187ced8fcf0c09c26ab1782e63752bf206b4e;hp=fc4e78b5aba1d78873352d3e2f6471a8013631ff;hpb=155a0dd76368c9a61a2d640df534d25216963e86;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index fc4e78b5ab..e8d03f5f2b 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -9,6 +9,7 @@ AUTOMAKE_OPTIONS = # The two_file_test tests -fmerge-constants, so we simply always turn # it on. This may need to be controlled by a configure option # eventually. +AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants INCLUDES = \ @@ -21,6 +22,12 @@ TEST_READELF = $(top_builddir)/../binutils/readelf TEST_OBJDUMP = $(top_builddir)/../binutils/objdump TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt TEST_STRIP = $(top_builddir)/../binutils/strip-new +TEST_AR = $(top_builddir)/../binutils/ar +TEST_NM = $(top_builddir)/../binutils/nm-new + +if PLUGINS +LIBDL = -ldl +endif if THREADS THREADSLIB = -lpthread @@ -43,6 +50,8 @@ MOSTLYCLEANFILES = *.so check_SCRIPTS = check_DATA = check_PROGRAMS = +BUILT_SOURCES = + TESTS = $(check_SCRIPTS) $(check_PROGRAMS) # --------------------------------------------------------------------- @@ -55,7 +64,7 @@ libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc DEPENDENCIES = \ libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP) LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ - $(THREADSLIB) + $(THREADSLIB) $(LIBDL) # The unittests themselves @@ -95,6 +104,44 @@ flagstest_ndebug.o: constructor_test.cc $(CXXCOMPILE) -O0 -c -o $@ $< +check_SCRIPTS += gc_comdat_test.sh +check_DATA += gc_comdat_test.stdout +gc_comdat_test_1.o: gc_comdat_test_1.cc + $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< +gc_comdat_test_2.o: gc_comdat_test_2.cc + $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< +gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o +gc_comdat_test.stdout: gc_comdat_test + $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout + +check_SCRIPTS += gc_tls_test.sh +check_DATA += gc_tls_test.stdout +gc_tls_test.o: gc_tls_test.cc + $(CXXCOMPILE) -O0 -c -g -o $@ $< +gc_tls_test:gc_tls_test.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o +gc_tls_test.stdout: gc_tls_test + $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout + +check_SCRIPTS += icf_test.sh +check_DATA += icf_test.stdout +icf_test.o: icf_test.cc + $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< +icf_test: icf_test.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--icf icf_test.o +icf_test.stdout: icf_test + $(TEST_NM) -C icf_test > icf_test.stdout + +check_SCRIPTS += icf_keep_unique_test.sh +check_DATA += icf_keep_unique_test.stdout +icf_keep_unique_test.o: icf_keep_unique_test.cc + $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< +icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--icf -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o +icf_keep_unique_test.stdout: icf_keep_unique_test + $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout + check_PROGRAMS += basic_test check_PROGRAMS += basic_static_test check_PROGRAMS += basic_pic_test @@ -218,6 +265,11 @@ two_file_relocatable_test_LDADD = two_file_relocatable.o two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o +check_SCRIPTS += two_file_shared.sh +check_DATA += two_file_shared.dbg +two_file_shared.dbg: two_file_shared.so + $(TEST_READELF) -w $< >$@ 2>/dev/null + # The nonpic tests will fail on platforms which can not put non-PIC # code into shared libraries, so we just don't run them in that case. if FN_PTRS_IN_SO_WITHOUT_PIC @@ -413,19 +465,45 @@ weak_alias_test_LDADD = \ weak_alias_test_4.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 +weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o weak_alias_test_2_pic.o: weak_alias_test_2.cc $(CXXCOMPILE) -c -fpic -o $@ $< -weak_alias_test_2.so: weak_alias_test_2_pic.o +weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o weak_alias_test_3.o: weak_alias_test_3.cc $(CXXCOMPILE) -c -o $@ $< 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 +weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o +check_SCRIPTS += weak_plt.sh +check_PROGRAMS += weak_plt +check_DATA += weak_plt_shared.so +weak_plt_main_pic.o: weak_plt_main.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +weak_plt: weak_plt_main_pic.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o +weak_plt_shared_pic.o: weak_plt_shared.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o + +check_PROGRAMS += copy_test +copy_test_SOURCES = copy_test.cc +copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so +copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +copy_test_LDADD = copy_test_1.so copy_test_2.so +copy_test_1_pic.o: copy_test_1.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +copy_test_1.so: gcctestdir/ld copy_test_1_pic.o + $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o +copy_test_2_pic.o: copy_test_2.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +copy_test_2.so: gcctestdir/ld copy_test_2_pic.o + $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o + if TLS check_PROGRAMS += tls_test @@ -440,7 +518,7 @@ tls_test_file2_pic.o: tls_test_file2.cc tls_test_c_pic.o: tls_test_c.c $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld - $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o + $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o @@ -548,6 +626,30 @@ endif FN_PTRS_IN_SO_WITHOUT_PIC endif TLS +check_PROGRAMS += many_sections_test +many_sections_test_SOURCES = many_sections_test.cc +many_sections_test_DEPENDENCIES = gcctestdir/ld +many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic + +BUILT_SOURCES += many_sections_define.h +many_sections_define.h: + (for i in `seq 1 70000`; do \ + echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \ + done) > $@.tmp + mv -f $@.tmp $@ + +BUILT_SOURCES += many_sections_check.h +many_sections_check.h: + (for i in `seq 1 1000 70000`; do \ + echo "assert(var_$$i == $$i);"; \ + done) > $@.tmp + mv -f $@.tmp $@ + +check_PROGRAMS += many_sections_r_test +many_sections_r_test.o: many_sections_test.o gcctestdir/ld + gcctestdir/ld -r -o $@ many_sections_test.o +many_sections_r_test: many_sections_r_test.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS) if CONSTRUCTOR_PRIORITY @@ -684,6 +786,11 @@ ver_test_3.o: ver_test_3.cc ver_test_4.o: ver_test_4.cc $(CXXCOMPILE) -c -fpic -o $@ $< +check_SCRIPTS += ver_test_1.sh +check_DATA += ver_test_1.syms +ver_test_1.syms: ver_test_1.so + $(TEST_READELF) -s $< >$@ 2>/dev/null + check_PROGRAMS += ver_test_2 ver_test_2_SOURCES = ver_test_main_2.cc ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so @@ -724,6 +831,81 @@ check_DATA += ver_test_7.syms ver_test_7.syms: ver_test_7.so $(TEST_READELF) -s $< >$@ 2>/dev/null +check_PROGRAMS += ver_test_8 +ver_test_8_SOURCES = two_file_test_main.cc +ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so +ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so +ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so +ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o + +check_PROGRAMS += ver_test_9 +ver_test_9_SOURCES = ver_test_main.cc +ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so +ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +ver_test_9_LDADD = ver_test_9.so +ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so +ver_test_9.o: ver_test_9.cc + $(CXXCOMPILE) -c -fpic -o $@ $< + +check_SCRIPTS += ver_test_10.sh +check_DATA += ver_test_10.syms +ver_test_10.syms: ver_test_10.so + $(TEST_READELF) -s $< >$@ 2>/dev/null +ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script + $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o + +check_PROGRAMS += ver_test_11 +ver_test_11_SOURCES = ver_test_main_2.cc +ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a +ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +ver_test_11_LDADD = ver_test_11.a +ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o + $(TEST_AR) rc $@ $^ + +check_PROGRAMS += protected_1 +protected_1_SOURCES = \ + protected_main_1.cc protected_main_2.cc protected_main_3.cc +protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so +protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +protected_1_LDADD = protected_1.so + +protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o + $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o +protected_1_pic.o: protected_1.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +protected_2_pic.o: protected_2.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +protected_3_pic.o: protected_3.cc + $(CXXCOMPILE) -c -fpic -o $@ $< + +check_PROGRAMS += protected_2 +protected_2_SOURCES = protected_main_1.cc protected_3.cc +protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so +protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +protected_2_LDADD = protected_1.so + +check_PROGRAMS += relro_test +relro_test_SOURCES = relro_test_main.cc +relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so +relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +relro_test_LDADD = relro_test.so +relro_test.so: gcctestdir/ld relro_test_pic.o + $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o +relro_test_pic.o: relro_test.cc + $(CXXCOMPILE) -c -fpic -o $@ $< + +check_PROGRAMS += relro_script_test +relro_script_test_SOURCES = relro_test_main.cc +relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so +relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +relro_script_test_LDADD = relro_script_test.so +relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o + $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o + check_PROGRAMS += script_test_1 script_test_1_SOURCES = script_test_1.cc script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t @@ -778,5 +960,183 @@ script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t script_test_4.stdout: script_test_4 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout +check_SCRIPTS += script_test_5.sh +check_DATA += script_test_5.stdout +MOSTLYCLEANFILES += script_test_5.stdout +script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t + $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t +script_test_5.stdout: script_test_5 + $(TEST_READELF) -SW script_test_5 > script_test_5.stdout + +# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, +# and --dynamic-list-cpp-typeinfo + +check_SCRIPTS += dynamic_list.sh +check_DATA += dynamic_list.stdout +MOSTLYCLEANFILES += dynamic_list.stdout +dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t + $(CXXLINK) -Bgcctestdir/ basic_test.o \ + -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ + -Wl,--dynamic-list-data \ + -Wl,--dynamic-list-cpp-new \ + -Wl,--dynamic-list-cpp-typeinfo +dynamic_list.stdout: dynamic_list + $(TEST_READELF) -DWs dynamic_list > dynamic_list.stdout + +check_PROGRAMS += thin_archive_test_1 +thin_archive_test_1_SOURCES = thin_archive_main.cc +thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a +thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt +thin_archive_test_1_LDADD = libthin1.a -lthin2 + +check_PROGRAMS += thin_archive_test_2 +thin_archive_test_2_SOURCES = thin_archive_main.cc +thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a +thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. +thin_archive_test_2_LDADD = -lthinall + +libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o + rm -f $@ + $(TEST_AR) crT $@ $^ +alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o + rm -f $@ + $(TEST_AR) crT $@ $^ +libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o + rm -f $@ + $(TEST_AR) crT $@ $^ +alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o + rm -f $@ + $(TEST_AR) crT $@ $^ +libthinall.a: libthin3.a alt/libthin4.a + rm -f $@ + $(TEST_AR) crT $@ $^ +alt/thin_archive_test_2.o: thin_archive_test_2.cc + test -d alt || mkdir -p alt + $(CXXCOMPILE) -c -o $@ $< +alt/thin_archive_test_4.o: thin_archive_test_4.cc + test -d alt || mkdir -p alt + $(CXXCOMPILE) -c -o $@ $< + +if PLUGINS + +check_PROGRAMS += plugin_test_1 +check_SCRIPTS += plugin_test_1.sh +check_DATA += plugin_test_1.err +MOSTLYCLEANFILES += plugin_test_1.err +plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err +plugin_test_1.err: plugin_test_1 + @touch plugin_test_1.err + +check_PROGRAMS += plugin_test_2 +check_SCRIPTS += plugin_test_2.sh +check_DATA += plugin_test_2.err +MOSTLYCLEANFILES += plugin_test_2.err +plugin_test_2: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so 2>plugin_test_2.err +plugin_test_2.err: plugin_test_2 + @touch plugin_test_2.err + +check_PROGRAMS += plugin_test_3 +check_SCRIPTS += plugin_test_3.sh +check_DATA += plugin_test_3.err +MOSTLYCLEANFILES += plugin_test_3.err +plugin_test_3: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_3.err +plugin_test_3.err: plugin_test_3 + @touch plugin_test_3.err + +check_PROGRAMS += plugin_test_4 +check_SCRIPTS += plugin_test_4.sh +check_DATA += plugin_test_4.err +MOSTLYCLEANFILES += plugin_test_4.err +plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o -Wl,--whole-archive,plugin_test_4.a,--no-whole-archive 2>plugin_test_4.err +plugin_test_4.err: plugin_test_4 + @touch plugin_test_4.err + +plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms + $(TEST_AR) cr $@ $^ + +plugin_test.so: plugin_test.o + $(LINK) -Bgcctestdir/ -shared plugin_test.o +plugin_test.o: plugin_test.c + $(COMPILE) -O0 -c -fpic -o $@ $< + +two_file_test_main.syms: two_file_test_main.o + $(TEST_READELF) -sW $< >$@ 2>/dev/null +two_file_test_1.syms: two_file_test_1.o + $(TEST_READELF) -sW $< >$@ 2>/dev/null +two_file_test_1b.syms: two_file_test_1b.o + $(TEST_READELF) -sW $< >$@ 2>/dev/null +two_file_test_2.syms: two_file_test_2.o + $(TEST_READELF) -sW $< >$@ 2>/dev/null +empty.syms: + @echo "" >empty.syms + @echo "Symbol table" >>empty.syms + +endif PLUGINS + +check_PROGRAMS += exclude_libs_test +check_SCRIPTS += exclude_libs_test.sh +check_DATA += exclude_libs_test.syms +MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ + libexclude_libs_test_2.a alt/libexclude_libs_test_3.a +exclude_libs_test_SOURCES = exclude_libs_test.c +exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ + libexclude_libs_test_2.a alt/libexclude_libs_test_3.a +exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ + -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ + -Wl,--exclude-libs,libexclude_libs_test_3 +exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ + alt/libexclude_libs_test_3.a +exclude_libs_test.syms: exclude_libs_test + $(TEST_READELF) -sW $< >$@ 2>/dev/null +libexclude_libs_test_1.a: exclude_libs_test_1.o + $(TEST_AR) rc $@ $^ +libexclude_libs_test_2.a: exclude_libs_test_2.o + $(TEST_AR) rc $@ $^ +alt/libexclude_libs_test_3.a: exclude_libs_test_3.o + test -d alt || mkdir -p alt + $(TEST_AR) rc $@ $^ + +check_PROGRAMS += local_labels_test +local_labels_test.o: ver_test_6.c + $(COMPILE) -g -c -Wa,-L -o $@ $< +local_labels_test: local_labels_test.o + $(LINK) -Bgcctestdir/ local_labels_test.o + +check_PROGRAMS += discard_locals_test +check_SCRIPTS += discard_locals_test.sh +check_DATA += discard_locals_test.syms +MOSTLYCLEANFILES += discard_locals_test.syms +discard_locals_test_SOURCES = discard_locals_test.c +discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals +discard_locals_test.syms: discard_locals_test + $(TEST_READELF) -sW $< >$@ 2>/dev/null +# '-Wa,-L' is required to preserve the local label used for testing. +discard_locals_test.o: discard_locals_test.c + $(COMPILE) -c -Wa,-L -o $@ $< + +if MCMODEL_MEDIUM +check_PROGRAMS += large +large_SOURCES = large.c +large_CFLAGS = -mcmodel=medium +large_DEPENDENCIES = gcctestdir/ld +large_LDFLAGS = -Bgcctestdir/ +endif MCMODEL_MEDIUM + +# Test that hidden and internal symbols in the main program cannot be +# referenced by a shared library. +check_SCRIPTS += hidden_test.sh +check_DATA += hidden_test.err +MOSTLYCLEANFILES += hidden_test hidden_test.err +libhidden.so: hidden_test_1.c gcctestdir/ld + $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c +hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld + $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err +hidden_test.err: hidden_test + @touch hidden_test.err + endif GCC endif NATIVE_LINKER