Regenerate Makefile.in to get rid of annoying diffs caused by non-deterministic automake.
[deliverable/binutils-gdb.git] / gold / testsuite / Makefile.am
CommitLineData
5a6f7e2d
ILT
1# Process this file with automake to generate Makefile.in
2
537b5f51
ILT
3# As far as I can tell automake testing support assumes that the build
4# system and the host system are the same. So these tests will not
5# work when building with a cross-compiler.
6
14ec8efd
RW
7# Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS
8AUTOMAKE_OPTIONS = foreign -Wno-portability
5a6f7e2d 9
918357b9
L
10# This is where we get zlib from. zlib is in ../../zlib unless we were
11# configured with --with-system-zlib, in which case ../../zlib either
12# doesn't exist or not configured.
13ZLIB = -L../../zlib -lz
14
f958d5fc 15# The two_file_test tests -fmerge-constants, so we simply always turn
2b64b551
RM
16# it on. For compilers that do not support the command-line option,
17# we assume they just always emit SHF_MERGE sections unconditionally.
18AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(MERGE_CONSTANTS_FLAG)
19AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(MERGE_CONSTANTS_FLAG)
5a6f7e2d 20
14ec8efd 21AM_CPPFLAGS = \
5a6f7e2d 22 -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
155a0dd7 23 -I$(srcdir)/../../elfcpp -I.. \
5a6f7e2d
ILT
24 -DLOCALEDIR="\"$(datadir)/locale\"" \
25 @INCINTL@
26
ae447ddd
CC
27# Some versions of GCC now automatically enable linker plugins,
28# but we want to run our tests without GCC's plugins.
29if HAVE_NO_USE_LINKER_PLUGIN
30OPT_NO_PLUGINS = -fno-use-linker-plugin
31endif
32
aa543512
L
33# COMPILE1, LINK1, CXXCOMPILE1, CXXLINK1 are renamed from COMPILE, LINK,
34# CXXCOMPILE and CXXLINK generated by automake 1.11.1. FIXME: they should
35# be updated if they are different from automake used by gold.
36COMPILE1 = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
37 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
ae447ddd
CC
38LINK1 = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(OPT_NO_PLUGINS) \
39 $(AM_LDFLAGS) $(LDFLAGS) -o $@
aa543512
L
40CXXCOMPILE1 = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
41 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
ae447ddd
CC
42CXXLINK1 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(OPT_NO_PLUGINS) \
43 $(AM_LDFLAGS) $(LDFLAGS) -o $@
aa543512 44
ae447ddd 45# Strip out -Wp,-D_FORTIFY_SOURCE=, which is irrelevant for the gold
aa543512
L
46# testsuite and incompatible with -O0 used in gold tests, from
47# COMPILE, LINK, CXXCOMPILE and CXXLINK.
48COMPILE = `echo $(COMPILE1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9[0-9]]*//'`
49LINK = `echo $(LINK1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'`
50CXXCOMPILE = `echo $(CXXCOMPILE1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'`
51CXXLINK = `echo $(CXXLINK1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'`
52
3d587466
CC
53# Strip out -static-libgcc and -static-libstdc++ options, for tests
54# that must have these libraries linked dynamically. The -shared-libgcc
55# option does not work correctly, and there is no -shared-libstdc++ option.
56# (See GCC PR 55781 and PR 55782.)
57CXXLINK_S = `echo $(CXXLINK1) | sed -e 's/-static-lib\\(gcc\\|stdc++\\)//g'`
58
6835af53
ILT
59TEST_READELF = $(top_builddir)/../binutils/readelf
60TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
35c813e2 61TEST_OBJCOPY = $(top_builddir)/../binutils/objcopy
6835af53
ILT
62TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
63TEST_STRIP = $(top_builddir)/../binutils/strip-new
fbd8a257 64TEST_AR = $(top_builddir)/../binutils/ar
531813ad 65TEST_NM = $(top_builddir)/../binutils/nm-new
364c7fa5 66TEST_AS = $(top_builddir)/../gas/as-new
6835af53 67
89fc3421
CC
68if PLUGINS
69LIBDL = -ldl
70endif
71
fe9a4c12
ILT
72if THREADS
73THREADSLIB = -lpthread
74endif
75
155a0dd7
ILT
76if OMP_SUPPORT
77TLS_TEST_C_CFLAGS = -fopenmp
78endif
79
351a8000
ILT
80# 'make clean' is good about deleting some intermediate files (such as
81# .o's), but not all of them (such as .so's and .err files). We
82# improve on that here. automake-1.9 info docs say "mostlyclean" is
83# the right choice for files 'make' builds that people rebuild.
72fef11a 84MOSTLYCLEANFILES = *.so *.syms *.stdout
6eee141f 85
9df9de2c
CC
86# Export make variables to the shell scripts so that they can see
87# (for example) DEFAULT_TARGET.
88.EXPORT_ALL_VARIABLES:
2b64b551 89
351a8000
ILT
90# We will add to these later, for each individual test. Note
91# that we add each test under check_SCRIPTS or check_PROGRAMS;
92# the TESTS variable is automatically populated from these.
93check_SCRIPTS =
94check_DATA =
95check_PROGRAMS =
d491d34e
ILT
96BUILT_SOURCES =
97
351a8000 98TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
22dc1b09 99
351a8000
ILT
100# ---------------------------------------------------------------------
101# These tests test the internals of gold (unittests).
5a6f7e2d 102
351a8000 103# Infrastucture needed for the unittests
5a6f7e2d
ILT
104check_LIBRARIES = libgoldtest.a
105libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
106
ad2d6943
ILT
107DEPENDENCIES = \
108 libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
fe9a4c12 109LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
918357b9 110 $(THREADSLIB) $(LIBDL) $(ZLIB)
5a6f7e2d 111
5a6f7e2d 112
351a8000 113# The unittests themselves
eb373049 114if NATIVE_OR_CROSS_LINKER
90e24de5
ILT
115if GCC
116
117# Infrastucture needed for the unittests: a directory where the linker
118# is named 'ld'. This is because the -B flag appends 'ld' to its arg.
119gcctestdir/ld: ../ld-new
120 test -d gcctestdir || mkdir -p gcctestdir
121 rm -f gcctestdir/ld
122 (cd gcctestdir && $(LN_S) ../../ld-new ld)
123
472076e4
CC
124# Some tests require the latest features of an in-tree assembler.
125gcctestdir/as: $(TEST_AS)
126 test -d gcctestdir || mkdir -p gcctestdir
127 rm -f gcctestdir/as
128 (cd gcctestdir && $(LN_S) $(abs_top_builddir)/../gas/as-new as)
129
90e24de5
ILT
130endif GCC
131
351a8000 132check_PROGRAMS += object_unittest
5a6f7e2d 133object_unittest_SOURCES = object_unittest.cc
22dc1b09 134
bc644c6c
ILT
135check_PROGRAMS += binary_unittest
136binary_unittest_SOURCES = binary_unittest.cc
137
c2c7840a
CC
138check_PROGRAMS += leb128_unittest
139leb128_unittest_SOURCES = leb128_unittest.cc
140
44803b5d
CC
141check_PROGRAMS += overflow_unittest
142overflow_unittest_SOURCES = overflow_unittest.cc
143overflow_unittest.o: overflow_unittest.cc
144 $(CXXCOMPILE) -O3 -c -o $@ $<
145
eb373049 146endif NATIVE_OR_CROSS_LINKER
351a8000
ILT
147
148# ---------------------------------------------------------------------
149# These tests test the output of gold (end-to-end tests). In
150# particular, they make sure that gold can link "difficult" object
151# files, and the resulting object files run correctly. These can only
152# run if we've built ld-new for the native architecture (that is,
153# we're not cross-compiling it), since we run ld-new as part of these
154# tests. We use the gcc-specific flag '-B' to use our linker instead
155# of the default linker, which is why we only run our tests under gcc.
a360aedd 156
e2827e5f 157if NATIVE_LINKER
351a8000 158if GCC
e2827e5f 159
351a8000
ILT
160# Each of these .o's is a useful, small complete program. They're
161# particularly useful for making sure ld-new's flags do what they're
162# supposed to (hence their names), but are used for many tests that
163# don't actually involve analyzing input data.
43771f76
ILT
164flagstest_debug.o: constructor_test.cc
165 $(CXXCOMPILE) -O0 -g -c -o $@ $<
166flagstest_ndebug.o: constructor_test.cc
167 $(CXXCOMPILE) -O0 -c -o $@ $<
168
325e6408
RÁE
169check_SCRIPTS += incremental_test.sh
170check_DATA += incremental_test.stdout
0ec6429b 171MOSTLYCLEANFILES += incremental_test incremental_test.cmdline
325e6408
RÁE
172incremental_test_1.o: incremental_test_1.c
173 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
174incremental_test_2.o: incremental_test_2.c
175 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
176incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
943c8b43 177 $(LINK) -Bgcctestdir/ -Wl,--incremental-full -Wl,-z,norelro incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
325e6408
RÁE
178incremental_test.stdout: incremental_test ../incremental-dump
179 ../incremental-dump incremental_test > $@
43771f76 180
531813ad
ST
181check_SCRIPTS += gc_comdat_test.sh
182check_DATA += gc_comdat_test.stdout
72fef11a 183MOSTLYCLEANFILES += gc_comdat_test
2b64b551 184gc_comdat_test_1.o: gc_comdat_test_1.cc
4daadc0d 185 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
2b64b551 186gc_comdat_test_2.o: gc_comdat_test_2.cc
4daadc0d 187 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
531813ad 188gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
4daadc0d 189 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
531813ad
ST
190gc_comdat_test.stdout: gc_comdat_test
191 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
192
27721062
ST
193check_SCRIPTS += gc_tls_test.sh
194check_DATA += gc_tls_test.stdout
72fef11a 195MOSTLYCLEANFILES += gc_tls_test
27721062
ST
196gc_tls_test.o: gc_tls_test.cc
197 $(CXXCOMPILE) -O0 -c -g -o $@ $<
198gc_tls_test:gc_tls_test.o gcctestdir/ld
199 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
200gc_tls_test.stdout: gc_tls_test
201 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
202
f1ec9ded
ST
203check_SCRIPTS += gc_orphan_section_test.sh
204check_DATA += gc_orphan_section_test.stdout
205MOSTLYCLEANFILES += gc_orphan_section_test
206gc_orphan_section_test.o: gc_orphan_section_test.cc
207 $(CXXCOMPILE) -O0 -c -g -o $@ $<
208gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
209 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o
210gc_orphan_section_test.stdout: gc_orphan_section_test
211 $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout
212
b9b2ae8b
NC
213check_SCRIPTS += pr14265.sh
214check_DATA += pr14265.stdout
215MOSTLYCLEANFILES += pr14265
216pr14265.o: pr14265.c
217 $(COMPILE) -O0 -c -o $@ $<
2b64b551 218pr14265: pr14265.o
1496b446 219 $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,-T,$(srcdir)/pr14265.t -o $@ $<
b9b2ae8b
NC
220pr14265.stdout: pr14265
221 $(TEST_NM) --format=bsd --numeric-sort $< > $@
222
fd834e57
CC
223check_SCRIPTS += gc_dynamic_list_test.sh
224check_DATA += gc_dynamic_list_test.stdout
225MOSTLYCLEANFILES += gc_dynamic_list_test
226gc_dynamic_list_test.o: gc_dynamic_list_test.c
227 $(COMPILE) -c -ffunction-sections -o $@ $<
228gc_dynamic_list_test: gc_dynamic_list_test.o gcctestdir/ld $(srcdir)/gc_dynamic_list_test.t
229 $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,--dynamic-list,$(srcdir)/gc_dynamic_list_test.t gc_dynamic_list_test.o
230gc_dynamic_list_test.stdout: gc_dynamic_list_test
231 $(TEST_NM) gc_dynamic_list_test > $@
232
ef15dade 233check_SCRIPTS += icf_test.sh
4d9aa155
AM
234check_DATA += icf_test.map
235MOSTLYCLEANFILES += icf_test icf_test.map
2b64b551 236icf_test.o: icf_test.cc
ef15dade 237 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
54de2ea6 238icf_test: icf_test.o gcctestdir/ld
4d9aa155 239 $(CXXLINK) -o icf_test -Bgcctestdir/ -Wl,--icf=all,-Map,icf_test.map icf_test.o
54de2ea6
CC
240icf_test.map: icf_test
241 @touch icf_test.map
ef15dade 242
48c187ce
ST
243check_SCRIPTS += icf_keep_unique_test.sh
244check_DATA += icf_keep_unique_test.stdout
72fef11a 245MOSTLYCLEANFILES += icf_keep_unique_test
48c187ce
ST
246icf_keep_unique_test.o: icf_keep_unique_test.cc
247 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
248icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
032ce4e9 249 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
48c187ce 250icf_keep_unique_test.stdout: icf_keep_unique_test
4d9aa155 251 $(TEST_NM) -C $< > $@
531813ad 252
032ce4e9 253check_SCRIPTS += icf_safe_test.sh
4d9aa155
AM
254check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout icf_safe_test.map
255MOSTLYCLEANFILES += icf_safe_test icf_safe_test.map
21bb3914 256icf_safe_test.o: icf_safe_test.cc
032ce4e9 257 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
54de2ea6 258icf_safe_test: icf_safe_test.o gcctestdir/ld
4d9aa155 259 $(CXXLINK) -o icf_safe_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_test.map icf_safe_test.o
54de2ea6
CC
260icf_safe_test.map: icf_safe_test
261 @touch icf_safe_test.map
21bb3914 262icf_safe_test_1.stdout: icf_safe_test
4d9aa155 263 $(TEST_NM) $< > $@
21bb3914 264icf_safe_test_2.stdout: icf_safe_test
4d9aa155 265 $(TEST_READELF) -h $< > $@
21bb3914
ST
266
267check_SCRIPTS += icf_safe_so_test.sh
4d9aa155
AM
268check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout icf_safe_so_test.map
269MOSTLYCLEANFILES += icf_safe_so_test icf_safe_so_test.map
21bb3914
ST
270icf_safe_so_test.o: icf_safe_so_test.cc
271 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
54de2ea6 272icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
4d9aa155 273 $(CXXLINK) -o icf_safe_so_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_so_test.map icf_safe_so_test.o -fPIC -shared
54de2ea6
CC
274icf_safe_so_test.map:
275 @touch icf_safe_so_test.map
21bb3914 276icf_safe_so_test_1.stdout: icf_safe_so_test
4d9aa155 277 $(TEST_NM) $< > $@
21bb3914 278icf_safe_so_test_2.stdout: icf_safe_so_test
4d9aa155 279 $(TEST_READELF) -h $< > $@
032ce4e9 280
6e9ba2ca
ST
281check_SCRIPTS += final_layout.sh
282check_DATA += final_layout.stdout
9e9143bc 283MOSTLYCLEANFILES += final_layout final_layout_sequence.txt final_layout_script.lds
6e9ba2ca
ST
284final_layout.o: final_layout.cc
285 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
286final_layout_sequence.txt:
287 (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
9e9143bc 288final_layout_script.lds:
a39e4af6 289 (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .sbss : { *(.sbss*) } .bss : { *(.bss*) } }") > final_layout_script.lds
9e9143bc
ST
290final_layout: final_layout.o final_layout_sequence.txt final_layout_script.lds gcctestdir/ld
291 $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt -Wl,-T,final_layout_script.lds final_layout.o
6e9ba2ca 292final_layout.stdout: final_layout
864a1b56 293 $(TEST_NM) -n --synthetic final_layout > final_layout.stdout
6e9ba2ca 294
28f2a4ac 295check_SCRIPTS += text_section_grouping.sh
c6ac678d
ST
296check_DATA += text_section_grouping.stdout text_section_no_grouping.stdout
297MOSTLYCLEANFILES += text_section_grouping text_section_no_grouping
28f2a4ac
ST
298text_section_grouping.o: text_section_grouping.cc
299 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
300text_section_grouping: text_section_grouping.o gcctestdir/ld
301 $(CXXLINK) -Bgcctestdir/ text_section_grouping.o
c6ac678d
ST
302text_section_no_grouping: text_section_grouping.o gcctestdir/ld
303 $(CXXLINK) -Bgcctestdir/ -Wl,--no-text-reorder text_section_grouping.o
28f2a4ac 304text_section_grouping.stdout: text_section_grouping
c6ac678d
ST
305 $(TEST_NM) -n --synthetic text_section_grouping > text_section_grouping.stdout
306text_section_no_grouping.stdout: text_section_no_grouping
2b64b551 307 $(TEST_NM) -n --synthetic text_section_no_grouping > text_section_no_grouping.stdout
28f2a4ac 308
6934001a
CC
309check_SCRIPTS += section_sorting_name.sh
310check_DATA += section_sorting_name.stdout
311MOSTLYCLEANFILES += section_sorting_name
312section_sorting_name.o: section_sorting_name.cc
313 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
314section_sorting_name: section_sorting_name.o gcctestdir/ld
315 $(CXXLINK) -Bgcctestdir/ -Wl,--sort-section=name section_sorting_name.o
316section_sorting_name.stdout: section_sorting_name
317 $(TEST_NM) -n --synthetic section_sorting_name > section_sorting_name.stdout
318
2253bfba 319check_PROGRAMS += icf_virtual_function_folding_test
0ec6429b 320MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map
ce97fa81
ST
321icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
322 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
323icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld
324 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie
325
326check_SCRIPTS += icf_preemptible_functions_test.sh
327check_DATA += icf_preemptible_functions_test.stdout
328MOSTLYCLEANFILES += icf_preemptible_functions_test
329icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
330 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
331icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
332 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared
333icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
334 $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout
335
336check_SCRIPTS += icf_string_merge_test.sh
337check_DATA += icf_string_merge_test.stdout
338MOSTLYCLEANFILES += icf_string_merge_test
339icf_string_merge_test.o: icf_string_merge_test.cc
340 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
341icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
342 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o
343icf_string_merge_test.stdout: icf_string_merge_test
344 $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
345
41cbeecc
ST
346check_SCRIPTS += icf_sht_rel_addend_test.sh
347check_DATA += icf_sht_rel_addend_test.stdout
348MOSTLYCLEANFILES += icf_sht_rel_addend_test
349icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
350 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
351icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
352 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
353icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
354 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
355icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
356 $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
357
7fb47cc9
CC
358check_PROGRAMS += large_symbol_alignment
359large_symbol_alignment_SOURCES = large_symbol_alignment.cc
360large_symbol_alignment_DEPENDENCIES = gcctestdir/ld
361large_symbol_alignment_LDFLAGS = -Bgcctestdir/
54de2ea6 362large_symbol_alignment_LDADD =
7fb47cc9 363
e31908b6
CC
364check_SCRIPTS += merge_string_literals.sh
365check_DATA += merge_string_literals.stdout
366MOSTLYCLEANFILES += merge_string_literals
2b64b551 367merge_string_literals_1.o: merge_string_literals_1.cc
e31908b6 368 $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $<
2b64b551 369merge_string_literals_2.o: merge_string_literals_2.cc
e31908b6
CC
370 $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $<
371merge_string_literals: merge_string_literals_1.o merge_string_literals_2.o gcctestdir/ld
372 $(CXXLINK) -Bgcctestdir/ merge_string_literals_1.o merge_string_literals_2.o -O2 -shared -nostdlib
373merge_string_literals.stdout: merge_string_literals
374 $(TEST_OBJDUMP) -s -j.rodata merge_string_literals > merge_string_literals.stdout
375
351a8000 376check_PROGRAMS += basic_test
351a8000 377check_PROGRAMS += basic_pic_test
56ba9a23 378basic_test.o: basic_test.cc
22dc1b09 379 $(CXXCOMPILE) -O0 -c -o $@ $<
56ba9a23
ILT
380basic_test: basic_test.o gcctestdir/ld
381 $(CXXLINK) -Bgcctestdir/ basic_test.o
328c7c2f 382
cfbf0e3c
RÁE
383check_PROGRAMS += eh_test
384eh_test_a.o: eh_test_a.cc
385 $(CXXCOMPILE) -O0 -c -o $@ $<
386eh_test_b.o: eh_test_b.cc
387 $(CXXCOMPILE) -O0 -c -o $@ $<
388eh_test: eh_test_a.o eh_test_b.o gcctestdir/ld
389 $(CXXLINK_S) -Bgcctestdir/ eh_test_a.o eh_test_b.o
390
698400bf
CC
391check_SCRIPTS += eh_test_2.sh
392check_DATA += eh_test_2.sects
8db8e694 393MOSTLYCLEANFILES += eh_test_2 eh_test_2.sects
698400bf
CC
394eh_test_r.o: eh_test_a.o eh_test_b.o gcctestdir/ld
395 gcctestdir/ld -r -o $@ eh_test_a.o eh_test_b.o
396eh_test_2: eh_test_r.o gcctestdir/ld
397 $(CXXLINK_S) -Bgcctestdir/ -Wl,--eh-frame-hdr eh_test_r.o
398eh_test_2.sects: eh_test_2
399 $(TEST_READELF) -SW $< >$@ 2>/dev/null
400
328c7c2f
ILT
401if HAVE_STATIC
402check_PROGRAMS += basic_static_test
56ba9a23
ILT
403basic_static_test: basic_test.o gcctestdir/ld
404 $(CXXLINK) -Bgcctestdir/ -static basic_test.o
328c7c2f 405endif
22dc1b09 406
56ba9a23 407basic_pic_test.o: basic_test.cc
22dc1b09 408 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
56ba9a23
ILT
409basic_pic_test: basic_pic_test.o gcctestdir/ld
410 $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
328c7c2f
ILT
411
412if HAVE_STATIC
413check_PROGRAMS += basic_static_pic_test
56ba9a23
ILT
414basic_static_pic_test: basic_pic_test.o gcctestdir/ld
415 $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
328c7c2f 416endif
22dc1b09 417
374ad285
ILT
418check_PROGRAMS += basic_pie_test
419basic_pie_test.o: basic_test.cc
420 $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
421basic_pie_test: basic_pie_test.o gcctestdir/ld
422 $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o
351a8000
ILT
423
424check_PROGRAMS += constructor_test
d5026652
ILT
425constructor_test_SOURCES = constructor_test.cc
426constructor_test_DEPENDENCIES = gcctestdir/ld
427constructor_test_LDFLAGS = -Bgcctestdir/
1abce4a6 428constructor_test_LDADD =
d5026652 429
328c7c2f
ILT
430if HAVE_STATIC
431check_PROGRAMS += constructor_static_test
351a8000
ILT
432constructor_static_test_SOURCES = $(constructor_test_SOURCES)
433constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
434constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
1abce4a6 435constructor_static_test_LDADD = $(constructor_test_LDADD)
328c7c2f 436endif
351a8000
ILT
437
438check_PROGRAMS += two_file_test
351a8000 439check_PROGRAMS += two_file_pic_test
3bd52c28
ILT
440two_file_test_SOURCES = \
441 two_file_test_1.cc \
03e8f2b2 442 two_file_test_1b.cc \
3bd52c28
ILT
443 two_file_test_2.cc \
444 two_file_test_main.cc \
445 two_file_test.h
446two_file_test_DEPENDENCIES = gcctestdir/ld
447two_file_test_LDFLAGS = -Bgcctestdir/
1abce4a6 448two_file_test_LDADD =
3bd52c28 449
328c7c2f
ILT
450if HAVE_STATIC
451check_PROGRAMS += two_file_static_test
351a8000
ILT
452two_file_static_test_SOURCES = $(two_file_test_SOURCES)
453two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
454two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
1abce4a6 455two_file_static_test_LDADD = $(two_file_test_LDADD)
328c7c2f 456endif
f958d5fc
ILT
457
458two_file_pic_test_SOURCES = two_file_test_main.cc
459two_file_pic_test_DEPENDENCIES = \
03e8f2b2 460 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 461two_file_pic_test_LDFLAGS = -Bgcctestdir/
03e8f2b2 462two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 463
351a8000
ILT
464
465check_PROGRAMS += two_file_shared_1_test
466check_PROGRAMS += two_file_shared_2_test
467check_PROGRAMS += two_file_shared_1_pic_2_test
468check_PROGRAMS += two_file_shared_2_pic_1_test
469check_PROGRAMS += two_file_same_shared_test
470check_PROGRAMS += two_file_separate_shared_12_test
471check_PROGRAMS += two_file_separate_shared_21_test
472two_file_test_1_pic.o: two_file_test_1.cc
473 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
474two_file_test_1b_pic.o: two_file_test_1b.cc
475 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000
ILT
476two_file_test_2_pic.o: two_file_test_2.cc
477 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
478two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
479 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
351a8000
ILT
480two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
481 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
03e8f2b2
ILT
482two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
483 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
351a8000 484
3bd52c28
ILT
485two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
486two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
487two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
488two_file_shared_1_test_LDADD = two_file_shared_1.so
489
03e8f2b2 490two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
491two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
492two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
493two_file_shared_2_test_LDADD = two_file_shared_2.so
494
386c048c
ILT
495two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
496two_file_shared_1_pic_2_test_DEPENDENCIES = \
2f2de248 497 gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o
386c048c 498two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
03e8f2b2 499two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so
386c048c
ILT
500
501two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
502two_file_shared_2_pic_1_test_DEPENDENCIES = \
e051a5b5 503 gcctestdir/ld two_file_shared_1.so two_file_test_2_pic.o
386c048c
ILT
504two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
505two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
506
3bd52c28
ILT
507two_file_same_shared_test_SOURCES = two_file_test_main.cc
508two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
509two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
510two_file_same_shared_test_LDADD = two_file_shared.so
511
512two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
513two_file_separate_shared_12_test_DEPENDENCIES = \
514 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
515two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
516two_file_separate_shared_12_test_LDADD = \
517 two_file_shared_1.so two_file_shared_2.so
518
519two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
520two_file_separate_shared_21_test_DEPENDENCIES = \
521 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
522two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
523two_file_separate_shared_21_test_LDADD = \
524 two_file_shared_2.so two_file_shared_1.so
525
6a74a719
ILT
526check_PROGRAMS += two_file_relocatable_test
527two_file_relocatable_test_SOURCES = two_file_test_main.cc
528two_file_relocatable_test_DEPENDENCIES = \
529 gcctestdir/ld two_file_relocatable.o
530two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
531two_file_relocatable_test_LDADD = two_file_relocatable.o
532two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
533 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
534
374ad285
ILT
535check_PROGRAMS += two_file_pie_test
536two_file_test_1_pie.o: two_file_test_1.cc
537 $(CXXCOMPILE) -c -fpie -o $@ $<
538two_file_test_1b_pie.o: two_file_test_1b.cc
539 $(CXXCOMPILE) -c -fpie -o $@ $<
540two_file_test_2_pie.o: two_file_test_2.cc
541 $(CXXCOMPILE) -c -fpie -o $@ $<
542two_file_test_main_pie.o: two_file_test_main.cc
543 $(CXXCOMPILE) -c -fpie -o $@ $<
544two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
545 two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
546 $(CXXLINK) -Bgcctestdir/ -pie two_file_test_1_pie.o two_file_test_1b_pie.o two_file_test_2_pie.o two_file_test_main_pie.o
547
a82bef93
ST
548check_PROGRAMS += pie_copyrelocs_test
549pie_copyrelocs_test_SOURCES = pie_copyrelocs_test.cc
550pie_copyrelocs_test_DEPENDENCIES = gcctestdir/ld pie_copyrelocs_shared_test.so
4759c34e 551pie_copyrelocs_test_CXXFLAGS = -fno-exceptions -fno-asynchronous-unwind-tables
a82bef93
ST
552pie_copyrelocs_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -pie
553pie_copyrelocs_test_LDADD = pie_copyrelocs_shared_test.so
554pie_copyrelocs_shared_test.o: pie_copyrelocs_shared_test.cc
555 $(CXXCOMPILE) -O2 -fpic -c -o $@ $<
556pie_copyrelocs_shared_test.so: pie_copyrelocs_shared_test.o gcctestdir/ld
557 $(CXXLINK) -Bgcctestdir/ -shared pie_copyrelocs_shared_test.o
558
a100d66f
ST
559check_PROGRAMS += weak_unresolved_symbols_test
560weak_unresolved_symbols_test_SOURCES = weak_unresolved_symbols_test.cc
561weak_unresolved_symbols_test_CXXFLAGS = -fPIE
562weak_unresolved_symbols_test_LDFLAGS = -Bgcctestdir/ -pie -Wl,--weak-unresolved-symbols
563
031cdbed
ILT
564check_SCRIPTS += two_file_shared.sh
565check_DATA += two_file_shared.dbg
72fef11a 566MOSTLYCLEANFILES += two_file_shared.dbg
031cdbed
ILT
567two_file_shared.dbg: two_file_shared.so
568 $(TEST_READELF) -w $< >$@ 2>/dev/null
569
63402fe4
ILT
570# The nonpic tests will fail on platforms which can not put non-PIC
571# code into shared libraries, so we just don't run them in that case.
63402fe4 572if FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 573
351a8000
ILT
574check_PROGRAMS += two_file_shared_1_nonpic_test
575check_PROGRAMS += two_file_shared_2_nonpic_test
576check_PROGRAMS += two_file_same_shared_nonpic_test
577check_PROGRAMS += two_file_separate_shared_12_nonpic_test
578check_PROGRAMS += two_file_separate_shared_21_nonpic_test
03e8f2b2
ILT
579check_PROGRAMS += two_file_mixed_shared_test
580check_PROGRAMS += two_file_mixed_2_shared_test
351a8000 581two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
611062c0 582 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext
351a8000
ILT
583two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
584 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
03e8f2b2 585two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
611062c0 586 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext
03e8f2b2 587two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
611062c0 588 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext
03e8f2b2 589two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
611062c0 590 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext
351a8000 591
3bd52c28
ILT
592two_file_shared_1_nonpic_test_SOURCES = \
593 two_file_test_2.cc two_file_test_main.cc
594two_file_shared_1_nonpic_test_DEPENDENCIES = \
595 gcctestdir/ld two_file_shared_1_nonpic.so
596two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
597two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
598
599two_file_shared_2_nonpic_test_SOURCES = \
03e8f2b2 600 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
601two_file_shared_2_nonpic_test_DEPENDENCIES = \
602 gcctestdir/ld two_file_shared_2_nonpic.so
603two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
604two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
605
606two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
607two_file_same_shared_nonpic_test_DEPENDENCIES = \
608 gcctestdir/ld two_file_shared_nonpic.so
609two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
610two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
611
612two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
613two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
614 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
615two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
616two_file_separate_shared_12_nonpic_test_LDADD = \
617 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
618
619two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
620two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
621 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
622two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
623two_file_separate_shared_21_nonpic_test_LDADD = \
624 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
625
03e8f2b2
ILT
626two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
627two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
628two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
629two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
630
631two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
632two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
633two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
634two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
635
d89051bd
CC
636check_PROGRAMS += two_file_mixed_pie_test
637two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
638 two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
639 $(CXXLINK) -Bgcctestdir/ -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so
640
351a8000 641endif FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 642
6835af53
ILT
643check_PROGRAMS += two_file_strip_test
644two_file_strip_test: two_file_test
645 $(TEST_STRIP) -o two_file_strip_test two_file_test
646
647check_PROGRAMS += two_file_same_shared_strip_test
648two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
649two_file_same_shared_strip_test_DEPENDENCIES = \
650 gcctestdir/ld two_file_shared_strip.so
651two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
652two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
653two_file_shared_strip.so: two_file_shared.so
654 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
655
49bdd526
ILT
656check_PROGRAMS += common_test_1
657common_test_1_SOURCES = common_test_1.c
658common_test_1_DEPENDENCIES = gcctestdir/ld
659common_test_1_LDFLAGS = -Bgcctestdir/
1abce4a6 660common_test_1_LDADD =
351a8000 661
eda294df
ILT
662check_PROGRAMS += common_test_2
663common_test_2_SOURCES = common_test_1.c
664common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
665common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
666common_test_2_LDADD = common_test_2.so common_test_3.so
667common_test_2_pic.o: common_test_2.c
668 $(COMPILE) -c -fpic -o $@ $<
669common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld
670 $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so
671common_test_3_pic.o: common_test_3.c
672 $(COMPILE) -c -fpic -o $@ $<
673common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld
674 $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script
675
351a8000 676check_PROGRAMS += exception_test
351a8000
ILT
677check_PROGRAMS += exception_shared_1_test
678check_PROGRAMS += exception_shared_2_test
679check_PROGRAMS += exception_same_shared_test
680check_PROGRAMS += exception_separate_shared_12_test
681check_PROGRAMS += exception_separate_shared_21_test
682exception_test_1_pic.o: exception_test_1.cc
683 $(CXXCOMPILE) -c -fpic -o $@ $<
684exception_test_2_pic.o: exception_test_2.cc
685 $(CXXCOMPILE) -c -fpic -o $@ $<
686exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
687 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
688exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
689 $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
690exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
691 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
63402fe4 692
3151305a
ILT
693exception_test_SOURCES = \
694 exception_test_main.cc \
695 exception_test_1.cc \
696 exception_test_2.cc \
697 exception_test.h
698exception_test_DEPENDENCIES = gcctestdir/ld
699exception_test_LDFLAGS = -Bgcctestdir/
1abce4a6 700exception_test_LDADD =
3151305a 701
328c7c2f
ILT
702if HAVE_STATIC
703check_PROGRAMS += exception_static_test
351a8000
ILT
704exception_static_test_SOURCES = $(exception_test_SOURCES)
705exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
706exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
1abce4a6 707exception_static_test_LDADD = $(exception_test_LDADD)
328c7c2f 708endif
3151305a
ILT
709
710exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
711exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
712exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
713exception_shared_1_test_LDADD = exception_shared_1.so
714
715exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
716exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
717exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
718exception_shared_2_test_LDADD = exception_shared_2.so
719
720exception_same_shared_test_SOURCES = exception_test_main.cc
721exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
722exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
723exception_same_shared_test_LDADD = exception_shared.so
724
725exception_separate_shared_12_test_SOURCES = exception_test_main.cc
726exception_separate_shared_12_test_DEPENDENCIES = \
727 gcctestdir/ld exception_shared_1.so exception_shared_2.so
59965708
CC
728exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \
729 -Wl,--no-as-needed
3151305a
ILT
730exception_separate_shared_12_test_LDADD = \
731 exception_shared_1.so exception_shared_2.so
732
733exception_separate_shared_21_test_SOURCES = exception_test_main.cc
734exception_separate_shared_21_test_DEPENDENCIES = \
735 gcctestdir/ld exception_shared_1.so exception_shared_2.so
59965708
CC
736exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \
737 -Wl,--no-as-needed
3151305a
ILT
738exception_separate_shared_21_test_LDADD = \
739 exception_shared_2.so exception_shared_1.so
740
3151305a 741
351a8000 742check_PROGRAMS += weak_test
a360aedd 743weak_test_SOURCES = weak_test.cc
0e470e5c 744weak_test_DEPENDENCIES = gcctestdir/ld
a360aedd 745weak_test_LDFLAGS = -Bgcctestdir/
1abce4a6 746weak_test_LDADD =
a360aedd 747
86925eef 748check_PROGRAMS += weak_undef_test
72fef11a 749MOSTLYCLEANFILES += alt/weak_undef_lib.so
86925eef
CC
750weak_undef_test_SOURCES = weak_undef_test.cc
751weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
752weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
753weak_undef_test_LDADD = -L . weak_undef_lib.so
754weak_undef_file1.o: weak_undef_file1.cc
755 $(CXXCOMPILE) -c -fpic -o $@ $<
756weak_undef_file2.o: weak_undef_file2.cc
757 $(CXXCOMPILE) -c -fpic -o $@ $<
758weak_undef_lib.so: weak_undef_file1.o
759 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
760alt/weak_undef_lib.so: weak_undef_file2.o
761 test -d alt || mkdir -p alt
762 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
351a8000 763
1f25b93b
CC
764check_PROGRAMS += weak_undef_test_2
765weak_undef_test_2_SOURCES = weak_undef_test_2.cc
766weak_undef_test_2_DEPENDENCIES = gcctestdir/ld libweak_undef_2.a
767weak_undef_test_2_LDFLAGS = -Bgcctestdir/ -u weak_undef_2
768weak_undef_test_2_LDADD = -L . -lweak_undef_2
dddcc5b9 769MOSTLYCLEANFILES += libweak_undef_2.a
1f25b93b
CC
770libweak_undef_2.a: weak_undef_file3.o weak_undef_file4.o
771 $(TEST_AR) rc $@ $^
772weak_undef_file3.o: weak_undef_file3.cc
773 $(CXXCOMPILE) -c -o $@ $<
774weak_undef_file4.o: weak_undef_file4.cc
775 $(CXXCOMPILE) -c -o $@ $<
776
f3c69fca
CC
777if FN_PTRS_IN_SO_WITHOUT_PIC
778check_PROGRAMS += weak_undef_nonpic_test
72fef11a 779MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so
f3c69fca
CC
780weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
781weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
782weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
783weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
784weak_undef_file1_nonpic.o: weak_undef_file1.cc
785 $(CXXCOMPILE) -c -o $@ $<
786weak_undef_file2_nonpic.o: weak_undef_file2.cc
787 $(CXXCOMPILE) -c -o $@ $<
788weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
611062c0 789 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext
f3c69fca
CC
790alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
791 test -d alt || mkdir -p alt
611062c0 792 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext
f3c69fca
CC
793endif FN_PTRS_IN_SO_WITHOUT_PIC
794
795
99a37bfd
ILT
796check_PROGRAMS += weak_alias_test
797weak_alias_test_SOURCES = weak_alias_test_main.cc
798weak_alias_test_DEPENDENCIES = \
799 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
21131061 800 weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so
99a37bfd
ILT
801weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
802weak_alias_test_LDADD = \
803 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
21131061 804 weak_alias_test_4.so weak_alias_test_5.so
99a37bfd
ILT
805weak_alias_test_1_pic.o: weak_alias_test_1.cc
806 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 807weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
99a37bfd
ILT
808 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
809weak_alias_test_2_pic.o: weak_alias_test_2.cc
810 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 811weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
99a37bfd
ILT
812 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
813weak_alias_test_3.o: weak_alias_test_3.cc
814 $(CXXCOMPILE) -c -o $@ $<
815weak_alias_test_4_pic.o: weak_alias_test_4.cc
816 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 817weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
99a37bfd 818 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
21131061
ILT
819weak_alias_test_5_pic.o: weak_alias_test_5.cc
820 $(CXXCOMPILE) -c -fpic -o $@ $<
821weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld
822 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \
823 -Wl,--version-script,$(srcdir)/weak_alias_test.script
99a37bfd 824
de4c45bd
ILT
825check_SCRIPTS += weak_plt.sh
826check_PROGRAMS += weak_plt
827check_DATA += weak_plt_shared.so
828weak_plt_main_pic.o: weak_plt_main.cc
829 $(CXXCOMPILE) -c -fpic -o $@ $<
830weak_plt: weak_plt_main_pic.o gcctestdir/ld
831 $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
832weak_plt_shared_pic.o: weak_plt_shared.cc
833 $(CXXCOMPILE) -c -fpic -o $@ $<
834weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
835 $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
836
f34787f8
ILT
837check_PROGRAMS += copy_test
838copy_test_SOURCES = copy_test.cc
839copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
840copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
841copy_test_LDADD = copy_test_1.so copy_test_2.so
842copy_test_1_pic.o: copy_test_1.cc
843 $(CXXCOMPILE) -c -fpic -o $@ $<
844copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
845 $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
846copy_test_2_pic.o: copy_test_2.cc
847 $(CXXCOMPILE) -c -fpic -o $@ $<
848copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
849 $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
850
38ac44ac 851if !DEFAULT_TARGET_POWERPC
6eeb0170
CC
852check_SCRIPTS += copy_test_protected.sh
853check_DATA += copy_test_protected.err
854MOSTLYCLEANFILES += copy_test_protected.err
855copy_test_protected.err: copy_test_protected.o copy_test_2.so gcctestdir/ld
856 @echo $(CXXLINK) -Bgcctestdir/ -o copy_test_protected copy_test_protected.o copy_test_2.so -Wl,-R,. "2>$@"
857 @if $(CXXLINK) -Bgcctestdir/ -o copy_test_protected copy_test_protected.o copy_test_2.so -Wl,-R,. 2>$@; \
858 then \
859 echo 1>&2 "Link of copy_test_protected should have failed"; \
860 rm -f $@; \
861 exit 1; \
862 fi
38ac44ac 863endif
6eeb0170 864
6eee141f
ILT
865if TLS
866
351a8000
ILT
867check_PROGRAMS += tls_test
868check_PROGRAMS += tls_pic_test
c7177d31 869check_PROGRAMS += tls_pie_test
b3705d2a 870check_PROGRAMS += tls_pie_pic_test
351a8000 871check_PROGRAMS += tls_shared_test
c03c7692 872check_PROGRAMS += tls_shared_ie_test
c2b45e22 873check_PROGRAMS += tls_shared_gd_to_ie_test
351a8000
ILT
874tls_test_pic.o: tls_test.cc
875 $(CXXCOMPILE) -c -fpic -o $@ $<
876tls_test_file2_pic.o: tls_test_file2.cc
877 $(CXXCOMPILE) -c -fpic -o $@ $<
155a0dd7
ILT
878tls_test_c_pic.o: tls_test_c.c
879 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
880tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
9c2d0ef9 881 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
c2b45e22
CC
882tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
883 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
351a8000 884
c03c7692
ILT
885tls_test_pic_ie.o: tls_test.cc
886 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
887tls_test_file2_pic_ie.o: tls_test_file2.cc
888 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
155a0dd7
ILT
889tls_test_c_pic_ie.o: tls_test_c.c
890 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
891tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
892 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
c03c7692 893
e0374858 894tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
155a0dd7 895tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
6eee141f 896tls_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
897tls_test_LDADD = tls_test_c.o -lpthread
898tls_test_c.o: tls_test_c.c
899 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
6eee141f
ILT
900
901tls_pic_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
902tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
903 tls_test_c_pic.o
6eee141f 904tls_pic_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
905tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
906 -lpthread
6eee141f 907
c7177d31
ILT
908tls_test_main_pie.o: tls_test_main.cc tls_test.h
909 $(CXXCOMPILE) -c -fpie -o $@ $<
910tls_test_pie.o: tls_test.cc tls_test.h
911 $(CXXCOMPILE) -c -fpie -o $@ $<
912tls_test_file2_pie.o: tls_test_file2.cc tls_test.h
913 $(CXXCOMPILE) -c -fpie -o $@ $<
914tls_test_c_pie.o: tls_test_c.c
915 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
916tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \
917 tls_test_c_pie.o gcctestdir/ld
918 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread
919
a6a17750
CC
920check_SCRIPTS += tls_pie_test.sh
921check_DATA += tls_pie_test.stdout
922tls_pie_test.stdout: tls_pie_test
923 $(TEST_READELF) -rW $< > $@ 2>/dev/null
924
b3705d2a
ILT
925tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \
926 tls_test_c_pic.o gcctestdir/ld
927 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread
928
6eee141f
ILT
929tls_shared_test_SOURCES = tls_test_main.cc
930tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
931tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
932tls_shared_test_LDADD = tls_test_shared.so -lpthread
933
c03c7692
ILT
934tls_shared_ie_test_SOURCES = tls_test_main.cc
935tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
936tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
937tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
938
c2b45e22 939tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
940tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
941 tls_test_c_pic.o tls_test_shared2.so
c2b45e22 942tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
943tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
944 tls_test_shared2.so -lpthread
c2b45e22
CC
945
946if TLS_GNU2_DIALECT
947
948check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
949
950tls_test_gnu2.o: tls_test.cc
951 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
952tls_test_file2_gnu2.o: tls_test_file2.cc
953 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
155a0dd7
ILT
954tls_test_c_gnu2.o: tls_test_c.c
955 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
c2b45e22
CC
956tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
957 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
958
959tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
960tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
961 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
c2b45e22 962tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
963tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
964 tls_test_gnu2_shared2.so -lpthread
c2b45e22
CC
965
966if TLS_DESCRIPTORS
967
968check_PROGRAMS += tls_shared_gnu2_test
969
155a0dd7
ILT
970tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
971 $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
c2b45e22
CC
972
973tls_shared_gnu2_test_SOURCES = tls_test_main.cc
974tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
975tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
976tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
977
978endif TLS_DESCRIPTORS
979
980endif TLS_GNU2_DIALECT
981
328c7c2f 982if HAVE_STATIC
351a8000
ILT
983if STATIC_TLS
984check_PROGRAMS += tls_static_test
985check_PROGRAMS += tls_static_pic_test
986
987tls_static_test_SOURCES = $(tls_test_SOURCES)
988tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
989tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
990tls_static_test_LDADD = $(tls_test_LDADD)
991
992tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
993tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
994tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
995tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
996endif
328c7c2f 997endif
6eee141f
ILT
998
999if FN_PTRS_IN_SO_WITHOUT_PIC
351a8000 1000check_PROGRAMS += tls_shared_nonpic_test
155a0dd7 1001tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
611062c0 1002 $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext
6eee141f
ILT
1003
1004tls_shared_nonpic_test_SOURCES = tls_test_main.cc
1005tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
1006tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1007tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
351a8000 1008endif FN_PTRS_IN_SO_WITHOUT_PIC
6eee141f 1009
351a8000 1010endif TLS
6eee141f 1011
1fa29f10
IT
1012if DEFAULT_TARGET_X86_64
1013
1014check_SCRIPTS += x86_64_mov_to_lea.sh
1015check_DATA += x86_64_mov_to_lea1.stdout x86_64_mov_to_lea2.stdout \
1016 x86_64_mov_to_lea3.stdout x86_64_mov_to_lea4.stdout \
1017 x86_64_mov_to_lea5.stdout x86_64_mov_to_lea6.stdout \
1018 x86_64_mov_to_lea7.stdout x86_64_mov_to_lea8.stdout \
1019 x86_64_mov_to_lea9.stdout x86_64_mov_to_lea10.stdout \
1020 x86_64_mov_to_lea11.stdout x86_64_mov_to_lea12.stdout \
1021 x86_64_mov_to_lea13.stdout x86_64_mov_to_lea14.stdout
1022MOSTLYCLEANFILES += x86_64_mov_to_lea1 x86_64_mov_to_lea2 \
1023 x86_64_mov_to_lea3 x86_64_mov_to_lea4 x86_64_mov_to_lea5 \
1024 x86_64_mov_to_lea6 x86_64_mov_to_lea7 x86_64_mov_to_lea8 \
1025 x86_64_mov_to_lea9 x86_64_mov_to_lea10 x86_64_mov_to_lea11 \
1026 x86_64_mov_to_lea12 x86_64_mov_to_lea13 x86_64_mov_to_lea14
1027
1028x86_64_mov_to_lea1.o: x86_64_mov_to_lea1.s
1029 $(TEST_AS) --64 -o $@ $<
1030x86_64_mov_to_lea2.o: x86_64_mov_to_lea1.s
1031 $(TEST_AS) --x32 -o $@ $<
1032x86_64_mov_to_lea3.o: x86_64_mov_to_lea2.s
1033 $(TEST_AS) --x32 -o $@ $<
1034x86_64_mov_to_lea4.o: x86_64_mov_to_lea2.s
1035 $(TEST_AS) --64 -o $@ $<
1036x86_64_mov_to_lea5.o: x86_64_mov_to_lea3.s
1cd17042 1037 $(TEST_AS) --x32 -mrelax-relocations=yes -o $@ $<
1fa29f10 1038x86_64_mov_to_lea6.o: x86_64_mov_to_lea3.s
1cd17042 1039 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1fa29f10
IT
1040x86_64_mov_to_lea7.o: x86_64_mov_to_lea4.s
1041 $(TEST_AS) --x32 -o $@ $<
1042x86_64_mov_to_lea8.o: x86_64_mov_to_lea4.s
1043 $(TEST_AS) --64 -o $@ $<
1044x86_64_mov_to_lea1: x86_64_mov_to_lea1.o
1045 ../ld-new -Bsymbolic -shared -melf_x86_64 -o $@ $<
1046x86_64_mov_to_lea2: x86_64_mov_to_lea1.o
1047 ../ld-new -pie -melf_x86_64 -o $@ $<
1048x86_64_mov_to_lea3: x86_64_mov_to_lea1.o
1049 ../ld-new -melf_x86_64 -o $@ $<
1050x86_64_mov_to_lea4: x86_64_mov_to_lea2.o
1051 ../ld-new -Bsymbolic -shared -melf32_x86_64 -o $@ $<
1052x86_64_mov_to_lea5: x86_64_mov_to_lea2.o
1053 ../ld-new -pie -melf32_x86_64 -o $@ $<
1054x86_64_mov_to_lea6: x86_64_mov_to_lea2.o
1055 ../ld-new -melf32_x86_64 -o $@ $<
1056x86_64_mov_to_lea7: x86_64_mov_to_lea3.o
1057 ../ld-new -melf32_x86_64 -pie -o $@ $<
1058x86_64_mov_to_lea8: x86_64_mov_to_lea4.o
1059 ../ld-new -melf_x86_64 -pie -o $@ $<
1060x86_64_mov_to_lea9: x86_64_mov_to_lea5.o
1061 ../ld-new -melf32_x86_64 -o $@ $<
1062x86_64_mov_to_lea10: x86_64_mov_to_lea6.o
1063 ../ld-new -melf_x86_64 -o $@ $<
0fd15345 1064x86_64_mov_to_lea11: x86_64_mov_to_lea2.o
1fa29f10 1065 ../ld-new -melf32_x86_64 -shared -o $@ $<
0fd15345 1066x86_64_mov_to_lea12: x86_64_mov_to_lea1.o
1fa29f10
IT
1067 ../ld-new -melf_x86_64 -shared -o $@ $<
1068x86_64_mov_to_lea13: x86_64_mov_to_lea7.o
1069 ../ld-new -melf32_x86_64 -shared -o $@ $<
1070x86_64_mov_to_lea14: x86_64_mov_to_lea8.o
1071 ../ld-new -melf_x86_64 -shared -o $@ $<
1072x86_64_mov_to_lea1.stdout: x86_64_mov_to_lea1
1073 $(TEST_OBJDUMP) -dw $< > $@
1074x86_64_mov_to_lea2.stdout: x86_64_mov_to_lea2
1075 $(TEST_OBJDUMP) -dw $< > $@
1076x86_64_mov_to_lea3.stdout: x86_64_mov_to_lea3
1077 $(TEST_OBJDUMP) -dw $< > $@
1078x86_64_mov_to_lea4.stdout: x86_64_mov_to_lea4
1079 $(TEST_OBJDUMP) -dw $< > $@
1080x86_64_mov_to_lea5.stdout: x86_64_mov_to_lea5
1081 $(TEST_OBJDUMP) -dw $< > $@
1082x86_64_mov_to_lea6.stdout: x86_64_mov_to_lea6
1083 $(TEST_OBJDUMP) -dw $< > $@
1084x86_64_mov_to_lea7.stdout: x86_64_mov_to_lea7
1085 $(TEST_OBJDUMP) -dw $< > $@
1086x86_64_mov_to_lea8.stdout: x86_64_mov_to_lea8
1087 $(TEST_OBJDUMP) -dw $< > $@
1088x86_64_mov_to_lea9.stdout: x86_64_mov_to_lea9
1089 $(TEST_OBJDUMP) -dw $< > $@
1090x86_64_mov_to_lea10.stdout: x86_64_mov_to_lea10
1091 $(TEST_OBJDUMP) -dw $< > $@
1092x86_64_mov_to_lea11.stdout: x86_64_mov_to_lea11
1093 $(TEST_OBJDUMP) -dw $< > $@
1094x86_64_mov_to_lea12.stdout: x86_64_mov_to_lea12
1095 $(TEST_OBJDUMP) -dw $< > $@
1096x86_64_mov_to_lea13.stdout: x86_64_mov_to_lea13
1097 $(TEST_OBJDUMP) -dw $< > $@
1098x86_64_mov_to_lea14.stdout: x86_64_mov_to_lea14
1099 $(TEST_OBJDUMP) -dw $< > $@
1100
3a4f096e
ST
1101check_SCRIPTS += x86_64_indirect_call_to_direct.sh
1102check_DATA += x86_64_indirect_call_to_direct1.stdout \
1103 x86_64_indirect_jump_to_direct1.stdout
1104MOSTLYCLEANFILES += x86_64_indirect_call_to_direct1 \
1105 x86_64_indirect_jump_to_direct1
1106
1107x86_64_indirect_call_to_direct1.o: x86_64_indirect_call_to_direct1.s
1108 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1109x86_64_indirect_call_to_direct1: x86_64_indirect_call_to_direct1.o gcctestdir/ld
1110 gcctestdir/ld -o $@ $<
1111x86_64_indirect_call_to_direct1.stdout: x86_64_indirect_call_to_direct1
1112 $(TEST_OBJDUMP) -dw $< > $@
1113x86_64_indirect_jump_to_direct1.o: x86_64_indirect_jump_to_direct1.s
1114 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1115x86_64_indirect_jump_to_direct1: x86_64_indirect_jump_to_direct1.o gcctestdir/ld
1116 gcctestdir/ld -o $@ $<
1117x86_64_indirect_jump_to_direct1.stdout: x86_64_indirect_jump_to_direct1
1118 $(TEST_OBJDUMP) -dw $< > $@
1119
c34c98ed
CC
1120check_SCRIPTS += x86_64_overflow_pc32.sh
1121check_DATA += x86_64_overflow_pc32.err
1122MOSTLYCLEANFILES += x86_64_overflow_pc32.err
1123x86_64_overflow_pc32.o: x86_64_overflow_pc32.s
1124 $(TEST_AS) -o $@ $<
1125x86_64_overflow_pc32.err: x86_64_overflow_pc32.o gcctestdir/ld
19ef3f4d
CC
1126 @echo gcctestdir/ld -e bar -Tdata=0x81000000 -o x86_64_overflow_pc32 x86_64_overflow_pc32.o "2>$@"
1127 @if gcctestdir/ld -e bar -Tdata=0x81000000 -o x86_64_overflow_pc32 x86_64_overflow_pc32.o 2>$@; \
c34c98ed
CC
1128 then \
1129 echo 1>&2 "Link of x86_64_overflow_pc32 should have failed"; \
1130 rm -f $@; \
1131 exit 1; \
1132 fi
1133
ac423761
GN
1134check_PROGRAMS += pr17704a_test
1135pr17704a_test.o: pr17704a_test.s
1136 $(TEST_AS) --64 -o $@ $<
1137pr17704a_test: pr17704a_test.o gcctestdir/ld
1138 gcctestdir/ld --icf=all -o $@ $<
1139
19ef3f4d
CC
1140check_SCRIPTS += x32_overflow_pc32.sh
1141check_DATA += x32_overflow_pc32.err
1142MOSTLYCLEANFILES += x32_overflow_pc32.err
19ef3f4d
CC
1143x32_overflow_pc32.o: x86_64_overflow_pc32.s
1144 $(TEST_AS) --x32 -o $@ $<
1145x32_overflow_pc32.err: x32_overflow_pc32.o gcctestdir/ld
1146 @echo gcctestdir/ld -e bar -Tdata=0x81000000 -o x32_overflow_pc32 x32_overflow_pc32.o "2>$@"
1147 @if gcctestdir/ld -e bar -Tdata=0x81000000 -o x32_overflow_pc32 x32_overflow_pc32.o 2>$@; \
1148 then \
1149 echo 1>&2 "Link of x32_overflow_pc32 should have failed"; \
1150 rm -f $@; \
1151 exit 1; \
1152 fi
1153
1fa29f10
IT
1154endif DEFAULT_TARGET_X86_64
1155
ad961eab
L
1156if DEFAULT_TARGET_X86_64_OR_X32
1157
1158check_PROGRAMS += pr20216a_test
1159pr20216a_test_SOURCES = pr20216_main.c pr20216_def.c
1160pr20216a_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as
1161pr20216a_test_CFLAGS = -Bgcctestdir/ -fPIE
1162pr20216a_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1163pr20216a_test_LDADD = pr20216_gd.o pr20216_ld.o
1164
1165check_PROGRAMS += pr20216b_test
1166pr20216b_test_SOURCES = pr20216_main.c pr20216_def.c
1167pr20216b_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as
1168pr20216b_test_CFLAGS = -Bgcctestdir/ -fPIE
1169pr20216b_test_LDFLAGS = -pie -Bgcctestdir/ -Wl,-R,.
1170pr20216b_test_LDADD = pr20216_gd.o pr20216_ld.o
1171
1172check_PROGRAMS += pr20216c_test
1173pr20216c_test_SOURCES = pr20216_main.c pr20216_def.c
1174pr20216c_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as
1175pr20216c_test_CFLAGS = -Bgcctestdir/ -fPIE
1176pr20216c_test_LDFLAGS = -static -Bgcctestdir/ -Wl,-R,.
1177pr20216c_test_LDADD = pr20216_gd.o pr20216_ld.o
1178
1179check_PROGRAMS += pr20216d_test
1180pr20216d_test_SOURCES = pr20216_main.c pr20216_def.c
1181pr20216d_test_DEPENDENCIES = pr20216a.so gcctestdir/ld gcctestdir/as
1182pr20216d_test_CFLAGS = -Bgcctestdir/ -fPIE
1183pr20216d_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1184pr20216d_test_LDADD = pr20216a.so
1185
1186check_PROGRAMS += pr20216e_test
1187pr20216e_test_SOURCES = pr20216_main.c
1188pr20216e_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o pr20216b.so gcctestdir/ld gcctestdir/as
1189pr20216e_test_CFLAGS = -Bgcctestdir/ -fPIE
1190pr20216e_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1191pr20216e_test_LDADD = pr20216_gd.o pr20216_ld.o pr20216b.so
1192
1193MOSTLYCLEANFILES += pr20216a.so pr20216b.so
1194
1195pr20216a.so: pr20216_gd.o pr20216_ld.o gcctestdir/ld
1196 $(LINK) -Bgcctestdir/ -shared pr20216_gd.o pr20216_ld.o
1197
1198pr20216b.so: pr20216_def.o gcctestdir/ld
1199 $(LINK) -Bgcctestdir/ -shared pr20216_def.o
1200
a4aa1f5f 1201pr20216_gd.o: pr20216_gd.S gcctestdir/as
f5713901 1202 $(COMPILE) -Bgcctestdir/ -c -o $@ $<
ad961eab 1203
a4aa1f5f 1204pr20216_ld.o: pr20216_ld.S gcctestdir/as
f5713901 1205 $(COMPILE) -Bgcctestdir/ -c -o $@ $<
ad961eab
L
1206
1207endif DEFAULT_TARGET_X86_64_OR_X32
1208
c4fc4724
IT
1209if DEFAULT_TARGET_I386
1210
1211check_SCRIPTS += i386_mov_to_lea.sh
1212check_DATA += i386_mov_to_lea1.stdout i386_mov_to_lea2.stdout \
1213 i386_mov_to_lea3.stdout i386_mov_to_lea4.stdout \
1214 i386_mov_to_lea5.stdout i386_mov_to_lea6.stdout \
1215 i386_mov_to_lea7.stdout i386_mov_to_lea8.stdout
1216MOSTLYCLEANFILES += i386_mov_to_lea1 i386_mov_to_lea2 i386_mov_to_lea3 \
1217 i386_mov_to_lea4 i386_mov_to_lea5 i386_mov_to_lea6 \
1218 i386_mov_to_lea7 i386_mov_to_lea8
1219
1220i386_mov_to_lea1.o: i386_mov_to_lea1.s
1221 $(TEST_AS) --32 -o $@ $<
1222i386_mov_to_lea2.o: i386_mov_to_lea2.s
1223 $(TEST_AS) --32 -o $@ $<
1224i386_mov_to_lea3.o: i386_mov_to_lea3.s
1225 $(TEST_AS) --32 -o $@ $<
1226i386_mov_to_lea4.o: i386_mov_to_lea4.s
1227 $(TEST_AS) --32 -o $@ $<
1228i386_mov_to_lea5.o: i386_mov_to_lea5.s
1229 $(TEST_AS) --32 -o $@ $<
1230i386_mov_to_lea1: i386_mov_to_lea1.o
1231 ../ld-new -Bsymbolic -shared -melf_i386 -o $@ $<
1232i386_mov_to_lea2: i386_mov_to_lea1.o
1233 ../ld-new -pie -melf_i386 -o $@ $<
1234i386_mov_to_lea3: i386_mov_to_lea1.o
1235 ../ld-new -melf_i386 -o $@ $<
1236i386_mov_to_lea4: i386_mov_to_lea1.o
1237 ../ld-new -melf_i386 -shared -o $@ $<
1238i386_mov_to_lea5: i386_mov_to_lea2.o
1239 ../ld-new -melf_i386 -shared -o $@ $<
1240i386_mov_to_lea6: i386_mov_to_lea3.o
1241 ../ld-new -melf_i386 -shared -o $@ $<
1242i386_mov_to_lea7: i386_mov_to_lea4.o
1243 ../ld-new -melf_i386 -shared -o $@ $<
1244i386_mov_to_lea8: i386_mov_to_lea5.o
1245 ../ld-new -melf_i386 -shared -o $@ $<
1246i386_mov_to_lea1.stdout: i386_mov_to_lea1
1247 $(TEST_OBJDUMP) -dw $< > $@
1248i386_mov_to_lea2.stdout: i386_mov_to_lea2
1249 $(TEST_OBJDUMP) -dw $< > $@
1250i386_mov_to_lea3.stdout: i386_mov_to_lea3
1251 $(TEST_OBJDUMP) -dw $< > $@
1252i386_mov_to_lea4.stdout: i386_mov_to_lea4
1253 $(TEST_OBJDUMP) -dw $< > $@
1254i386_mov_to_lea5.stdout: i386_mov_to_lea5
1255 $(TEST_OBJDUMP) -dw $< > $@
1256i386_mov_to_lea6.stdout: i386_mov_to_lea6
1257 $(TEST_OBJDUMP) -dw $< > $@
1258i386_mov_to_lea7.stdout: i386_mov_to_lea7
1259 $(TEST_OBJDUMP) -dw $< > $@
1260i386_mov_to_lea8.stdout: i386_mov_to_lea8
1261 $(TEST_OBJDUMP) -dw $< > $@
1262
b287eca3
L
1263check_PROGRAMS += pr20308a_test
1264pr20308a_test_SOURCES = pr20308_main.c pr20308_def.c
1265pr20308a_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as
1266pr20308a_test_CFLAGS = -Bgcctestdir/ -fPIE
1267pr20308a_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1268pr20308a_test_LDADD = pr20308_gd.o pr20308_ld.o
1269
1270check_PROGRAMS += pr20308b_test
1271pr20308b_test_SOURCES = pr20308_main.c pr20308_def.c
1272pr20308b_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as
1273pr20308b_test_CFLAGS = -Bgcctestdir/ -fPIE
1274pr20308b_test_LDFLAGS = -pie -Bgcctestdir/ -Wl,-R,.
1275pr20308b_test_LDADD = pr20308_gd.o pr20308_ld.o
1276
1277check_PROGRAMS += pr20308c_test
1278pr20308c_test_SOURCES = pr20308_main.c pr20308_def.c
1279pr20308c_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as
1280pr20308c_test_CFLAGS = -Bgcctestdir/ -fPIE
1281pr20308c_test_LDFLAGS = -static -Bgcctestdir/ -Wl,-R,.
1282pr20308c_test_LDADD = pr20308_gd.o pr20308_ld.o
1283
1284check_PROGRAMS += pr20308d_test
1285pr20308d_test_SOURCES = pr20308_main.c pr20308_def.c
1286pr20308d_test_DEPENDENCIES = pr20308a.so gcctestdir/ld gcctestdir/as
1287pr20308d_test_CFLAGS = -Bgcctestdir/ -fPIE
1288pr20308d_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1289pr20308d_test_LDADD = pr20308a.so
1290
1291check_PROGRAMS += pr20308e_test
1292pr20308e_test_SOURCES = pr20308_main.c
1293pr20308e_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o pr20308b.so gcctestdir/ld gcctestdir/as
1294pr20308e_test_CFLAGS = -Bgcctestdir/ -fPIE
1295pr20308e_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1296pr20308e_test_LDADD = pr20308_gd.o pr20308_ld.o pr20308b.so
1297
1298MOSTLYCLEANFILES += pr20308a.so pr20308b.so
1299
1300pr20308a.so: pr20308_gd.o pr20308_ld.o gcctestdir/ld
1301 $(LINK) -Bgcctestdir/ -shared pr20308_gd.o pr20308_ld.o
1302
1303pr20308b.so: pr20308_def.o gcctestdir/ld
1304 $(LINK) -Bgcctestdir/ -shared pr20308_def.o
1305
a4aa1f5f
CC
1306pr20308_gd.o: pr20308_gd.S gcctestdir/as
1307 $(COMPILE) -Bgcctestdir/ -c -o $@ $<
b287eca3 1308
a4aa1f5f
CC
1309pr20308_ld.o: pr20308_ld.S gcctestdir/as
1310 $(COMPILE) -Bgcctestdir/ -c -o $@ $<
b287eca3 1311
c4fc4724
IT
1312endif DEFAULT_TARGET_I386
1313
d491d34e
ILT
1314check_PROGRAMS += many_sections_test
1315many_sections_test_SOURCES = many_sections_test.cc
1316many_sections_test_DEPENDENCIES = gcctestdir/ld
1317many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
1abce4a6 1318many_sections_test_LDADD =
d491d34e
ILT
1319
1320BUILT_SOURCES += many_sections_define.h
72fef11a 1321MOSTLYCLEANFILES += many_sections_define.h
d491d34e
ILT
1322many_sections_define.h:
1323 (for i in `seq 1 70000`; do \
1324 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
1325 done) > $@.tmp
1326 mv -f $@.tmp $@
1327
1328BUILT_SOURCES += many_sections_check.h
72fef11a 1329MOSTLYCLEANFILES += many_sections_check.h
d491d34e 1330many_sections_check.h:
4c94d6ae 1331 (for i in `seq 1 1000 70000`; do \
d491d34e
ILT
1332 echo "assert(var_$$i == $$i);"; \
1333 done) > $@.tmp
1334 mv -f $@.tmp $@
1335
1336check_PROGRAMS += many_sections_r_test
d491d34e
ILT
1337many_sections_r_test.o: many_sections_test.o gcctestdir/ld
1338 gcctestdir/ld -r -o $@ many_sections_test.o
7bc3e21a
ILT
1339many_sections_r_test: many_sections_r_test.o gcctestdir/ld
1340 $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
6eee141f 1341
82d93790
CC
1342check_SCRIPTS += file_in_many_sections_test.sh
1343check_DATA += file_in_many_sections.stdout
1344MOSTLYCLEANFILES += file_in_many_sections
1345file_in_many_sections.o: file_in_many_sections.c many_sections_define.h
1346 $(COMPILE) -c -fdata-sections -o $@ $(srcdir)/file_in_many_sections.c
1347file_in_many_sections: file_in_many_sections.o gcctestdir/ld
1348 $(LINK) -Bgcctestdir/ file_in_many_sections.o -Wl,--gc-sections
1349file_in_many_sections.stdout: file_in_many_sections
1350 $(TEST_READELF) -s $< > $@
1351
2fd32231
ILT
1352check_PROGRAMS += initpri1
1353initpri1_SOURCES = initpri1.c
1354initpri1_DEPENDENCIES = gcctestdir/ld
1355initpri1_LDFLAGS = -Bgcctestdir/
1abce4a6 1356initpri1_LDADD =
2fd32231 1357
5393d741
ILT
1358check_PROGRAMS += initpri2
1359initpri2_SOURCES = initpri2.c
1360initpri2_DEPENDENCIES = gcctestdir/ld
7b5de7ee 1361initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array
5393d741 1362initpri2_LDADD =
2fd32231 1363
487b39df
ILT
1364check_PROGRAMS += initpri3a
1365initpri3a_SOURCES = initpri3.c
1366initpri3a_DEPENDENCIES = gcctestdir/ld
1367initpri3a_LDFLAGS = -Bgcctestdir/
1368initpri3a_LDADD =
1369
7c6109da
DK
1370# This test fails on targets not using .ctors and .dtors sections (e.g. ARM
1371# EABI). Given that gcc is moving towards using .init_array in all cases,
1372# this test is commented out. A better fix would be checking whether gcc
1373# uses .ctors or .init_array sections in configure.
1374
1375# check_PROGRAMS += initpri3b
1376# initpri3b_SOURCES = initpri3.c
1377# initpri3b_DEPENDENCIES = gcctestdir/ld
1378# initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
1379# initpri3b_LDADD =
487b39df 1380
351a8000
ILT
1381# Test --detect-odr-violations
1382check_SCRIPTS += debug_msg.sh
6eee141f 1383
351a8000
ILT
1384# Create the data files that debug_msg.sh analyzes.
1385check_DATA += debug_msg.err
1386MOSTLYCLEANFILES += debug_msg.err
1387debug_msg.o: debug_msg.cc
1388 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
1389odr_violation1.o: odr_violation1.cc
1390 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
71ff8986
ILT
1391# Compile with different optimization flags to check that rearranged
1392# instructions don't cause a false positive.
351a8000 1393odr_violation2.o: odr_violation2.cc
71ff8986 1394 $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
351a8000
ILT
1395debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
1396 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
1397 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
1398 then \
1399 echo 1>&2 "Link of debug_msg should have failed"; \
1400 rm -f $@; \
1401 exit 1; \
1402 fi
1403
93acabad
CC
1404# Test error message when a vtable is undefined.
1405check_SCRIPTS += missing_key_func.sh
1406check_DATA += missing_key_func.err
1407MOSTLYCLEANFILES += missing_key_func.err
1408missing_key_func.o: missing_key_func.cc
1409 $(CXXCOMPILE) -O0 -g -c -o $@ $(srcdir)/missing_key_func.cc
1410missing_key_func.err: missing_key_func.o gcctestdir/ld
1411 @echo $(CXXLINK) -Bgcctestdir/ -o missing_key_func missing_key_func.o "2>$@"
1412 @if $(CXXLINK) -Bgcctestdir/ -o missing_key_func missing_key_func.o 2>$@; \
1413 then \
1414 echo 1>&2 "Link of missing_key_func should have failed"; \
1415 rm -f $@; \
1416 exit 1; \
1417 fi
472076e4 1418
472076e4
CC
1419# Check that --detect-odr-violations works with compressed debug sections.
1420check_DATA += debug_msg_cdebug.err
1421MOSTLYCLEANFILES += debug_msg_cdebug.err
1422debug_msg_cdebug.o: debug_msg.cc gcctestdir/as
1423 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc
1424odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as
1425 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc
1426odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as
1427 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc
1428debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld
1429 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@"
1430 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \
1431 then \
1432 echo 1>&2 "Link of debug_msg_cdebug should have failed"; \
1433 rm -f $@; \
1434 exit 1; \
1435 fi
48058663
L
1436check_DATA += debug_msg_cdebug_gabi.err
1437MOSTLYCLEANFILES += debug_msg_cdebug_gabi.err
1438debug_msg_cdebug_gabi.o: debug_msg.cc gcctestdir/as
1439 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/debug_msg.cc
1440odr_violation1_cdebug_gabi.o: odr_violation1.cc gcctestdir/as
1441 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/odr_violation1.cc
1442odr_violation2_cdebug_gabi.o: odr_violation2.cc gcctestdir/as
1443 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/odr_violation2.cc
1444debug_msg_cdebug_gabi.err: debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o gcctestdir/ld
1445 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o "2>$@"
1446 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug_gabi debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o 2>$@; \
1447 then \
1448 echo 1>&2 "Link of debug_msg_cdebug_gabi should have failed"; \
1449 rm -f $@; \
1450 exit 1; \
1451 fi
472076e4 1452
351a8000
ILT
1453# See if we can also detect problems when we're linking .so's, not .o's.
1454check_DATA += debug_msg_so.err
1455MOSTLYCLEANFILES += debug_msg_so.err
1456debug_msg.so: debug_msg.cc gcctestdir/ld
1457 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
1458odr_violation1.so: odr_violation1.cc gcctestdir/ld
1459 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
1460odr_violation2.so: odr_violation2.cc gcctestdir/ld
71ff8986 1461 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
351a8000 1462debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
3d587466
CC
1463 @echo $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
1464 @if $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
351a8000
ILT
1465 then \
1466 echo 1>&2 "Link of debug_msg_so should have failed"; \
1467 rm -f $@; \
1468 exit 1; \
1469 fi
1470
1471# We also want to make sure we do something reasonable when there's no
1472# debug info available. For the best test, we use .so's.
1473check_DATA += debug_msg_ndebug.err
1474MOSTLYCLEANFILES += debug_msg_ndebug.err
1475debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
1476 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
1477odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
1478 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
1479odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
71ff8986 1480 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
351a8000 1481debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
3d587466
CC
1482 @echo $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ "2>$@"
1483 @if $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ 2>$@; \
351a8000
ILT
1484 then \
1485 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
1486 rm -f $@; \
1487 exit 1; \
1488 fi
1489
1490
1491# Similar to --detect-odr-violations: check for undefined symbols in .so's
1492check_SCRIPTS += undef_symbol.sh
1493check_DATA += undef_symbol.err
1494MOSTLYCLEANFILES += undef_symbol.err
1495undef_symbol.o: undef_symbol.cc
1496 $(CXXCOMPILE) -O0 -g -c -fPIC $<
1497undef_symbol.so: undef_symbol.o gcctestdir/ld
1498 $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
1499undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
1500 @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
1501 @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
1502 then \
1503 echo 1>&2 "Link of undef_symbol_test should have failed"; \
1504 rm -f $@; \
1505 exit 1; \
1506 fi
1507
1508
351a8000
ILT
1509# Test -o when emitting to a special file (such as something in /dev).
1510check_PROGRAMS += flagstest_o_specialfile
0e470e5c 1511flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
351a8000
ILT
1512 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
1513 chmod a+x $@
1514 test -s $@
1515
fb8b9dbc
L
1516# Test --compress-debug-sections.
1517check_PROGRAMS += flagstest_compress_debug_sections_none
1518check_DATA += flagstest_compress_debug_sections_none.stdout
1519flagstest_compress_debug_sections_none: flagstest_debug.o gcctestdir/ld
1520 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=none
1521 test -s $@
1522
1523# Dump DWARF debug sections.
1524flagstest_compress_debug_sections_none.stdout: flagstest_compress_debug_sections_none
1525 $(TEST_READELF) -w $< > $@.tmp
1526 mv -f $@.tmp $@
1527
7fcd0256 1528check_PROGRAMS += flagstest_compress_debug_sections
fb8b9dbc
L
1529check_DATA += flagstest_compress_debug_sections.stdout \
1530 flagstest_compress_debug_sections.cmp \
1531 flagstest_compress_debug_sections.check
0863441e
CC
1532MOSTLYCLEANFILES += flagstest_compress_debug_sections.check \
1533 flagstest_compress_debug_sections.cmp
7fcd0256
ILT
1534flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
1535 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
1536 test -s $@
1537
9c7fe3c5
CC
1538# Test --compress-debug-sections with --build-id=tree.
1539check_PROGRAMS += flagstest_compress_debug_sections_and_build_id_tree
1540flagstest_compress_debug_sections_and_build_id_tree: flagstest_debug.o gcctestdir/ld
1541 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib \
1542 -Wl,--build-id=tree \
1543 -Wl,--build-id-chunk-size-for-treehash=4096 \
1544 -Wl,--build-id-min-file-size-for-treehash=0
1545 test -s $@
7fcd0256 1546
fb8b9dbc
L
1547# Dump compressed DWARF debug sections.
1548flagstest_compress_debug_sections.stdout: flagstest_compress_debug_sections
1549 $(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
1550 mv -f $@.tmp $@
1551
19a7fe52 1552# Check there are compressed DWARF .debug_* sections.
fb8b9dbc 1553flagstest_compress_debug_sections.check: flagstest_compress_debug_sections
19a7fe52 1554 $(TEST_READELF) -SW $< | egrep ".debug_.* C *" > $@.tmp
fb8b9dbc
L
1555 mv -f $@.tmp $@
1556
1557# Compare DWARF debug info.
1558flagstest_compress_debug_sections.cmp: flagstest_compress_debug_sections.stdout \
1559 flagstest_compress_debug_sections_none.stdout
1560 cmp flagstest_compress_debug_sections.stdout \
1561 flagstest_compress_debug_sections_none.stdout > $@.tmp
1562 mv -f $@.tmp $@
1563
1564check_PROGRAMS += flagstest_compress_debug_sections_gnu
1565check_DATA += flagstest_compress_debug_sections_gnu.stdout \
1566 flagstest_compress_debug_sections_gnu.cmp \
1567 flagstest_compress_debug_sections_gnu.check
0863441e
CC
1568MOSTLYCLEANFILES += flagstest_compress_debug_sections_gnu.check \
1569 flagstest_compress_debug_sections_gnu.cmp
fb8b9dbc
L
1570flagstest_compress_debug_sections_gnu: flagstest_debug.o gcctestdir/ld
1571 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gnu
1572 test -s $@
1573
1574# Dump compressed DWARF debug sections.
1575flagstest_compress_debug_sections_gnu.stdout: flagstest_compress_debug_sections_gnu
1576 $(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
1577 mv -f $@.tmp $@
1578
1579# Check there are compressed DWARF .zdebug_* sections.
1580flagstest_compress_debug_sections_gnu.check: flagstest_compress_debug_sections_gnu
1581 $(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp
1582 mv -f $@.tmp $@
1583
1584# Compare DWARF debug info.
1585flagstest_compress_debug_sections_gnu.cmp: flagstest_compress_debug_sections_gnu.stdout \
1586 flagstest_compress_debug_sections_none.stdout
1587 cmp flagstest_compress_debug_sections_gnu.stdout \
1588 flagstest_compress_debug_sections_none.stdout > $@.tmp
1589 mv -f $@.tmp $@
1590
1591check_PROGRAMS += flagstest_compress_debug_sections_gabi
1592check_DATA += flagstest_compress_debug_sections_gabi.stdout \
1593 flagstest_compress_debug_sections_gabi.cmp \
1594 flagstest_compress_debug_sections_gabi.check
0863441e
CC
1595MOSTLYCLEANFILES += flagstest_compress_debug_sections_gabi.cmp \
1596 flagstest_compress_debug_sections_gabi.check
fb8b9dbc
L
1597flagstest_compress_debug_sections_gabi: flagstest_debug.o gcctestdir/ld
1598 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gabi
1599 test -s $@
1600
1601# Dump compressed DWARF debug sections.
1602flagstest_compress_debug_sections_gabi.stdout: flagstest_compress_debug_sections_gabi
1603 $(TEST_READELF) -w $< > $@.tmp
1604 mv -f $@.tmp $@
1605
1606# Check there are compressed DWARF .debug_* sections.
1607flagstest_compress_debug_sections_gabi.check: flagstest_compress_debug_sections_gabi
1608 $(TEST_READELF) -tW $< | grep "COMPRESSED" > $@.tmp
1609 mv -f $@.tmp $@
1610
1611# Compare DWARF debug info.
1612flagstest_compress_debug_sections_gabi.cmp: flagstest_compress_debug_sections_gabi.stdout \
1613 flagstest_compress_debug_sections_none.stdout
1614 cmp flagstest_compress_debug_sections_gabi.stdout \
1615 flagstest_compress_debug_sections_none.stdout > $@.tmp
1616 mv -f $@.tmp $@
1617
351a8000
ILT
1618# The specialfile output has a tricky case when we also compress debug
1619# sections, because it requires output-file resizing.
1620check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
0e470e5c
ILT
1621flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
1622 gcctestdir/ld
126f3ece 1623 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
351a8000
ILT
1624 chmod a+x $@
1625 test -s $@
1626
f54f5e31
L
1627check_SCRIPTS += pr18689.sh
1628check_DATA += pr18689.stdout
1629MOSTLYCLEANFILES += pr18689a.o pr18689b.o
1630
1631pr18689.stdout: pr18689b.o
1632 $(TEST_READELF) -SW $< > $@
1633
1634pr18689a.o: pr18689.o ../ld-new
1635 ../ld-new -r -o $@ $<
1636
1637pr18689b.o: pr18689a.o ../ld-new
1638 ../ld-new -r -o $@ $<
1639
1640pr18689.o: pr18689.c gcctestdir/as
1641 $(COMPILE) -Bgcctestdir/ -ggdb3 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/pr18689.c
1642
d12a5ea8
ILT
1643# Test -TText and -Tdata.
1644check_PROGRAMS += flagstest_o_ttext_1
1645flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld
1646 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000
1647
1648# This version won't be runnable, because there is no way to put the
1649# PT_PHDR segment at file offset 0. We just make sure that we can
1650# build it without error.
1651check_DATA += flagstest_o_ttext_2
0ec6429b 1652MOSTLYCLEANFILES += flagstest_o_ttext_2
d12a5ea8
ILT
1653flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld
1654 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010
1655
99f8faca
ILT
1656# Test symbol versioning.
1657check_PROGRAMS += ver_test
1658ver_test_SOURCES = ver_test_main.cc
1659ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
1660ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1661ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
1662ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
1663 $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
09124467 1664ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
41d0ab5f 1665 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so
09124467
ILT
1666ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
1667 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
99f8faca
ILT
1668ver_test_1.o: ver_test_1.cc
1669 $(CXXCOMPILE) -c -fpic -o $@ $<
1670ver_test_2.o: ver_test_2.cc
1671 $(CXXCOMPILE) -c -fpic -o $@ $<
1672ver_test_3.o: ver_test_3.cc
1673 $(CXXCOMPILE) -c -fpic -o $@ $<
1674ver_test_4.o: ver_test_4.cc
1675 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000 1676
0602e05a
ILT
1677check_SCRIPTS += ver_test_1.sh
1678check_DATA += ver_test_1.syms
1679ver_test_1.syms: ver_test_1.so
1680 $(TEST_READELF) -s $< >$@ 2>/dev/null
1681
be3e6201
ILT
1682check_PROGRAMS += ver_test_2
1683ver_test_2_SOURCES = ver_test_main_2.cc
1684ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
1685ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1686ver_test_2_LDADD = ver_test_4.so ver_test_2.so
1687
be3e6201
ILT
1688check_SCRIPTS += ver_test_2.sh
1689check_DATA += ver_test_2.syms
1690ver_test_2.syms: ver_test_2
6835af53 1691 $(TEST_READELF) -s $< >$@ 2>/dev/null
be3e6201 1692
686c8caf
ILT
1693check_SCRIPTS += ver_test_4.sh
1694check_DATA += ver_test_4.syms
1695ver_test_4.syms: ver_test_4.so
6835af53 1696 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f
ILT
1697
1698ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
1699 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
1700ver_test_5.o: ver_test_5.cc
1701 $(CXXCOMPILE) -c -fpic -o $@ $<
1702check_SCRIPTS += ver_test_5.sh
1703check_DATA += ver_test_5.syms
1704ver_test_5.syms: ver_test_5.so
6835af53 1705 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f 1706
18e6b24e
ILT
1707check_PROGRAMS += ver_test_6
1708ver_test_6_SOURCES = ver_test_6.c
1709ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
1710ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1711ver_test_6_LDADD = ver_test_2.so
1712
479f6503
ILT
1713ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
1714 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
1715ver_test_7.o: ver_test_7.cc
1716 $(CXXCOMPILE) -c -fpic -o $@ $<
1717check_SCRIPTS += ver_test_7.sh
1718check_DATA += ver_test_7.syms
1719ver_test_7.syms: ver_test_7.so
6835af53 1720 $(TEST_READELF) -s $< >$@ 2>/dev/null
479f6503 1721
75517b77
ILT
1722check_PROGRAMS += ver_test_8
1723ver_test_8_SOURCES = two_file_test_main.cc
1724ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
1725ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1726ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
1727ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
1728 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
1729ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
1730 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
1731
95d14cd3
ILT
1732check_PROGRAMS += ver_test_9
1733ver_test_9_SOURCES = ver_test_main.cc
1734ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
1735ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1736ver_test_9_LDADD = ver_test_9.so
1737ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
41d0ab5f 1738 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so
95d14cd3
ILT
1739ver_test_9.o: ver_test_9.cc
1740 $(CXXCOMPILE) -c -fpic -o $@ $<
1741
057ead22
ILT
1742check_SCRIPTS += ver_test_10.sh
1743check_DATA += ver_test_10.syms
1744ver_test_10.syms: ver_test_10.so
1745 $(TEST_READELF) -s $< >$@ 2>/dev/null
1746ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
1747 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
1748
9c5b8369 1749check_PROGRAMS += ver_test_11
72fef11a 1750MOSTLYCLEANFILES += ver_test_11.a
9c5b8369
ILT
1751ver_test_11_SOURCES = ver_test_main_2.cc
1752ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
1753ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1754ver_test_11_LDADD = ver_test_11.a
1755ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
1756 $(TEST_AR) rc $@ $^
1757
6d1c4efb
ILT
1758check_PROGRAMS += ver_test_12
1759ver_test_12_SOURCES = ver_test_main_2.cc
1760ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o
1761ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1762ver_test_12_LDADD = ver_test_12.o
1763ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o
1764 gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o
1765
b45e00b3
CC
1766check_SCRIPTS += ver_test_13.sh
1767check_DATA += ver_test_13.syms
1768ver_test_13.syms: ver_test_13.so
1769 $(TEST_READELF) -s $< >$@ 2>/dev/null
1770ver_test_13.so: gcctestdir/ld ver_test_13.o ver_test_13.script
1771 $(LINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_13.script ver_test_13.o
1772ver_test_13.o: ver_test_13.c
1773 $(COMPILE) -c -fpic -o $@ $<
1774
8bdcdf2c
ILT
1775check_PROGRAMS += protected_1
1776protected_1_SOURCES = \
1777 protected_main_1.cc protected_main_2.cc protected_main_3.cc
1778protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
1779protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1780protected_1_LDADD = protected_1.so
1781
1782protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
1783 $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
1784protected_1_pic.o: protected_1.cc
1785 $(CXXCOMPILE) -c -fpic -o $@ $<
1786protected_2_pic.o: protected_2.cc
1787 $(CXXCOMPILE) -c -fpic -o $@ $<
1788protected_3_pic.o: protected_3.cc
1789 $(CXXCOMPILE) -c -fpic -o $@ $<
1790
1791check_PROGRAMS += protected_2
1792protected_2_SOURCES = protected_main_1.cc protected_3.cc
1793protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
1794protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1795protected_2_LDADD = protected_1.so
1796
837504c4
ILT
1797check_DATA += protected_3.err
1798MOSTLYCLEANFILES += protected_3.err
1799protected_4_pic.o: protected_4.cc
1800 $(CXXCOMPILE) -c -fpic -o $@ $<
1801protected_3.err: protected_4_pic.o gcctestdir/ld
1802 @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@"
1803 @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \
1804 echo 1>&2 "Link of protected_4.so should have failed"; \
1805 rm -f $@; \
1806 exit 1; \
1807 fi
1808
9f1d377b 1809check_PROGRAMS += relro_test
fc497986
CC
1810check_SCRIPTS += relro_test.sh
1811check_DATA += relro_test.stdout
9f1d377b
ILT
1812relro_test_SOURCES = relro_test_main.cc
1813relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
1814relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1815relro_test_LDADD = relro_test.so
1816relro_test.so: gcctestdir/ld relro_test_pic.o
1817 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
1818relro_test_pic.o: relro_test.cc
1819 $(CXXCOMPILE) -c -fpic -o $@ $<
fc497986
CC
1820relro_test.stdout: relro_test.so
1821 $(TEST_READELF) -SlW relro_test.so > relro_test.stdout
9f1d377b 1822
9446efde
ILT
1823check_PROGRAMS += relro_now_test
1824relro_now_test_SOURCES = relro_test_main.cc
1825relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so
1826relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now
1827relro_now_test_LDADD = relro_now_test.so
1828relro_now_test.so: gcctestdir/ld relro_test_pic.o
1829 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o
1830
5f1ab67a
ILT
1831check_PROGRAMS += relro_strip_test
1832relro_strip_test_SOURCES = relro_test_main.cc
1833relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
1834relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1835relro_strip_test_LDADD = relro_strip_test.so
1836relro_strip_test.so: relro_test.so
1837 $(TEST_STRIP) -o $@ $<
1838
2d924fd9
ILT
1839check_PROGRAMS += relro_script_test
1840relro_script_test_SOURCES = relro_test_main.cc
1841relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
1842relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1843relro_script_test_LDADD = relro_script_test.so
1844relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
1496b446 1845 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o
2d924fd9 1846
e5756efb 1847check_PROGRAMS += script_test_1
5b2af7dd 1848script_test_1_SOURCES = script_test_1a.cc script_test_1b.cc
e5756efb 1849script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
1496b446 1850script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t
1abce4a6 1851script_test_1_LDADD =
e5756efb 1852
a445fddf
ILT
1853check_PROGRAMS += script_test_2
1854script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
1855script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
1496b446 1856script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t
1abce4a6 1857script_test_2_LDADD =
a445fddf 1858
88dd47ac
ILT
1859check_PROGRAMS += justsyms
1860justsyms_SOURCES = justsyms_1.cc
1861justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
1862justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
1abce4a6 1863justsyms_LDADD =
88dd47ac
ILT
1864justsyms_2.o: justsyms_2.cc
1865 $(CXXCOMPILE) -c -o $@ $<
83bfb6b7 1866justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
52dc3f9c 1867 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
88dd47ac 1868
c3f7b0e5
CC
1869check_PROGRAMS += justsyms_exec
1870justsyms_exec_SOURCES = justsyms_exec.c
1871justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib
1872justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib
1873justsyms_exec_LDADD =
0ec6429b 1874MOSTLYCLEANFILES += justsyms_lib
c3f7b0e5
CC
1875justsyms_lib.o: justsyms_lib.c
1876 $(COMPILE) -c -o $@ $<
1877justsyms_lib: justsyms_lib.o gcctestdir/ld
1878 gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o
1879
bc644c6c 1880check_PROGRAMS += binary_test
72fef11a 1881MOSTLYCLEANFILES += binary.txt
bc644c6c
ILT
1882binary_test_SOURCES = binary_test.cc
1883binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
1884binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
1abce4a6 1885binary_test_LDADD =
bc644c6c
ILT
1886# Copy the file to the build directory to avoid worrying about the
1887# full pathname in the generated symbols.
1888binary.txt: $(srcdir)/binary.in
1889 rm -f $@
1890 $(LN_S) $< $@
1891
09124467
ILT
1892check_SCRIPTS += ver_matching_test.sh
1893check_DATA += ver_matching_test.stdout
1894MOSTLYCLEANFILES += ver_matching_test.stdout
2fbb4320
ILT
1895ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld
1896 $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map
1897ver_matching_def_pic.o: ver_matching_def.cc
1898 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
09124467 1899ver_matching_test.stdout: ver_matching_def.so
52dc3f9c 1900 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1c4f3631
ILT
1901
1902check_PROGRAMS += script_test_3
1903check_SCRIPTS += script_test_3.sh
1904check_DATA += script_test_3.stdout
1905MOSTLYCLEANFILES += script_test_3.stdout
1906script_test_3: basic_test.o gcctestdir/ld script_test_3.t
1496b446 1907 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_3.t
1c4f3631 1908script_test_3.stdout: script_test_3
2cefc357 1909 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
09124467 1910
4ebf39db
ILT
1911check_PROGRAMS += tls_phdrs_script_test
1912tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
1913tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
1496b446 1914tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t
4ebf39db
ILT
1915tls_phdrs_script_test_LDADD = $(tls_test_LDADD)
1916
e6188289
ILT
1917check_SCRIPTS += script_test_4.sh
1918check_DATA += script_test_4.stdout
72fef11a 1919MOSTLYCLEANFILES += script_test_4
e6188289 1920script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
1496b446 1921 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_4.t
e6188289
ILT
1922script_test_4.stdout: script_test_4
1923 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
1924
6c93b22c
ILT
1925check_PROGRAMS += tls_script_test
1926tls_script_test_SOURCES = $(tls_test_SOURCES)
1927tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t
1496b446 1928tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_4.t
6c93b22c
ILT
1929tls_script_test_LDADD = $(tls_test_LDADD)
1930
401a9a73
CC
1931check_SCRIPTS += script_test_5.sh
1932check_DATA += script_test_5.stdout
72fef11a 1933MOSTLYCLEANFILES += script_test_5
401a9a73 1934script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
1496b446 1935 $(CXXLINK) -Bgcctestdir/ script_test_5.o -Wl,-T,$(srcdir)/script_test_5.t
401a9a73
CC
1936script_test_5.stdout: script_test_5
1937 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
1938
3c12dcdb
DK
1939check_SCRIPTS += script_test_6.sh
1940check_DATA += script_test_6.stdout
1941MOSTLYCLEANFILES += script_test_6
1942script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t
1496b446 1943 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_6.t \
3c12dcdb
DK
1944 -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000
1945script_test_6.stdout: script_test_6
1946 $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout
1947
1948check_SCRIPTS += script_test_7.sh
1949check_DATA += script_test_7.stdout
1950MOSTLYCLEANFILES += script_test_7
1951script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1496b446 1952 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_7.t
3c12dcdb
DK
1953script_test_7.stdout: script_test_7
1954 $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout
1955
1956check_SCRIPTS += script_test_8.sh
1957check_DATA += script_test_8.stdout
1958MOSTLYCLEANFILES += script_test_8
1959script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1496b446 1960 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_7.t \
3c12dcdb
DK
1961 -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000
1962script_test_8.stdout: script_test_8
1963 $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout
1964
d103a984
RÁE
1965check_SCRIPTS += script_test_9.sh
1966check_DATA += script_test_9.stdout
0ec6429b 1967MOSTLYCLEANFILES += script_test_9
d103a984
RÁE
1968script_test_9.o: script_test_9.cc
1969 $(CXXCOMPILE) -O0 -c -o $@ $<
1970script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
1496b446 1971 $(CXXLINK) -Bgcctestdir/ script_test_9.o -Wl,-T,$(srcdir)/script_test_9.t
d103a984
RÁE
1972script_test_9.stdout: script_test_9
1973 $(TEST_READELF) -lW script_test_9 > script_test_9.stdout
1974
502e8a84
CC
1975# Test scripts with a relocatable link.
1976# The -g option is necessary to trigger a bug where a section
1977# declared in a script file is assigned a non-zero starting address.
1978check_PROGRAMS += script_test_11
1979script_test_11: gcctestdir/ld script_test_11_r.o
1980 $(LINK) -Bgcctestdir/ script_test_11_r.o
5b2af7dd
L
1981script_test_11_r.o: gcctestdir/ld $(srcdir)/script_test_11.t script_test_11a.o script_test_11b.o
1982 gcctestdir/ld -r -o $@ -T $(srcdir)/script_test_11.t script_test_11a.o script_test_11b.o
1983script_test_11a.o: script_test_11a.c
1984 $(COMPILE) -c -g -o $@ $<
1985script_test_11b.o: script_test_11b.c
502e8a84 1986 $(COMPILE) -c -g -o $@ $<
d103a984 1987
374082df
CC
1988# Test difference between "*(a b)" and "*(a) *(b)" in input section spec.
1989check_PROGRAMS += script_test_12
1990script_test_12: gcctestdir/ld $(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o
1991 $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o
1992
1993check_PROGRAMS += script_test_12i
1994script_test_12i: gcctestdir/ld $(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o
1995 $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o
a3a0c391
JY
1996script_test_12a.o: script_test_12a.c
1997 $(COMPILE) -O0 -c -o $@ $<
1998script_test_12b.o: script_test_12b.c
1999 $(COMPILE) -O0 -c -o $@ $<
374082df 2000
f224a3c5
IK
2001# Test for SORT_BY_INIT_PRIORITY.
2002check_SCRIPTS += script_test_14.sh
2003check_DATA += script_test_14.stdout
2004MOSTLYCLEANFILES += script_test_14
2005script_test_14.o: script_test_14.s
2006 $(TEST_AS) -o $@ $<
2007script_test_14: $(srcdir)/script_test_14.t script_test_14.o gcctestdir/ld
2008 gcctestdir/ld -o $@ script_test_14.o -T $(srcdir)/script_test_14.t
2009script_test_14.stdout: script_test_14
2010 $(TEST_OBJDUMP) -s script_test_14 > $@
2011
c82fbeee
CS
2012# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
2013# and --dynamic-list-cpp-typeinfo
2014
2015check_SCRIPTS += dynamic_list.sh
2016check_DATA += dynamic_list.stdout
72fef11a 2017MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout
c82fbeee
CS
2018dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
2019 $(CXXLINK) -Bgcctestdir/ basic_test.o \
2020 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
2021 -Wl,--dynamic-list-data \
2022 -Wl,--dynamic-list-cpp-new \
2023 -Wl,--dynamic-list-cpp-typeinfo
2024dynamic_list.stdout: dynamic_list
94e6ee91 2025 $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout
c82fbeee 2026
fd834e57
CC
2027check_PROGRAMS += dynamic_list_2
2028dynamic_list_2_SOURCES = dynamic_list_2.cc
2029dynamic_list_2_DEPENDENCIES = gcctestdir/ld dynamic_list_lib1.so dynamic_list_lib2.so
2030dynamic_list_2_LDFLAGS = -Bgcctestdir/ -L. -Wl,-R,. -Wl,--no-as-needed
2031dynamic_list_2_LDADD = dynamic_list_lib1.so dynamic_list_lib2.so
2032
2033dynamic_list_lib1.so: gcctestdir/ld dynamic_list_lib1.o
2034 $(CXXLINK) -Bgcctestdir/ -shared dynamic_list_lib1.o
2035dynamic_list_lib1.o: dynamic_list_lib1.cc
2036 $(CXXCOMPILE) -c -fpic -o $@ $<
2037
2038dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
e9c1bdad 2039 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
fd834e57
CC
2040dynamic_list_lib2.o: dynamic_list_lib2.cc
2041 $(CXXCOMPILE) -c -fpic -o $@ $<
2042
fbd8a257 2043check_PROGRAMS += thin_archive_test_1
72fef11a
CC
2044MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
2045 alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
2046 alt/libthin2.a alt/libthin4.a
fbd8a257
CC
2047thin_archive_test_1_SOURCES = thin_archive_main.cc
2048thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
2049thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
2050thin_archive_test_1_LDADD = libthin1.a -lthin2
2051
2052check_PROGRAMS += thin_archive_test_2
2053thin_archive_test_2_SOURCES = thin_archive_main.cc
2054thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
2055thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
2056thin_archive_test_2_LDADD = -lthinall
2057
2058libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
2059 rm -f $@
2060 $(TEST_AR) crT $@ $^
2061alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
2062 rm -f $@
2063 $(TEST_AR) crT $@ $^
2064libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
2065 rm -f $@
2066 $(TEST_AR) crT $@ $^
2067alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
2068 rm -f $@
2069 $(TEST_AR) crT $@ $^
2070libthinall.a: libthin3.a alt/libthin4.a
2071 rm -f $@
2072 $(TEST_AR) crT $@ $^
2073alt/thin_archive_test_2.o: thin_archive_test_2.cc
2074 test -d alt || mkdir -p alt
2075 $(CXXCOMPILE) -c -o $@ $<
2076alt/thin_archive_test_4.o: thin_archive_test_4.cc
2077 test -d alt || mkdir -p alt
2078 $(CXXCOMPILE) -c -o $@ $<
2079
89fc3421
CC
2080if PLUGINS
2081
2082check_PROGRAMS += plugin_test_1
2083check_SCRIPTS += plugin_test_1.sh
2084check_DATA += plugin_test_1.err
2085MOSTLYCLEANFILES += plugin_test_1.err
2cfbf2fe
CC
2086plugin_test_1: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms gcctestdir/ld plugin_test.so
2087 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_1.err
89fc3421
CC
2088plugin_test_1.err: plugin_test_1
2089 @touch plugin_test_1.err
2090
2091check_PROGRAMS += plugin_test_2
2092check_SCRIPTS += plugin_test_2.sh
2093check_DATA += plugin_test_2.err
2094MOSTLYCLEANFILES += plugin_test_2.err
2cfbf2fe
CC
2095plugin_test_2: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so gcctestdir/ld plugin_test.so
2096 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so 2>plugin_test_2.err
89fc3421
CC
2097plugin_test_2.err: plugin_test_2
2098 @touch plugin_test_2.err
2099
d66a9eb3
CC
2100check_PROGRAMS += plugin_test_3
2101check_SCRIPTS += plugin_test_3.sh
2102check_DATA += plugin_test_3.err
2103MOSTLYCLEANFILES += plugin_test_3.err
2cfbf2fe
CC
2104plugin_test_3: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms gcctestdir/ld plugin_test.so
2105 $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_3.err
d66a9eb3
CC
2106plugin_test_3.err: plugin_test_3
2107 @touch plugin_test_3.err
2108
0f7c0701
CC
2109check_PROGRAMS += plugin_test_4
2110check_SCRIPTS += plugin_test_4.sh
2111check_DATA += plugin_test_4.err
72fef11a 2112MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
0f7c0701
CC
2113plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
2114 $(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
2115plugin_test_4.err: plugin_test_4
2116 @touch plugin_test_4.err
2117
2cfbf2fe 2118plugin_test_4.a: two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms
0f7c0701
CC
2119 $(TEST_AR) cr $@ $^
2120
24998053 2121check_PROGRAMS += plugin_test_5
2cfbf2fe
CC
2122plugin_test_5: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms gcctestdir/ld plugin_test.so
2123 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms
24998053 2124
be234d88
CC
2125check_PROGRAMS += plugin_test_6
2126check_SCRIPTS += plugin_test_6.sh
2127check_DATA += plugin_test_6.err
2128MOSTLYCLEANFILES += plugin_test_6.err
2cfbf2fe
CC
2129plugin_test_6: plugin_common_test_1.o.syms plugin_common_test_2.o.syms gcctestdir/ld plugin_test.so
2130 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o.syms 2>plugin_test_6.err
be234d88
CC
2131plugin_test_6.err: plugin_test_6
2132 @touch plugin_test_6.err
2133
5e0f337e
RÁE
2134check_PROGRAMS += plugin_test_7
2135check_SCRIPTS += plugin_test_7.sh
2cfbf2fe 2136check_DATA += plugin_test_7.err plugin_test_7.o.syms
5e0f337e 2137MOSTLYCLEANFILES += plugin_test_7.err
2cfbf2fe
CC
2138plugin_test_7: plugin_test_7_1.o plugin_test_7_1.o.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
2139 $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.o.syms plugin_test_7_2.o 2>plugin_test_7.err
2140plugin_test_7.o.syms: plugin_test_7
5e0f337e
RÁE
2141 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2142plugin_test_7_1.o: plugin_test_7_1.c
2143 $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2144plugin_test_7_1_orig.o: plugin_test_7_1.c
2145 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2cfbf2fe 2146plugin_test_7_1.o.syms: plugin_test_7_1_orig.o
5e0f337e
RÁE
2147 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2148plugin_test_7_2.o: plugin_test_7_2.c
2149 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2150plugin_test_7.err: plugin_test_7
2151
f3a2388f
CC
2152# Test plugins with -r.
2153check_PROGRAMS += plugin_test_8
2cfbf2fe
CC
2154plugin_test_8.o: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o ../ld-new plugin_test.so
2155 ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o
f3a2388f
CC
2156plugin_test_8: plugin_test_8.o gcctestdir/ld
2157 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o
2158
2159# Test that symbols known in the IR file but not in the replacement file
2160# produce an unresolved symbol error.
2161check_DATA += plugin_test_9.err
2162MOSTLYCLEANFILES += plugin_test_9.err
2cfbf2fe
CC
2163plugin_test_9.err: two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms gcctestdir/ld plugin_test.so
2164 @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms "2>$@"
2165 @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms 2>$@; then \
f3a2388f
CC
2166 echo 1>&2 "Link of plugin_test_9 should have failed"; \
2167 rm -f $@; \
2168 exit 1; \
2169 fi
2170# Make a .syms file that claims to define the symbol _Z4t16av.
2cfbf2fe
CC
2171two_file_test_1c.o.syms: two_file_test_1.o.syms two_file_test_1c.o
2172 cp two_file_test_1.o.syms $@.tmp
2173 grep "_Z4t16av" two_file_test_1b.o.syms >> $@.tmp
f3a2388f
CC
2174 mv -f $@.tmp $@
2175# Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
2176MOSTLYCLEANFILES += two_file_test_1c.o
2177two_file_test_1c.o: two_file_test_1.o
2178 cp two_file_test_1.o $@
2179
648c5cbb
CC
2180# As above, but check COMDAT case, where a non-IR file contains a duplicate
2181# of a COMDAT group in an IR file.
2182check_DATA += plugin_test_9b.err
2183MOSTLYCLEANFILES += plugin_test_9b.err
2184plugin_test_9b.err: plugin_test_9b_ir.o.syms plugin_test_9b_ir.o plugin_test_9b_elf.o gcctestdir/ld plugin_test.so
2185 @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9b -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_ZN1A5printEv" plugin_test_9b_ir.o plugin_test_9b_elf.o "2>$@"
2186 @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9b -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_ZN1A5printEv" plugin_test_9b_ir.o plugin_test_9b_elf.o 2>$@; then \
2187 echo 1>&2 "Link of plugin_test_9b should have failed"; \
2188 rm -f $@; \
2189 exit 1; \
2190 fi
2191# Make a .syms file that claims to define a method in class A in a COMDAT group.
2192# The real plugin_test_9b_ir.o will be compiled without the -D, and will not
2193# define any methods in class A.
2194plugin_test_9b_ir.o.syms: plugin_test_9b_ir_witha.o
2195 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2196plugin_test_9b_ir_witha.o: plugin_test_9b_ir.cc
2197 $(CXXCOMPILE) -c -DUSE_CLASS_A -o $@ $<
2198
c0c71592
RÁE
2199check_PROGRAMS += plugin_test_10
2200check_SCRIPTS += plugin_test_10.sh
2201check_DATA += plugin_test_10.sections
2202MOSTLYCLEANFILES += plugin_test_10.sections
2cfbf2fe
CC
2203plugin_test_10: plugin_common_test_1.o.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so
2204 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o
c0c71592
RÁE
2205plugin_test_10.sections: plugin_test_10
2206 $(TEST_READELF) -SW $< >$@ 2>/dev/null
2207
2cfbf2fe
CC
2208check_PROGRAMS += plugin_test_11
2209check_SCRIPTS += plugin_test_11.sh
2210check_DATA += plugin_test_11.err
dddcc5b9 2211MOSTLYCLEANFILES += plugin_test_11.err plugin_test_thin.a
2cfbf2fe
CC
2212PLUGIN_TEST_11_SYMS = two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms
2213plugin_test_11: two_file_test_main.o plugin_test_thin.a gcctestdir/ld plugin_test.so $(PLUGIN_TEST_11_SYMS)
2214 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o plugin_test_thin.a 2>plugin_test_11.err
2215plugin_test_11.err: plugin_test_11
2216 @touch plugin_test_11.err
2217plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o
2218 rm -f $@
2219 $(TEST_AR) crT $@ $^
c0c71592 2220
95ecdfbf
ES
2221
2222check_PROGRAMS += plugin_test_start_lib
2223check_SCRIPTS += plugin_test_start_lib.sh
2224check_DATA += plugin_test_start_lib.err
2225MOSTLYCLEANFILES += plugin_test_start_lib.err
2226plugin_test_start_lib: unused.o plugin_start_lib_test.o plugin_start_lib_test_2.syms gcctestdir/ld plugin_test.so
2227 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_start_lib_test.o \
2228 -Wl,--start-lib plugin_start_lib_test_2.syms -Wl,--end-lib 2>plugin_test_start_lib.err
2229plugin_test_start_lib.err: plugin_test_start_lib
2230 @touch plugin_test_start_lib.err
2231
2232
2233plugin_start_lib_test_2.syms: plugin_start_lib_test_2.o
2234 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2235
2236
89fc3421
CC
2237plugin_test.so: plugin_test.o
2238 $(LINK) -Bgcctestdir/ -shared plugin_test.o
2239plugin_test.o: plugin_test.c
2240 $(COMPILE) -O0 -c -fpic -o $@ $<
2241
2cfbf2fe 2242two_file_test_main.o.syms: two_file_test_main.o
89fc3421 2243 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 2244two_file_test_1.o.syms: two_file_test_1.o
89fc3421 2245 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 2246two_file_test_1b.o.syms: two_file_test_1b.o
89fc3421 2247 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 2248two_file_test_2.o.syms: two_file_test_2.o
89fc3421 2249 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 2250plugin_common_test_1.o.syms: plugin_common_test_1.o
be234d88 2251 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 2252plugin_common_test_2.o.syms: plugin_common_test_2.o
be234d88 2253 $(TEST_READELF) -sW $< >$@ 2>/dev/null
24998053 2254
2cfbf2fe 2255empty.o.syms:
24998053
CC
2256 @echo "" >$@
2257 @echo "Symbol table" >>$@
2258
32364e50
CC
2259if TLS
2260
2261check_PROGRAMS += plugin_test_tls
2262check_SCRIPTS += plugin_test_tls.sh
2263check_DATA += plugin_test_tls.err
2264MOSTLYCLEANFILES += plugin_test_tls.err
2cfbf2fe
CC
2265plugin_test_tls: two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms gcctestdir/ld plugin_test.so
2266 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms 2>plugin_test_tls.err
32364e50
CC
2267plugin_test_tls.err: plugin_test_tls
2268 @touch plugin_test_tls.err
2269
2cfbf2fe 2270two_file_test_2_tls.o.syms: two_file_test_2_tls.o
32364e50
CC
2271 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2272
2273endif TLS
2274
24998053 2275MOSTLYCLEANFILES += unused.c
2cfbf2fe 2276unused.o.syms: unused.o
24998053
CC
2277 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2278 @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@
2279unused.o: unused.c
2280 $(COMPILE) -c -o $@ $<
2281unused.c:
2282 @cp /dev/null $@
89fc3421 2283
f0558624 2284check_SCRIPTS += plugin_final_layout.sh
16164a6b 2285check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout
0ec6429b 2286MOSTLYCLEANFILES += plugin_final_layout
f0558624
ST
2287plugin_final_layout.o: plugin_final_layout.cc
2288 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
2289plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
2290 $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
2291plugin_final_layout.stdout: plugin_final_layout
864a1b56 2292 $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout
16164a6b
ST
2293plugin_final_layout_readelf.stdout: plugin_final_layout
2294 $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout
f0558624
ST
2295
2296plugin_section_order.so: plugin_section_order.o
2297 $(LINK) -Bgcctestdir/ -shared plugin_section_order.o
2298plugin_section_order.o: plugin_section_order.c
2299 $(COMPILE) -O0 -c -fpic -o $@ $<
2300
82838bd6
CC
2301check_SCRIPTS += plugin_layout_with_alignment.sh
2302check_DATA += plugin_layout_with_alignment.stdout
2303MOSTLYCLEANFILES += plugin_layout_with_alignment
fd91f002
L
2304plugin_layout_with_alignment.o: plugin_layout_with_alignment.c
2305 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
82838bd6 2306plugin_layout_with_alignment: plugin_layout_with_alignment.o plugin_section_alignment.so gcctestdir/ld
fd91f002 2307 $(LINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_alignment.so" plugin_layout_with_alignment.o
82838bd6
CC
2308plugin_layout_with_alignment.stdout: plugin_layout_with_alignment
2309 $(TEST_NM) -n --synthetic plugin_layout_with_alignment > plugin_layout_with_alignment.stdout
2310
2311plugin_section_alignment.so: plugin_section_alignment.o
2312 $(CXXLINK) -Bgcctestdir/ -shared plugin_section_alignment.o
2313plugin_section_alignment.o: plugin_section_alignment.cc
2314 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
2315
89fc3421
CC
2316endif PLUGINS
2317
65514900
CC
2318check_PROGRAMS += exclude_libs_test
2319check_SCRIPTS += exclude_libs_test.sh
2320check_DATA += exclude_libs_test.syms
2321MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
2fdd743f 2322 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
65514900
CC
2323exclude_libs_test_SOURCES = exclude_libs_test.c
2324exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
2fdd743f
DK
2325 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
2326exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
2327 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
2328 -Wl,--exclude-libs,libexclude_libs_test_3
2329exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
2330 alt/libexclude_libs_test_3.a
65514900
CC
2331exclude_libs_test.syms: exclude_libs_test
2332 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2333libexclude_libs_test_1.a: exclude_libs_test_1.o
2334 $(TEST_AR) rc $@ $^
2335libexclude_libs_test_2.a: exclude_libs_test_2.o
2336 $(TEST_AR) rc $@ $^
2fdd743f
DK
2337alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
2338 test -d alt || mkdir -p alt
2339 $(TEST_AR) rc $@ $^
65514900 2340
805bb01c
DK
2341check_PROGRAMS += local_labels_test
2342local_labels_test.o: ver_test_6.c
2343 $(COMPILE) -g -c -Wa,-L -o $@ $<
2344local_labels_test: local_labels_test.o
2345 $(LINK) -Bgcctestdir/ local_labels_test.o
2346
bb04269c
DK
2347check_PROGRAMS += discard_locals_test
2348check_SCRIPTS += discard_locals_test.sh
d3bbad62
ILT
2349check_DATA += discard_locals_test.syms \
2350 discard_locals_relocatable_test1.syms \
2351 discard_locals_relocatable_test2.syms
2352MOSTLYCLEANFILES += discard_locals_test.syms \
2353 discard_locals_relocatable_test1.syms \
2354 discard_locals_relocatable_test2.syms \
2355 discard_locals_relocatable_test1.out \
2356 discard_locals_relocatable_test2.out
bb04269c
DK
2357discard_locals_test_SOURCES = discard_locals_test.c
2358discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
2359discard_locals_test.syms: discard_locals_test
2360 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2361# '-Wa,-L' is required to preserve the local label used for testing.
2362discard_locals_test.o: discard_locals_test.c
2363 $(COMPILE) -c -Wa,-L -o $@ $<
2364
d3bbad62
ILT
2365discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out
2366 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2367discard_locals_relocatable_test.o: discard_locals_relocatable_test.c
2368 $(COMPILE) -c -Wa,-L -fPIC -o $@ $<
2369discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new
2370 ../ld-new --discard-locals -relocatable -o $@ $<
2371
2372discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out
2373 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2374discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new
2375 ../ld-new --discard-all -relocatable -o $@ $<
2376
8a5e3e08
ILT
2377if MCMODEL_MEDIUM
2378check_PROGRAMS += large
2379large_SOURCES = large.c
2380large_CFLAGS = -mcmodel=medium
2381large_DEPENDENCIES = gcctestdir/ld
2382large_LDFLAGS = -Bgcctestdir/
1abce4a6 2383large_LDADD =
8a5e3e08
ILT
2384endif MCMODEL_MEDIUM
2385
645afe0c
CC
2386# Test that hidden and internal symbols in the main program cannot be
2387# referenced by a shared library.
2388check_SCRIPTS += hidden_test.sh
2389check_DATA += hidden_test.err
c20ceeb2 2390MOSTLYCLEANFILES += hidden_test hidden_test.err hidden_test.syms
645afe0c
CC
2391libhidden.so: hidden_test_1.c gcctestdir/ld
2392 $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
2393hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
2394 $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
c20ceeb2
YW
2395hidden_test.syms: hidden_test
2396 $(TEST_NM) -D hidden_test > $@
645afe0c
CC
2397hidden_test.err: hidden_test
2398 @touch hidden_test.err
2399
8c604651
CS
2400# Test -retain-symbols-file.
2401check_SCRIPTS += retain_symbols_file_test.sh
2402check_DATA += retain_symbols_file_test.stdout
2403MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
2404 retain_symbols_file_test.stdout
2405retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld
2406 echo 'main' > retain_symbols_file_test.in
2407 echo 't1' >> retain_symbols_file_test.in
8c604651
CS
2408 echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
2409 echo '_Z3t18v' >> retain_symbols_file_test.in
2b64b551 2410 echo '__tcf_0' >> retain_symbols_file_test.in
8c604651
CS
2411 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
2412retain_symbols_file_test.stdout: retain_symbols_file_test.so
2413 $(TEST_NM) -C retain_symbols_file_test.so > $@
2414
2415
6a89f575
CC
2416# Test that if the output file already exists and is empty,
2417# it will get execute permission.
2418check_PROGRAMS += permission_test
2419permission_test: basic_test.o gcctestdir/ld
2420 umask 022; \
2421 rm -f $@; \
2422 touch $@; \
2423 chmod 600 $@; \
2424 $(CXXLINK) -Bgcctestdir/ basic_test.o
2425
ae3b5189
CD
2426# Check -l:foo.a
2427check_PROGRAMS += searched_file_test
2428MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
2429 alt/searched_file_test_lib.a
2430searched_file_test_SOURCES = searched_file_test.cc
2431searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
2432searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
2433searched_file_test_LDADD = -l:searched_file_test_lib.a
2434searched_file_test_lib.o: searched_file_test_lib.cc
2435 $(CXXCOMPILE) -c -o $@ $<
2436alt/searched_file_test_lib.a: searched_file_test_lib.o
2437 test -d alt || mkdir -p alt
2438 $(TEST_AR) rc $@ $^
2439
2b64b551 2440# Test that no .gnu.version sections are created when
c5617f2f
DK
2441# symbol versioning is not used.
2442check_SCRIPTS += no_version_test.sh
2443check_DATA += no_version_test.stdout
2444MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
2445# We invoke the linker directly since gcc may include additional objects that
2446# uses symbol versioning.
2447libno_version_test.so: no_version_test.o gcctestdir/ld
2448 gcctestdir/ld -shared -o $@ no_version_test.o
2449no_version_test.o: no_version_test.c
2450 $(COMPILE) -o $@ -c -fPIC $<
2451no_version_test.stdout: libno_version_test.so
2452 $(TEST_OBJDUMP) -h $< > $@
2453
7223e9ca
ILT
2454# Test STT_GNU_IFUNC symbols.
2455if IFUNC
2456
2457ifuncmod1.o: ifuncmod1.c
661d7a80 2458 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2459ifuncmod1.so: ifuncmod1.o gcctestdir/ld
2460 $(LINK) -Bgcctestdir/ -shared ifuncmod1.o
2461
2462ifuncdep1.o: ifuncmod1.c
2463 $(COMPILE) -c -o $@ $<
2464
2465ifuncmain1pic.o: ifuncmain1.c
661d7a80 2466 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca 2467ifuncmain1pie.o: ifuncmain1.c
661d7a80 2468 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca 2469
328c7c2f 2470if HAVE_STATIC
ebb300b2 2471if IFUNC_STATIC
7223e9ca
ILT
2472check_PROGRAMS += ifuncmain1static
2473ifuncmain1static_SOURCES = ifuncmain1.c
2474ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
2475ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
2476ifuncmain1static_LDADD = ifuncdep1.o
2477
2478check_PROGRAMS += ifuncmain1picstatic
2479ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
2480 $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
328c7c2f 2481endif
ebb300b2 2482endif
7223e9ca
ILT
2483
2484check_PROGRAMS += ifuncmain1
2485ifuncmain1_SOURCES = ifuncmain1.c
2486ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
2487ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2488ifuncmain1_LDADD = ifuncmod1.so
2489
2490check_PROGRAMS += ifuncmain1pic
2491ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
2492 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
2493
2494check_PROGRAMS += ifuncmain1vis
2495ifuncmain1vis_SOURCES = ifuncmain1vis.c
2496ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
2497ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2498ifuncmain1vis_LDADD = ifuncmod1.so
2499
2500check_PROGRAMS += ifuncmain1vispic
2501ifuncmain1vispic.o: ifuncmain1vis.c
661d7a80 2502 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2503ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
2504 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
2505
2506check_PROGRAMS += ifuncmain1staticpic
2507ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
2508 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
2509
2510check_PROGRAMS += ifuncmain1pie
2511ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
2512 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
2513
2514check_PROGRAMS += ifuncmain1vispie
2515ifuncmain1vispie.o: ifuncmain1vis.c
661d7a80 2516 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca
ILT
2517ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
2518 $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
2519
2520check_PROGRAMS += ifuncmain1staticpie
2521ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
2522 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
2523
2524ifuncmain2pic.o: ifuncmain2.c
661d7a80 2525 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2526
2527ifuncdep2pic.o: ifuncdep2.c
661d7a80 2528 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca 2529
328c7c2f 2530if HAVE_STATIC
ebb300b2 2531if IFUNC_STATIC
7223e9ca
ILT
2532check_PROGRAMS += ifuncmain2static
2533ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
2534ifuncmain2static_DEPENDENCIES = gcctestdir/ld
2535ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
f8e9a930 2536ifuncmain2static_LDADD =
7223e9ca
ILT
2537
2538check_PROGRAMS += ifuncmain2picstatic
2539ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
2540 $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
328c7c2f 2541endif
ebb300b2 2542endif
7223e9ca
ILT
2543
2544check_PROGRAMS += ifuncmain2
2545ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
2546ifuncmain2_DEPENDENCIES = gcctestdir/ld
2547ifuncmain2_LDFLAGS = -Bgcctestdir/
f8e9a930 2548ifuncmain2_LDADD =
7223e9ca
ILT
2549
2550check_PROGRAMS += ifuncmain2pic
2551ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
2552 $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
2553
2554ifuncmod3.o: ifuncmod3.c
661d7a80 2555 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2556ifuncmod3.so: ifuncmod3.o gcctestdir/ld
2557 $(LINK) -Bgcctestdir/ -shared ifuncmod3.o
2558
2559check_PROGRAMS += ifuncmain3
2560ifuncmain3_SOURCES = ifuncmain3.c
2561ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
2562ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
2563ifuncmain3_LDADD = -ldl
2564
2565ifuncmain4pic.o: ifuncmain4.c
661d7a80 2566 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca 2567
328c7c2f 2568if HAVE_STATIC
ebb300b2 2569if IFUNC_STATIC
7223e9ca
ILT
2570check_PROGRAMS += ifuncmain4static
2571ifuncmain4static_SOURCES = ifuncmain4.c
2572ifuncmain4static_DEPENDENCIES = gcctestdir/ld
2573ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
f8e9a930 2574ifuncmain4static_LDADD =
7223e9ca
ILT
2575
2576check_PROGRAMS += ifuncmain4picstatic
2577ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
2578 $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
328c7c2f 2579endif
ebb300b2 2580endif
7223e9ca
ILT
2581
2582check_PROGRAMS += ifuncmain4
2583ifuncmain4_SOURCES = ifuncmain4.c
2584ifuncmain4_DEPENDENCIES = gcctestdir/ld
2585ifuncmain4_LDFLAGS = -Bgcctestdir/
f8e9a930 2586ifuncmain4_LDADD =
7223e9ca
ILT
2587
2588ifuncmain5pic.o: ifuncmain5.c
661d7a80 2589 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2590
2591ifuncmain5pie.o: ifuncmain5.c
661d7a80 2592 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca
ILT
2593
2594ifuncmod5.o: ifuncmod5.c
661d7a80 2595 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2596ifuncmod5.so: ifuncmod5.o gcctestdir/ld
2597 $(LINK) -Bgcctestdir/ -shared ifuncmod5.o
2598
2599ifuncdep5.o: ifuncmod5.c
2600 $(COMPILE) -c -o $@ $<
2601
328c7c2f 2602if HAVE_STATIC
ebb300b2 2603if IFUNC_STATIC
7223e9ca
ILT
2604check_PROGRAMS += ifuncmain5static
2605ifuncmain5static_SOURCES = ifuncmain5.c
2606ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
2607ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
2608ifuncmain5static_LDADD = ifuncdep5.o
2609
2610check_PROGRAMS += ifuncmain5picstatic
2611ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
2612 $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
328c7c2f 2613endif
ebb300b2 2614endif
7223e9ca
ILT
2615
2616check_PROGRAMS += ifuncmain5
2617ifuncmain5_SOURCES = ifuncmain5.c
2618ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
2619ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2620ifuncmain5_LDADD = ifuncmod5.so
2621
2622check_PROGRAMS += ifuncmain5pic
2623ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
2624 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
2625
2626check_PROGRAMS += ifuncmain5staticpic
2627ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
2628 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
2629
2630check_PROGRAMS += ifuncmain5pie
2631ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
2632 $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
2633
2634ifuncmain6pie.o: ifuncmain6pie.c
661d7a80 2635 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca
ILT
2636
2637ifuncmod6.o: ifuncmod6.c
661d7a80 2638 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2639ifuncmod6.so: ifuncmod6.o gcctestdir/ld
2640 $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
2641
2642check_PROGRAMS += ifuncmain6pie
2643ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
2644 $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
2645
2646ifuncmain7pic.o: ifuncmain7.c
661d7a80 2647 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2648
2649ifuncmain7pie.o: ifuncmain7.c
661d7a80 2650 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca 2651
328c7c2f 2652if HAVE_STATIC
ebb300b2 2653if IFUNC_STATIC
7223e9ca
ILT
2654check_PROGRAMS += ifuncmain7static
2655ifuncmain7static_SOURCES = ifuncmain7.c
2656ifuncmain7static_DEPENDENCIES = gcctestdir/ld
2657ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
f8e9a930 2658ifuncmain7static_LDADD =
7223e9ca
ILT
2659
2660check_PROGRAMS += ifuncmain7picstatic
2661ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
2662 $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
328c7c2f 2663endif
ebb300b2 2664endif
7223e9ca
ILT
2665
2666check_PROGRAMS += ifuncmain7
2667ifuncmain7_SOURCES = ifuncmain7.c
2668ifuncmain7_DEPENDENCIES = gcctestdir/ld
2669ifuncmain7_LDFLAGS = -Bgcctestdir/
f8e9a930 2670ifuncmain7_LDADD =
7223e9ca
ILT
2671
2672check_PROGRAMS += ifuncmain7pic
2673ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
2674 $(LINK) -Bgcctestdir/ ifuncmain7pic.o
2675
2676check_PROGRAMS += ifuncmain7pie
2677ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
2678 $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
2679
67181c72
ILT
2680check_PROGRAMS += ifuncvar
2681ifuncvar1_pic.o: ifuncvar1.c
661d7a80 2682 $(COMPILE) -c -fPIC -o $@ $<
2b64b551 2683ifuncvar2_pic.o: ifuncvar2.c
661d7a80 2684 $(COMPILE) -c -fPIC -o $@ $<
67181c72
ILT
2685ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
2686 $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o
2687ifuncvar_SOURCES = ifuncvar3.c
2688ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
2689ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2690ifuncvar_LDADD = ifuncvar.so
2691
7223e9ca
ILT
2692endif IFUNC
2693
74f67560
DK
2694# Test that strong reference to a weak symbol in a DSO remains strong.
2695check_SCRIPTS += strong_ref_weak_def.sh
2696check_DATA += strong_ref_weak_def.stdout
2697MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
2698 strong_ref_weak_def.stdout
2699strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
2700 $(COMPILE) -o $@ -c -fPIC $<
2701strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
2702 gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
2703strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
2704 $(COMPILE) -o $@ -c -fPIC $<
2705strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
2706 gcctestdir/ld
2707 gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
2708 strong_ref_weak_def_2.so
2709strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
2710 $(TEST_READELF) -sWD $< > $@
2711
a4649286
DK
2712# Test that a strong weak reference remains strong if there is another
2713# weak reference in a DSO.
2714check_SCRIPTS += dyn_weak_ref.sh
2715check_DATA += dyn_weak_ref.stdout
2716MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
2717 dyn_weak_ref.stdout
2718dyn_weak_ref_2.o: dyn_weak_ref_2.c
2719 $(COMPILE) -o $@ -c -fPIC $<
2720dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
2721 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
2722dyn_weak_ref_1.o: dyn_weak_ref_1.c
2723 $(COMPILE) -o $@ -c -fPIC $<
2724# We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
2725# so that the weak ref there goes to gold's symbol table first.
2726dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
2727 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
2728dyn_weak_ref.stdout: dyn_weak_ref_1.so
2729 $(TEST_READELF) -sWD $< > $@
2730
2731
97b4be1c
CC
2732# Test that --start-lib and --end-lib function correctly.
2733check_PROGRAMS += start_lib_test
0ec6429b 2734MOSTLYCLEANFILES += libstart_lib_test.a
97b4be1c
CC
2735start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
2736 gcctestdir/ld
2737 $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
2738 -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib
2739libstart_lib_test.a: start_lib_test_1.o
2740 $(TEST_AR) rc $@ $^
2741
7f8cd844
NC
2742# Test that MEMORY region support works.
2743check_SCRIPTS += memory_test.sh
2744check_DATA += memory_test.stdout
2745MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o
d4d91489
ILT
2746memory_test.o: memory_test.s
2747 $(COMPILE) -o $@ -c $<
2748memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t
068e05ba 2749 $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-z,common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o
7f8cd844 2750memory_test.stdout: memory_test
41a8542a 2751 $(TEST_READELF) -lWS $< > $@
7f8cd844 2752
410da591
CC
2753# Test INCLUDE directives in linker scripts.
2754# The binary isn't runnable, so we just check that we can build it without errors.
2755check_DATA += memory_test_2
0863441e 2756MOSTLYCLEANFILES += memory_test_inc_1.t memory_test_inc_2.t memory_test_inc_3.t memory_test_2
410da591
CC
2757memory_test_inc_1.t: $(srcdir)/memory_test_inc_1.t.src
2758 cp $< $@
2759memory_test_inc_2.t: $(srcdir)/memory_test_inc_2.t.src
2760 cp $< $@
2761memory_test_inc_3.t: $(srcdir)/memory_test_inc_3.t.src
2762 cp $< $@
2763memory_test_2: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t memory_test_inc_1.t memory_test_inc_2.t memory_test_inc_3.t
068e05ba 2764 $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-z,common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o
410da591 2765
f1415016
CC
2766if HAVE_PUBNAMES
2767
2768# Test that --gdb-index functions correctly without gcc-generated pubnames.
c1027032
CC
2769check_SCRIPTS += gdb_index_test_1.sh
2770check_DATA += gdb_index_test_1.stdout
2771MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1
2772gdb_index_test.o: gdb_index_test.cc
f1415016 2773 $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $<
c1027032
CC
2774gdb_index_test_1: gdb_index_test.o gcctestdir/ld
2775 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2776gdb_index_test_1.stdout: gdb_index_test_1
2777 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2778
f1415016 2779# Test that --gdb-index functions correctly with compressed debug sections.
c1027032
CC
2780check_SCRIPTS += gdb_index_test_2.sh
2781check_DATA += gdb_index_test_2.stdout
0863441e 2782MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 gdb_index_test_2_gabi
c1027032
CC
2783gdb_index_test_cdebug.o: gdb_index_test.cc
2784 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
2785gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
2786 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2787gdb_index_test_2.stdout: gdb_index_test_2
2788 $(TEST_READELF) --debug-dump=gdb_index $< > $@
48058663
L
2789check_SCRIPTS += gdb_index_test_2_gabi.sh
2790check_DATA += gdb_index_test_2_gabi.stdout
2791MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2
2792gdb_index_test_cdebug_gabi.o: gdb_index_test.cc
2793 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -o $@ $<
2794gdb_index_test_2_gabi: gdb_index_test_cdebug_gabi.o gcctestdir/ld
2795 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2796gdb_index_test_2_gabi.stdout: gdb_index_test_2_gabi
2797 $(TEST_READELF) --debug-dump=gdb_index $< > $@
c1027032 2798
f1415016 2799# Another simple C test (DW_AT_high_pc encoding) for --gdb-index.
57923f48
MW
2800check_SCRIPTS += gdb_index_test_3.sh
2801check_DATA += gdb_index_test_3.stdout
2802MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3
2803gdb_index_test_3.o: gdb_index_test_3.c
2804 $(COMPILE) -O0 -g -c -o $@ $<
2805gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld
2806 $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $<
2807gdb_index_test_3.stdout: gdb_index_test_3
2808 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2809
f1415016
CC
2810# Test that --gdb-index functions correctly with gcc-generated pubnames.
2811check_SCRIPTS += gdb_index_test_4.sh
2812check_DATA += gdb_index_test_4.stdout
2813MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4
2814gdb_index_test_pub.o: gdb_index_test.cc
2815 $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $<
2816gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld
2817 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2818gdb_index_test_4.stdout: gdb_index_test_4
2819 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2820
2821endif HAVE_PUBNAMES
57923f48 2822
d1bddd3c
CC
2823# Test that __ehdr_start is defined correctly.
2824check_PROGRAMS += ehdr_start_test_1
2825ehdr_start_test_1_SOURCES = ehdr_start_test.cc
2826ehdr_start_test_1_DEPENDENCIES = gcctestdir/ld
2827ehdr_start_test_1_CXXFLAGS =
2828ehdr_start_test_1_LDFLAGS = -Bgcctestdir/
2829ehdr_start_test_1_LDADD =
2830
2831# Test that __ehdr_start is defined correctly with a weak reference.
2832check_PROGRAMS += ehdr_start_test_2
2833ehdr_start_test_2_SOURCES = ehdr_start_test.cc
2834ehdr_start_test_2_DEPENDENCIES = gcctestdir/ld
2835ehdr_start_test_2_CXXFLAGS = -DEHDR_START_WEAK
2836ehdr_start_test_2_LDFLAGS = -Bgcctestdir/
2837ehdr_start_test_2_LDADD =
2838
2839# Test that __ehdr_start is defined correctly when used with a linker script.
2840check_PROGRAMS += ehdr_start_test_3
2841ehdr_start_test_3_SOURCES = ehdr_start_test.cc
2842ehdr_start_test_3_DEPENDENCIES = gcctestdir/ld $(srcdir)/ehdr_start_test.t
2843ehdr_start_test_3_CXXFLAGS = -DEHDR_START_WEAK
2844ehdr_start_test_3_LDFLAGS = -Bgcctestdir/ -Wl,-T,$(srcdir)/ehdr_start_test.t
2845ehdr_start_test_3_LDADD =
2846
2847# Test that __ehdr_start is left undefined when the text segment is not
2848# appropriately aligned.
2849check_SCRIPTS += ehdr_start_test_4.sh
2850check_DATA += ehdr_start_test_4.syms
2851MOSTLYCLEANFILES += ehdr_start_test_4
2852ehdr_start_test_4.syms: ehdr_start_test_4
2853 $(TEST_NM) ehdr_start_test_4 > $@
2854ehdr_start_test_4: ehdr_start_test_4.o gcctestdir/ld
f6fb8322 2855 $(CXXLINK) -Bgcctestdir/ -Wl,-Ttext=0x100100 $<
d1bddd3c
CC
2856ehdr_start_test_4.o: ehdr_start_test.cc
2857 $(CXXCOMPILE) -c -DEHDR_START_WEAK -o $@ $<
2858
2859# Test that __ehdr_start is not overridden when supplied by the user.
2860check_PROGRAMS += ehdr_start_test_5
2861ehdr_start_test_5_SOURCES = ehdr_start_test.cc ehdr_start_def.cc
2862ehdr_start_test_5_DEPENDENCIES = gcctestdir/ld
2863ehdr_start_test_5_CXXFLAGS = -DEHDR_START_USER_DEF
2864ehdr_start_test_5_LDFLAGS = -Bgcctestdir/
2865ehdr_start_test_5_LDADD =
2866
e051745c
CC
2867# Test that the --defsym option copies the symbol type and visibility.
2868check_SCRIPTS += defsym_test.sh
2869check_DATA += defsym_test.syms
dddcc5b9 2870MOSTLYCLEANFILES += defsym_test defsym_test.syms
e051745c
CC
2871defsym_test.syms: defsym_test
2872 $(TEST_READELF) -sW $< > $@
2873defsym_test: defsym_test.o gcctestdir/ld
2874 $(LINK) -Bgcctestdir/ -Wl,--defsym=bar=foo defsym_test.o
2875defsym_test.o: defsym_test.c
2876 $(COMPILE) -c -o $@ $<
2877
2eedd706
CC
2878# End-to-end incremental linking tests.
2879# Incremental linking is currently supported only on the x86_64 target.
2880
2881if DEFAULT_TARGET_X86_64
2882
33c15b45
CC
2883two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
2884 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2885two_file_test_1_ndebug.o: two_file_test_1.cc
2886 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2887two_file_test_1b_ndebug.o: two_file_test_1b.cc
2888 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2889two_file_test_2_ndebug.o: two_file_test_2.cc
2890 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2891two_file_test_main_ndebug.o: two_file_test_main.cc
2892 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2893
2eedd706 2894check_PROGRAMS += incremental_test_2
c49875be 2895MOSTLYCLEANFILES += two_file_test_tmp_2.o
33c15b45
CC
2896incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
2897 two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
2898 cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
943c8b43 2899 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -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
2eedd706 2900 @sleep 1
33c15b45 2901 cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
943c8b43 2902 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -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
2eedd706
CC
2903
2904check_PROGRAMS += incremental_test_3
c49875be 2905MOSTLYCLEANFILES += two_file_test_tmp_3.o
2eedd706
CC
2906incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2907 two_file_test_2.o two_file_test_main.o gcctestdir/ld
c49875be 2908 cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
943c8b43 2909 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
2eedd706 2910 @sleep 1
c49875be 2911 cp -f two_file_test_1b.o two_file_test_tmp_3.o
943c8b43 2912 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
2eedd706
CC
2913
2914check_PROGRAMS += incremental_test_4
c49875be 2915MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
2eedd706
CC
2916incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
2917 two_file_test_2.o two_file_test_main.o gcctestdir/ld
c49875be 2918 cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
943c8b43 2919 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
aa92d6ed 2920 mv -f incremental_test_4 incremental_test_4.base
2eedd706 2921 @sleep 1
c49875be 2922 cp -f two_file_test_2.o two_file_test_tmp_4.o
943c8b43 2923 $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
2eedd706 2924
e24719f6
CC
2925check_PROGRAMS += incremental_test_5
2926MOSTLYCLEANFILES += two_file_test_5.a
2927incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2928 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2929 cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
2930 $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
943c8b43 2931 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
e24719f6
CC
2932 @sleep 1
2933 cp -f two_file_test_1b.o two_file_test_tmp_5.o
2934 $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
943c8b43 2935 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
e24719f6
CC
2936
2937# Test the --incremental-unchanged flag with an archive library.
2938# The second link should not update the library.
2939check_PROGRAMS += incremental_test_6
2940MOSTLYCLEANFILES += two_file_test_6.a
2941incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2942 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2943 cp -f two_file_test_1b.o two_file_test_tmp_6.o
2944 $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
943c8b43 2945 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
e24719f6
CC
2946 @sleep 1
2947 cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
2948 $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
943c8b43 2949 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
e24719f6 2950
a5ee4d5d
CC
2951check_PROGRAMS += incremental_copy_test
2952incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
2953 cp -f copy_test_v1.o copy_test_tmp.o
943c8b43 2954 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
a5ee4d5d
CC
2955 @sleep 1
2956 cp -f copy_test.o copy_test_tmp.o
943c8b43 2957 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
a5ee4d5d
CC
2958
2959check_PROGRAMS += incremental_common_test_1
2960incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
2961 cp -f common_test_1_v1.o common_test_1_tmp.o
943c8b43 2962 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o
a5ee4d5d
CC
2963 @sleep 1
2964 cp -f common_test_1_v2.o common_test_1_tmp.o
943c8b43 2965 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o
a5ee4d5d 2966
1206d0d5
CC
2967check_PROGRAMS += incremental_comdat_test_1
2968incremental_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
2969 cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
943c8b43 2970 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
1206d0d5
CC
2971 @sleep 1
2972 cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
943c8b43 2973 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
1206d0d5
CC
2974 @sleep 1
2975 cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
943c8b43 2976 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
1206d0d5 2977
2eedd706
CC
2978endif DEFAULT_TARGET_X86_64
2979
f49fe902
L
2980if DEFAULT_TARGET_X86_64
2981check_PROGRAMS += exception_x86_64_bnd_test
2982exception_x86_64_bnd_test_SOURCES = exception_test_main.cc
635aa30e 2983exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
f49fe902 2984exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS)
635aa30e 2985exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
0c075858 2986exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as
f49fe902 2987 $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $<
0c075858 2988exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as
f49fe902
L
2989 $(CXXCOMPILE) -c -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $<
2990endif DEFAULT_TARGET_X86_64
2991
351a8000
ILT
2992endif GCC
2993endif NATIVE_LINKER
364c7fa5 2994
eb373049
ILT
2995# These tests work with native and cross linkers.
2996
2997if NATIVE_OR_CROSS_LINKER
2998
2999# Test script section order.
3000check_SCRIPTS += script_test_10.sh
3001check_DATA += script_test_10.stdout
0ec6429b 3002MOSTLYCLEANFILES += script_test_10
eb373049
ILT
3003script_test_10.o: script_test_10.s
3004 $(TEST_AS) -o $@ $<
3005script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
52dc3f9c 3006 gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t
eb373049
ILT
3007script_test_10.stdout: script_test_10
3008 $(TEST_READELF) -SW script_test_10 > $@
3009
3010# These tests work with cross linkers only.
364c7fa5
ILT
3011
3012if DEFAULT_TARGET_I386
3013
3014check_SCRIPTS += split_i386.sh
3015check_DATA += split_i386_1.stdout split_i386_2.stdout \
3016 split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
3017SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3018split_i386_1.o: split_i386_1.s
3019 $(TEST_AS) -o $@ $<
3020split_i386_2.o: split_i386_2.s
3021 $(TEST_AS) -o $@ $<
3022split_i386_3.o: split_i386_3.s
3023 $(TEST_AS) -o $@ $<
3024split_i386_4.o: split_i386_4.s
3025 $(TEST_AS) -o $@ $<
3026split_i386_n.o: split_i386_n.s
3027 $(TEST_AS) -o $@ $<
3028split_i386_1: split_i386_1.o split_i386_n.o ../ld-new
3029 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o
3030split_i386_1.stdout: split_i386_1
3031 $(TEST_OBJDUMP) -d $< > $@
3032split_i386_2: split_i386_2.o split_i386_n.o ../ld-new
3033 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o
3034split_i386_2.stdout: split_i386_2
3035 $(TEST_OBJDUMP) -d $< > $@
3036split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new
3037 ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0
3038split_i386_4: split_i386_4.o split_i386_n.o ../ld-new
3039 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o
3040split_i386_4.stdout: split_i386_4
3041 $(TEST_OBJDUMP) -d $< > $@
3042split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new
3043 ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0
3044MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \
3045 split_i386_4 split_i386_r
3046
3047endif DEFAULT_TARGET_I386
3048
3049if DEFAULT_TARGET_X86_64
3050
3051check_SCRIPTS += split_x86_64.sh
3052check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \
3053 split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
3054SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3055split_x86_64_1.o: split_x86_64_1.s
3056 $(TEST_AS) -o $@ $<
3057split_x86_64_2.o: split_x86_64_2.s
3058 $(TEST_AS) -o $@ $<
3059split_x86_64_3.o: split_x86_64_3.s
3060 $(TEST_AS) -o $@ $<
3061split_x86_64_4.o: split_x86_64_4.s
3062 $(TEST_AS) -o $@ $<
3063split_x86_64_n.o: split_x86_64_n.s
3064 $(TEST_AS) -o $@ $<
3065split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new
3066 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o
3067split_x86_64_1.stdout: split_x86_64_1
3068 $(TEST_OBJDUMP) -d $< > $@
3069split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new
3070 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o
3071split_x86_64_2.stdout: split_x86_64_2
3072 $(TEST_OBJDUMP) -d $< > $@
3073split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new
3074 ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0
3075split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new
3076 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o
3077split_x86_64_4.stdout: split_x86_64_4
3078 $(TEST_OBJDUMP) -d $< > $@
3079split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
3080 ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0
3081MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
3082 split_x86_64_4 split_x86_64_r
3083
3084endif DEFAULT_TARGET_X86_64
e4782e83 3085
4fc1b9d4
L
3086if DEFAULT_TARGET_X32
3087
3088check_SCRIPTS += split_x32.sh
3089check_DATA += split_x32_1.stdout split_x32_2.stdout \
3090 split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout
3091SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3092split_x32_1.o: split_x32_1.s
3093 $(TEST_AS) -o $@ $<
3094split_x32_2.o: split_x32_2.s
3095 $(TEST_AS) -o $@ $<
3096split_x32_3.o: split_x32_3.s
3097 $(TEST_AS) -o $@ $<
3098split_x32_4.o: split_x32_4.s
3099 $(TEST_AS) -o $@ $<
3100split_x32_n.o: split_x32_n.s
3101 $(TEST_AS) -o $@ $<
3102split_x32_1: split_x32_1.o split_x32_n.o ../ld-new
3103 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_1.o split_x32_n.o
3104split_x32_1.stdout: split_x32_1
3105 $(TEST_OBJDUMP) -d $< > $@
3106split_x32_2: split_x32_2.o split_x32_n.o ../ld-new
3107 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_2.o split_x32_n.o
3108split_x32_2.stdout: split_x32_2
3109 $(TEST_OBJDUMP) -d $< > $@
3110split_x32_3.stdout: split_x32_3.o split_x32_n.o ../ld-new
3111 ../ld-new $(SPLIT_DEFSYMS) -o split_x32_3 split_x32_3.o split_x32_n.o > $@ 2>&1 || exit 0
3112split_x32_4: split_x32_4.o split_x32_n.o ../ld-new
3113 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_4.o split_x32_n.o
3114split_x32_4.stdout: split_x32_4
3115 $(TEST_OBJDUMP) -d $< > $@
3116split_x32_r.stdout: split_x32_1.o split_x32_n.o ../ld-new
3117 ../ld-new -r split_x32_1.o split_x32_n.o -o split_x32_r > $@ 2>&1 || exit 0
3118MOSTLYCLEANFILES += split_x32_1 split_x32_2 split_x32_3 \
3119 split_x32_4 split_x32_r
3120
3121endif DEFAULT_TARGET_X32
3122
e4782e83
DK
3123if DEFAULT_TARGET_ARM
3124
3125check_SCRIPTS += arm_abs_global.sh
3126check_DATA += arm_abs_global.stdout
3127arm_abs_lib.o: arm_abs_lib.s
3128 $(TEST_AS) -march=armv7-a -o $@ $<
d3bbad62 3129libarm_abs.so: arm_abs_lib.o ../ld-new
e4782e83
DK
3130 ../ld-new -shared -o $@ arm_abs_lib.o
3131arm_abs_global.o: arm_abs_global.s
3132 $(TEST_AS) -march=armv7-a -o $@ $<
d3bbad62 3133arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new
e4782e83
DK
3134 ../ld-new -o $@ arm_abs_global.o -L. -larm_abs
3135arm_abs_global.stdout: arm_abs_global
3136 $(TEST_READELF) -r $< > $@
3137
3138MOSTLYCLEANFILES += arm_abs_global
3139
aa98ff75 3140check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh
2a2b6d42
DK
3141check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \
3142 thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \
a2c7281b
DK
3143 thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \
3144 thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \
aa98ff75 3145 thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \
57eb9b50
DK
3146 thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \
3147 arm_thm_jump8.stdout
2a2b6d42
DK
3148
3149arm_bl_in_range.stdout: arm_bl_in_range
3150 $(TEST_OBJDUMP) -D $< > $@
3151
d3bbad62 3152arm_bl_in_range: arm_bl_in_range.o ../ld-new
52dc3f9c 3153 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
2a2b6d42
DK
3154
3155arm_bl_in_range.o: arm_bl_in_range.s
3156 $(TEST_AS) -o $@ $<
3157
3158arm_bl_out_of_range.stdout: arm_bl_out_of_range
3159 $(TEST_OBJDUMP) -S $< > $@
3160
d3bbad62 3161arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new
52dc3f9c 3162 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
2a2b6d42
DK
3163
3164arm_bl_out_of_range.o: arm_bl_out_of_range.s
3165 $(TEST_AS) -o $@ $<
3166
3167thumb_bl_in_range.stdout: thumb_bl_in_range
3168 $(TEST_OBJDUMP) -D $< > $@
3169
d3bbad62 3170thumb_bl_in_range: thumb_bl_in_range.o ../ld-new
52dc3f9c 3171 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2a2b6d42
DK
3172
3173thumb_bl_in_range.o: thumb_bl_in_range.s
3174 $(TEST_AS) -o $@ -march=armv5te $<
3175
3176thumb_bl_out_of_range.stdout: thumb_bl_out_of_range
3177 $(TEST_OBJDUMP) -D $< > $@
3178
a2c7281b 3179thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new
52dc3f9c 3180 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2a2b6d42 3181
a2c7281b 3182thumb_bl_out_of_range.o: thumb_bl_out_of_range.s
2a2b6d42
DK
3183 $(TEST_AS) -o $@ -march=armv5te $<
3184
3185thumb2_bl_in_range.stdout: thumb2_bl_in_range
3186 $(TEST_OBJDUMP) -D $< > $@
3187
d3bbad62 3188thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new
52dc3f9c 3189 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2a2b6d42
DK
3190
3191thumb2_bl_in_range.o: thumb_bl_in_range.s
3192 $(TEST_AS) -o $@ -march=armv7-a $<
3193
3194thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range
3195 $(TEST_OBJDUMP) -D $< > $@
3196
a2c7281b 3197thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new
52dc3f9c 3198 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2a2b6d42 3199
a2c7281b
DK
3200thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s
3201 $(TEST_AS) -o $@ -march=armv7-a $<
3202
3203thumb_blx_in_range.stdout: thumb_blx_in_range
3204 $(TEST_OBJDUMP) -D $< > $@
3205
3206thumb_blx_in_range: thumb_blx_in_range.o ../ld-new
52dc3f9c 3207 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
a2c7281b
DK
3208
3209thumb_blx_in_range.o: thumb_blx_in_range.s
3210 $(TEST_AS) -o $@ -march=armv5te $<
3211
3212thumb_blx_out_of_range.stdout: thumb_blx_out_of_range
3213 $(TEST_OBJDUMP) -D $< > $@
3214
3215thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new
52dc3f9c 3216 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
a2c7281b
DK
3217
3218thumb_blx_out_of_range.o: thumb_blx_out_of_range.s
3219 $(TEST_AS) -o $@ -march=armv5te $<
3220
3221thumb2_blx_in_range.stdout: thumb2_blx_in_range
3222 $(TEST_OBJDUMP) -D $< > $@
3223
3224thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new
52dc3f9c 3225 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
a2c7281b
DK
3226
3227thumb2_blx_in_range.o: thumb_blx_in_range.s
3228 $(TEST_AS) -o $@ -march=armv7-a $<
3229
3230thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range
3231 $(TEST_OBJDUMP) -D $< > $@
3232
3233thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new
52dc3f9c 3234 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
a2c7281b
DK
3235
3236thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s
2a2b6d42
DK
3237 $(TEST_AS) -o $@ -march=armv7-a $<
3238
aa98ff75
DK
3239thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local
3240 $(TEST_OBJDUMP) -D $< > $@
3241
3242thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new
52dc3f9c 3243 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
aa98ff75
DK
3244
3245thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s
3246 $(TEST_AS) -o $@ -march=armv5te $<
3247
57eb9b50
DK
3248arm_thm_jump11.stdout: arm_thm_jump11
3249 $(TEST_OBJDUMP) -D $< > $@
3250
3251arm_thm_jump11: arm_thm_jump11.o ../ld-new
52dc3f9c 3252 ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $<
57eb9b50
DK
3253
3254arm_thm_jump11.o: arm_thm_jump11.s
3255 $(TEST_AS) -o $@ $<
3256
3257arm_thm_jump8.stdout: arm_thm_jump8
3258 $(TEST_OBJDUMP) -D $< > $@
3259
3260arm_thm_jump8: arm_thm_jump8.o ../ld-new
52dc3f9c 3261 ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $<
57eb9b50
DK
3262
3263arm_thm_jump8.o: arm_thm_jump8.s
3264 $(TEST_AS) -o $@ $<
3265
2a2b6d42 3266MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \
a2c7281b
DK
3267 thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \
3268 thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \
57eb9b50
DK
3269 thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \
3270 arm_thm_jump8
2a2b6d42 3271
2fd9ae7a
DK
3272check_SCRIPTS += arm_fix_v4bx.sh
3273check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \
3274 arm_no_fix_v4bx.stdout
3275
3276arm_fix_v4bx.stdout: arm_fix_v4bx
3277 $(TEST_OBJDUMP) -D -j.text $< > $@
3278
d3bbad62 3279arm_fix_v4bx: arm_fix_v4bx.o ../ld-new
a8e2273b 3280 ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $<
2fd9ae7a
DK
3281
3282arm_fix_v4bx.o: arm_fix_v4bx.s
3283 $(TEST_AS) -o $@ $<
3284
3285arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking
3286 $(TEST_OBJDUMP) -D -j.text $< > $@
3287
d3bbad62 3288arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new
a8e2273b 3289 ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $<
2fd9ae7a
DK
3290
3291arm_no_fix_v4bx.stdout: arm_no_fix_v4bx
3292 $(TEST_OBJDUMP) -D -j.text $< > $@
3293
d3bbad62 3294arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new
a8e2273b 3295 ../ld-new --no-fix-arm1176 -o $@ $<
2fd9ae7a
DK
3296
3297MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx
3298
da59ad79
DK
3299check_SCRIPTS += arm_attr_merge.sh
3300check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
3301 arm_attr_merge_7.stdout
3302
3303arm_attr_merge_6.stdout: arm_attr_merge_6
3304 $(TEST_READELF) -A $< > $@
3305
3306arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o
3307 ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
3308
3309arm_attr_merge_6a.o: arm_attr_merge_6a.s
3310 $(TEST_AS) -o $@ $<
3311
3312arm_attr_merge_6b.o: arm_attr_merge_6b.s
3313 $(TEST_AS) -o $@ $<
3314
3315arm_attr_merge_6r.stdout: arm_attr_merge_6r
3316 $(TEST_READELF) -A $< > $@
3317
3318arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o
3319 ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
3320
3321arm_attr_merge_7.stdout: arm_attr_merge_7
3322 $(TEST_READELF) -A $< > $@
3323
3324arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o
3325 ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
3326
3327arm_attr_merge_7a.o: arm_attr_merge_7a.s
3328 $(TEST_AS) -o $@ $<
3329
3330arm_attr_merge_7b.o: arm_attr_merge_7b.s
3331 $(TEST_AS) -o $@ $<
3332
3333MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7
3334
a8e2273b
ILT
3335# ARM1176 workaround test.
3336check_SCRIPTS += arm_fix_1176.sh
3337check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \
3338 arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \
3339 arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout
3340
3341arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z
3342 $(TEST_OBJDUMP) -D -j.foo $< > $@
3343
3344arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new
3345 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3346
3347arm_fix_1176_default_v6z.o: arm_fix_1176.s
3348 $(TEST_AS) -march=armv6z -o $@ $<
3349
3350arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z
3351 $(TEST_OBJDUMP) -D -j.foo $< > $@
3352
3353arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new
3354 ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $<
3355
3356arm_fix_1176_on_v6z.o: arm_fix_1176.s
3357 $(TEST_AS) -march=armv6z -o $@ $<
3358
3359arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z
3360 $(TEST_OBJDUMP) -D -j.foo $< > $@
3361
3362arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new
3363 ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $<
3364
3365arm_fix_1176_off_v6z.o: arm_fix_1176.s
3366 $(TEST_AS) -march=armv6z -o $@ $<
3367
3368arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te
3369 $(TEST_OBJDUMP) -D -j.foo $< > $@
3370
3371arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new
3372 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3373
3374arm_fix_1176_default_v5te.o: arm_fix_1176.s
3375 $(TEST_AS) -march=armv5te -o $@ $<
3376
3377arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a
3378 $(TEST_OBJDUMP) -D -j.foo $< > $@
3379
3380arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new
3381 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3382
3383arm_fix_1176_default_v7a.o: arm_fix_1176.s
3384 $(TEST_AS) -march=armv7-a -o $@ $<
3385
3386arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s
3387 $(TEST_OBJDUMP) -D -j.foo $< > $@
3388
3389arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new
3390 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3391
3392arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s
3393 $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $<
3394
3395MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \
3396 arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s
3397
aa98ff75
DK
3398# Cortex-A8 workaround test.
3399
3400check_SCRIPTS += arm_cortex_a8.sh
3401check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \
3402 arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \
3403 arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout
3404
3405arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond
3406 $(TEST_OBJDUMP) -D -j.text $< > $@
3407
3408arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new
3409 ../ld-new -o $@ $<
3410
3411arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s
3412 $(TEST_AS) -o $@ $<
3413
3414arm_cortex_a8_b.stdout: arm_cortex_a8_b
3415 $(TEST_OBJDUMP) -D -j.text $< > $@
3416
3417arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new
3418 ../ld-new --fix-cortex-a8 -o $@ $<
3419
3420arm_cortex_a8_b.o: arm_cortex_a8_b.s
3421 $(TEST_AS) -o $@ $<
3422
3423arm_cortex_a8_bl.stdout: arm_cortex_a8_bl
3424 $(TEST_OBJDUMP) -D -j.text $< > $@
3425
3426arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new
3427 ../ld-new -o $@ $<
3428
3429arm_cortex_a8_bl.o: arm_cortex_a8_bl.s
3430 $(TEST_AS) -o $@ $<
3431
3432arm_cortex_a8_blx.stdout: arm_cortex_a8_blx
3433 $(TEST_OBJDUMP) -D -j.text $< > $@
3434
3435arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new
3436 ../ld-new -o $@ $<
3437
3438arm_cortex_a8_blx.o: arm_cortex_a8_blx.s
3439 $(TEST_AS) -o $@ $<
3440
3441arm_cortex_a8_local.stdout: arm_cortex_a8_local
3442 $(TEST_OBJDUMP) -D -j.text $< > $@
3443
3444arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new
3445 ../ld-new -o $@ $<
3446
3447arm_cortex_a8_local.o: arm_cortex_a8_local.s
3448 $(TEST_AS) -o $@ $<
3449
3450arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc
3451 $(TEST_OBJDUMP) -D -j.text $< > $@
3452
3453arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new
3454 ../ld-new -o $@ $<
3455
3456arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s
3457 $(TEST_AS) -o $@ $<
3458
3459MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \
3460 arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc
3461
c87e4302
DK
3462check_SCRIPTS += arm_exidx_test.sh
3463check_DATA += arm_exidx_test.stdout
3464
3465arm_exidx_test.stdout: arm_exidx_test.so
647f1574 3466 $(TEST_READELF) -Sr $< > $@
c87e4302
DK
3467
3468arm_exidx_test.so: arm_exidx_test.o ../ld-new
3469 ../ld-new -shared -o $@ $<
3470
3471arm_exidx_test.o: arm_exidx_test.s
3472 $(TEST_AS) -o $@ $<
3473
f62a3ca7
DK
3474check_SCRIPTS += pr12826.sh
3475check_DATA += pr12826.stdout
3476
3477pr12826.stdout: pr12826.so
3478 $(TEST_READELF) -A $< > $@
3479
3480pr12826.so: pr12826_1.o pr12826_2.o ../ld-new
3481 ../ld-new -shared -o $@ $<
3482
3483pr12826_1.o: pr12826_1.s
3484 $(TEST_AS) -o $@ $<
3485
3486pr12826_2.o: pr12826_2.s
3487 $(TEST_AS) -o $@ $<
c87e4302 3488
f6cccc2c 3489check_SCRIPTS += arm_unaligned_reloc.sh
2c339f71 3490check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout
f6cccc2c
DK
3491
3492arm_unaligned_reloc.stdout: arm_unaligned_reloc
3493 $(TEST_OBJDUMP) -D $< > $@
3494
2c339f71
DK
3495arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r
3496 $(TEST_OBJDUMP) -Dr $< > $@
3497
f6cccc2c
DK
3498arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new
3499 ../ld-new -o $@ $<
3500
2c339f71
DK
3501arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new
3502 ../ld-new -r -o $@ $<
3503
f6cccc2c
DK
3504arm_unaligned_reloc.o: arm_unaligned_reloc.s
3505 $(TEST_AS) -o $@ $<
3506
2c339f71 3507MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r
f6cccc2c 3508
cd6eab1c
ILT
3509# Check ARM to ARM farcall veneers
3510
3511check_SCRIPTS += arm_farcall_arm_arm.sh
3512check_DATA += arm_farcall_arm_arm.stdout
3513
3514arm_farcall_arm_arm.stdout: arm_farcall_arm_arm
3515 $(TEST_OBJDUMP) -d $< > $@
3516
3517arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new
a8e2273b 3518 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $<
cd6eab1c
ILT
3519
3520arm_farcall_arm_arm.o: arm_farcall_arm_arm.s
3521 $(TEST_AS) -o $@ $<
3522
3523MOSTLYCLEANFILES += arm_farcall_arm_arm
3524
3525# Check ARM to Thumb farcall veneers
3526
3527check_SCRIPTS += arm_farcall_arm_thumb.sh
3528check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout
3529
3530arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb
3531 $(TEST_OBJDUMP) -D $< > $@
3532
3533arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new
3534 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3535
3536arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s
3537 $(TEST_AS) -o $@ $<
3538
3539arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t
3540 $(TEST_OBJDUMP) -D $< > $@
3541
3542arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new
a8e2273b 3543 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
cd6eab1c
ILT
3544
3545arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s
3546 $(TEST_AS) -march=armv5t -o $@ $<
3547
3548MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t
3549
3550# Check Thumb to Thumb farcall veneers
3551
3552check_SCRIPTS += arm_farcall_thumb_thumb.sh
3553check_DATA += arm_farcall_thumb_thumb.stdout \
3554 arm_farcall_thumb_thumb_5t.stdout \
3555 arm_farcall_thumb_thumb_7m.stdout \
3556 arm_farcall_thumb_thumb_6m.stdout
3557
3558arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb
3559 $(TEST_OBJDUMP) -D $< > $@
3560
3561arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new
3562 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3563
3564arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s
3565 $(TEST_AS) -march=armv4t -o $@ $<
3566
3567arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t
3568 $(TEST_OBJDUMP) -D $< > $@
3569
3570arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new
a8e2273b 3571 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
cd6eab1c
ILT
3572
3573arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s
3574 $(TEST_AS) -march=armv5t -o $@ $<
3575
3576arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m
3577 $(TEST_OBJDUMP) -D $< > $@
3578
3579arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new
3580 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3581
3582arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s
3583 $(TEST_AS) -march=armv7-m -o $@ $<
3584
3585arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m
3586 $(TEST_OBJDUMP) -D $< > $@
3587
3588arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new
3589 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3590
3591arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s
3592 $(TEST_AS) -march=armv6-m -o $@ $<
3593
3594MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \
3595 arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m
3596
3597# Check Thumb to ARM farcall veneers
3598
3599check_SCRIPTS += arm_farcall_thumb_arm.sh
3600check_DATA += arm_farcall_thumb_arm.stdout \
3601 arm_farcall_thumb_arm_5t.stdout
3602
3603arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm
3604 $(TEST_OBJDUMP) -D $< > $@
3605
3606arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new
3607 ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
3608
3609arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s
3610 $(TEST_AS) -o $@ $<
3611
3612arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t
3613 $(TEST_OBJDUMP) -D $< > $@
3614
3615arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new
a8e2273b 3616 ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
cd6eab1c
ILT
3617
3618arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s
3619 $(TEST_AS) -march=armv5t -o $@ $<
3620
3621MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t
3622
bc99685c
DK
3623# Check handling of --target1-abs, --target1-rel and --target2 options
3624
3625check_SCRIPTS += arm_target1_abs.sh arm_target1_rel.sh \
3626 arm_target2_rel.sh arm_target2_abs.sh arm_target2_got_rel.sh
3627check_DATA += arm_target1_abs.stdout arm_target1_rel.stdout \
3628 arm_target2_rel.stdout arm_target2_abs.stdout arm_target2_got_rel.stdout
3629
3630arm_target1_abs.stdout: arm_target1_abs
3631 $(TEST_OBJDUMP) -s $< > $@
3632
3633arm_target1_abs: arm_target1.o ../ld-new
3634 ../ld-new --target1-abs --section-start .text=0x8000 -o $@ $<
3635
3636arm_target1_rel.stdout: arm_target1_rel
3637 $(TEST_OBJDUMP) -s $< > $@
3638
3639arm_target1_rel: arm_target1.o ../ld-new
3640 ../ld-new --target1-rel --section-start .text=0x8000 -o $@ $<
3641
3642arm_target1.o: arm_target1.s
3643 $(TEST_AS) -o $@ $<
3644
3645arm_target2_rel.stdout: arm_target2_rel
3646 $(TEST_OBJDUMP) -s $< > $@
3647
3648arm_target2_rel: arm_target2.o ../ld-new
3649 ../ld-new --target2=rel --section-start .text=0x8000 -o $@ $<
3650
3651arm_target2_abs.stdout: arm_target2_abs
3652 $(TEST_OBJDUMP) -s $< > $@
3653
3654arm_target2_abs: arm_target2.o ../ld-new
3655 ../ld-new --target2=abs --section-start .text=0x8000 -o $@ $<
3656
3657arm_target2_got_rel.stdout: arm_target2_got_rel
3658 $(TEST_OBJDUMP) -s $< > $@
3659
3660arm_target2_got_rel: arm_target2.o ../ld-new
3661 ../ld-new --target2=got-rel --section-start .text=0x8000 --section-start .got=0x9000 -o $@ $<
3662
3663arm_target2.o: arm_target2.s
3664 $(TEST_AS) -o $@ $<
3665
3666MOSTLYCLEANFILES += arm_target1_abs arm_target1_rel \
3667 arm_target2_rel arm_target2_abs arm_target2_got_rel
3668
e4782e83 3669endif DEFAULT_TARGET_ARM
eb373049 3670
5627d875
IK
3671if DEFAULT_TARGET_AARCH64
3672
3673check_SCRIPTS += aarch64_reloc_none.sh
3674check_DATA += aarch64_reloc_none.stdout
3675aarch64_reloc_none.o: aarch64_reloc_none.s
3676 $(TEST_AS) -o $@ $<
3677aarch64_reloc_none: aarch64_reloc_none.o ../ld-new
3678 ../ld-new -o $@ aarch64_reloc_none.o --gc-sections
3679aarch64_reloc_none.stdout: aarch64_reloc_none
3680 $(TEST_NM) $< > $@
3681
3682MOSTLYCLEANFILES += aarch64_reloc_none
3683
8769bc4b
HS
3684check_SCRIPTS += aarch64_relocs.sh
3685check_DATA += aarch64_relocs.stdout
3686aarch64_globals.o: aarch64_globals.s
3687 $(TEST_AS) -o $@ $<
3688aarch64_relocs.o: aarch64_relocs.s
3689 $(TEST_AS) -o $@ $<
3690aarch64_relocs: aarch64_relocs.o aarch64_globals.o ../ld-new
3691 ../ld-new -o $@ aarch64_relocs.o aarch64_globals.o -e0 --emit-relocs
3692aarch64_relocs.stdout: aarch64_relocs
3693 $(TEST_OBJDUMP) -dr $< > $@
3694
3695MOSTLYCLEANFILES += aarch64_relocs
3696
5627d875
IK
3697endif DEFAULT_TARGET_AARCH64
3698
2b63aca3
MK
3699if DEFAULT_TARGET_S390
3700
3701check_SCRIPTS += split_s390.sh
3702check_DATA += split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \
3703 split_s390_z4.stdout split_s390_n1.stdout split_s390_n2.stdout \
3704 split_s390_a1.stdout split_s390_a2.stdout split_s390_z1_ns.stdout \
3705 split_s390_z2_ns.stdout split_s390_z3_ns.stdout split_s390_z4_ns.stdout \
3706 split_s390_n1_ns.stdout split_s390_n2_ns.stdout split_s390_r.stdout \
3707 split_s390x_z1.stdout split_s390x_z2.stdout split_s390x_z3.stdout \
3708 split_s390x_z4.stdout split_s390x_n1.stdout split_s390x_n2.stdout \
3709 split_s390x_a1.stdout split_s390x_a2.stdout split_s390x_z1_ns.stdout \
3710 split_s390x_z2_ns.stdout split_s390x_z3_ns.stdout \
3711 split_s390x_z4_ns.stdout split_s390x_n1_ns.stdout \
3712 split_s390x_n2_ns.stdout split_s390x_r.stdout
3713SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3714split_s390_1_z1.o: split_s390_1_z1.s
3715 $(TEST_AS) -m31 -o $@ $<
3716split_s390_1_z2.o: split_s390_1_z2.s
3717 $(TEST_AS) -m31 -o $@ $<
3718split_s390_1_z3.o: split_s390_1_z3.s
3719 $(TEST_AS) -m31 -o $@ $<
3720split_s390_1_z4.o: split_s390_1_z4.s
3721 $(TEST_AS) -m31 -o $@ $<
3722split_s390_1_n1.o: split_s390_1_n1.s
3723 $(TEST_AS) -m31 -o $@ $<
3724split_s390_1_n2.o: split_s390_1_n2.s
3725 $(TEST_AS) -m31 -o $@ $<
3726split_s390_1_a1.o: split_s390_1_a1.s
3727 $(TEST_AS) -m31 -o $@ $<
3728split_s390_1_a2.o: split_s390_1_a2.s
3729 $(TEST_AS) -m31 -o $@ $<
3730split_s390_2_s.o: split_s390_2_s.s
3731 $(TEST_AS) -m31 -o $@ $<
3732split_s390_2_ns.o: split_s390_2_ns.s
3733 $(TEST_AS) -m31 -o $@ $<
3734split_s390_z1: split_s390_1_z1.o split_s390_2_s.o ../ld-new
3735 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z1.o split_s390_2_s.o
3736split_s390_z1.stdout: split_s390_z1
3737 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3738split_s390_z2: split_s390_1_z2.o split_s390_2_s.o ../ld-new
3739 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z2.o split_s390_2_s.o
3740split_s390_z2.stdout: split_s390_z2
3741 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3742split_s390_z3: split_s390_1_z3.o split_s390_2_s.o ../ld-new
3743 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z3.o split_s390_2_s.o
3744split_s390_z3.stdout: split_s390_z3
3745 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3746split_s390_z4: split_s390_1_z4.o split_s390_2_s.o ../ld-new
3747 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z4.o split_s390_2_s.o
3748split_s390_z4.stdout: split_s390_z4
3749 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3750split_s390_n1: split_s390_1_n1.o split_s390_2_s.o ../ld-new
3751 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n1.o split_s390_2_s.o
3752split_s390_n1.stdout: split_s390_n1
3753 $(TEST_OBJDUMP) -d $< > $@
3754split_s390_n2: split_s390_1_n2.o split_s390_2_s.o ../ld-new
3755 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n2.o split_s390_2_s.o
3756split_s390_n2.stdout: split_s390_n2
3757 $(TEST_OBJDUMP) -d $< > $@
3758split_s390_z1_ns: split_s390_1_z1.o split_s390_2_ns.o ../ld-new
3759 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z1.o split_s390_2_ns.o
3760split_s390_z1_ns.stdout: split_s390_z1_ns
3761 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3762split_s390_z2_ns: split_s390_1_z2.o split_s390_2_ns.o ../ld-new
3763 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z2.o split_s390_2_ns.o
3764split_s390_z2_ns.stdout: split_s390_z2_ns
3765 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3766split_s390_z3_ns: split_s390_1_z3.o split_s390_2_ns.o ../ld-new
3767 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z3.o split_s390_2_ns.o
3768split_s390_z3_ns.stdout: split_s390_z3_ns
3769 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3770split_s390_z4_ns: split_s390_1_z4.o split_s390_2_ns.o ../ld-new
3771 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z4.o split_s390_2_ns.o
3772split_s390_z4_ns.stdout: split_s390_z4_ns
3773 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3774split_s390_n1_ns: split_s390_1_n1.o split_s390_2_ns.o ../ld-new
3775 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n1.o split_s390_2_ns.o
3776split_s390_n1_ns.stdout: split_s390_n1_ns
3777 $(TEST_OBJDUMP) -d $< > $@
3778split_s390_n2_ns.stdout: split_s390_1_n2.o split_s390_2_ns.o ../ld-new
3779 ../ld-new $(SPLIT_DEFSYMS) -o split_s390_n2 split_s390_1_n2.o split_s390_2_ns.o > $@ 2>&1 || exit 0
3780split_s390_a1.stdout: split_s390_1_a1.o split_s390_2_ns.o ../ld-new
3781 ../ld-new $(SPLIT_DEFSYMS) -o split_s390_a1 split_s390_1_a1.o split_s390_2_ns.o > $@ 2>&1 || exit 0
3782split_s390_a2: split_s390_1_a2.o split_s390_2_ns.o ../ld-new
3783 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_a2.o split_s390_2_ns.o
3784split_s390_a2.stdout: split_s390_a2
3785 $(TEST_OBJDUMP) -d $< > $@
3786split_s390_r.stdout: split_s390_1_z1.o split_s390_2_ns.o ../ld-new
3787 ../ld-new -r split_s390_1_z1.o split_s390_2_ns.o -o split_s390_r > $@ 2>&1 || exit 0
3788split_s390x_1_z1.o: split_s390x_1_z1.s
3789 $(TEST_AS) -m64 -o $@ $<
3790split_s390x_1_z2.o: split_s390x_1_z2.s
3791 $(TEST_AS) -m64 -o $@ $<
3792split_s390x_1_z3.o: split_s390x_1_z3.s
3793 $(TEST_AS) -m64 -o $@ $<
3794split_s390x_1_z4.o: split_s390x_1_z4.s
3795 $(TEST_AS) -m64 -o $@ $<
3796split_s390x_1_n1.o: split_s390x_1_n1.s
3797 $(TEST_AS) -m64 -o $@ $<
3798split_s390x_1_n2.o: split_s390x_1_n2.s
3799 $(TEST_AS) -m64 -o $@ $<
3800split_s390x_1_a1.o: split_s390x_1_a1.s
3801 $(TEST_AS) -m64 -o $@ $<
3802split_s390x_1_a2.o: split_s390x_1_a2.s
3803 $(TEST_AS) -m64 -o $@ $<
3804split_s390x_2_s.o: split_s390x_2_s.s
3805 $(TEST_AS) -m64 -o $@ $<
3806split_s390x_2_ns.o: split_s390x_2_ns.s
3807 $(TEST_AS) -m64 -o $@ $<
3808split_s390x_z1: split_s390x_1_z1.o split_s390x_2_s.o ../ld-new
3809 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z1.o split_s390x_2_s.o
3810split_s390x_z1.stdout: split_s390x_z1
3811 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3812split_s390x_z2: split_s390x_1_z2.o split_s390x_2_s.o ../ld-new
3813 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z2.o split_s390x_2_s.o
3814split_s390x_z2.stdout: split_s390x_z2
3815 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3816split_s390x_z3: split_s390x_1_z3.o split_s390x_2_s.o ../ld-new
3817 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z3.o split_s390x_2_s.o
3818split_s390x_z3.stdout: split_s390x_z3
3819 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3820split_s390x_z4: split_s390x_1_z4.o split_s390x_2_s.o ../ld-new
3821 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z4.o split_s390x_2_s.o
3822split_s390x_z4.stdout: split_s390x_z4
3823 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3824split_s390x_n1: split_s390x_1_n1.o split_s390x_2_s.o ../ld-new
3825 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n1.o split_s390x_2_s.o
3826split_s390x_n1.stdout: split_s390x_n1
3827 $(TEST_OBJDUMP) -d $< > $@
3828split_s390x_n2: split_s390x_1_n2.o split_s390x_2_s.o ../ld-new
3829 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n2.o split_s390x_2_s.o
3830split_s390x_n2.stdout: split_s390x_n2
3831 $(TEST_OBJDUMP) -d $< > $@
3832split_s390x_z1_ns: split_s390x_1_z1.o split_s390x_2_ns.o ../ld-new
3833 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z1.o split_s390x_2_ns.o
3834split_s390x_z1_ns.stdout: split_s390x_z1_ns
3835 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3836split_s390x_z2_ns: split_s390x_1_z2.o split_s390x_2_ns.o ../ld-new
3837 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z2.o split_s390x_2_ns.o
3838split_s390x_z2_ns.stdout: split_s390x_z2_ns
3839 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3840split_s390x_z3_ns: split_s390x_1_z3.o split_s390x_2_ns.o ../ld-new
3841 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z3.o split_s390x_2_ns.o
3842split_s390x_z3_ns.stdout: split_s390x_z3_ns
3843 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3844split_s390x_z4_ns: split_s390x_1_z4.o split_s390x_2_ns.o ../ld-new
3845 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z4.o split_s390x_2_ns.o
3846split_s390x_z4_ns.stdout: split_s390x_z4_ns
3847 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
3848split_s390x_n1_ns: split_s390x_1_n1.o split_s390x_2_ns.o ../ld-new
3849 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n1.o split_s390x_2_ns.o
3850split_s390x_n1_ns.stdout: split_s390x_n1_ns
3851 $(TEST_OBJDUMP) -d $< > $@
3852split_s390x_n2_ns.stdout: split_s390x_1_n2.o split_s390x_2_ns.o ../ld-new
3853 ../ld-new $(SPLIT_DEFSYMS) -o split_s390x_n2 split_s390x_1_n2.o split_s390x_2_ns.o > $@ 2>&1 || exit 0
3854split_s390x_a1.stdout: split_s390x_1_a1.o split_s390x_2_ns.o ../ld-new
3855 ../ld-new $(SPLIT_DEFSYMS) -o split_s390x_a1 split_s390x_1_a1.o split_s390x_2_ns.o > $@ 2>&1 || exit 0
3856split_s390x_a2: split_s390x_1_a2.o split_s390x_2_ns.o ../ld-new
3857 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_a2.o split_s390x_2_ns.o
3858split_s390x_a2.stdout: split_s390x_a2
3859 $(TEST_OBJDUMP) -d $< > $@
3860split_s390x_r.stdout: split_s390x_1_z1.o split_s390x_2_ns.o ../ld-new
3861 ../ld-new -r split_s390x_1_z1.o split_s390x_2_ns.o -o split_s390x_r > $@ 2>&1 || exit 0
3862MOSTLYCLEANFILES += split_s390_z1 split_s390_z2 split_s390_z3 \
3863 split_s390_z4 split_s390_n1 split_s390_n2 split_s390_a1 \
3864 split_s390_a2 split_s390_z1_ns split_s390_z2_ns split_s390_z3_ns \
3865 split_s390_z4_ns split_s390_n1_ns split_s390_n2_ns split_s390_r \
3866 split_s390x_z1 split_s390x_z2 split_s390x_z3 split_s390x_z4 \
3867 split_s390x_n1 split_s390x_n2 split_s390x_a1 split_s390x_a2 \
3868 split_s390x_z1_ns split_s390x_z2_ns split_s390x_z3_ns \
3869 split_s390x_z4_ns split_s390x_n1_ns split_s390x_n2_ns split_s390x_r
3870
3871endif DEFAULT_TARGET_S390
3872
eb373049
ILT
3873endif NATIVE_OR_CROSS_LINKER
3874
35c813e2
CC
3875# Tests for the dwp tool.
3876# We don't want to rely yet on GCC support for -gsplit-dwarf,
3877# so we use (for now) test cases in x86 assembly language,
3878# compiled from the dwp_test_*.cc sources.
3879
3880if DEFAULT_TARGET_X86_64
3881
3882dwp_test_main.o: dwp_test_main.s
3883 $(TEST_AS) -o $@ $<
3884dwp_test_1.o: dwp_test_1.s
3885 $(TEST_AS) -o $@ $<
3886dwp_test_1b.o: dwp_test_1b.s
3887 $(TEST_AS) -o $@ $<
3888dwp_test_2.o: dwp_test_2.s
3889 $(TEST_AS) -o $@ $<
3890
3891dwp_test_main.dwo: dwp_test_main.o
3892 $(TEST_OBJCOPY) --extract-dwo $< $@
3893dwp_test_1.dwo: dwp_test_1.o
3894 $(TEST_OBJCOPY) --extract-dwo $< $@
3895dwp_test_1b.dwo: dwp_test_1b.o
3896 $(TEST_OBJCOPY) --extract-dwo $< $@
3897dwp_test_2.dwo: dwp_test_2.o
3898 $(TEST_OBJCOPY) --extract-dwo $< $@
3899
0ec6429b 3900MOSTLYCLEANFILES += *.dwo *.dwp
35c813e2
CC
3901check_SCRIPTS += dwp_test_1.sh
3902check_DATA += dwp_test_1.stdout
3903dwp_test_1.stdout: dwp_test_1.dwp
3904 $(TEST_READELF) -wi $< > $@
3905dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
3906 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
3907
3908check_SCRIPTS += dwp_test_2.sh
3909check_DATA += dwp_test_2.stdout
3910dwp_test_2.stdout: dwp_test_2.dwp
3911 $(TEST_READELF) -wi $< > $@
3912dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp
3913 ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp
3914dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo
3915 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo
3916dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo
3917 ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo
3918
3919endif DEFAULT_TARGET_X86_64
This page took 0.647672 seconds and 4 git commands to generate.