Update comments in compress.c
[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
eb373049 141endif NATIVE_OR_CROSS_LINKER
351a8000
ILT
142
143# ---------------------------------------------------------------------
144# These tests test the output of gold (end-to-end tests). In
145# particular, they make sure that gold can link "difficult" object
146# files, and the resulting object files run correctly. These can only
147# run if we've built ld-new for the native architecture (that is,
148# we're not cross-compiling it), since we run ld-new as part of these
149# tests. We use the gcc-specific flag '-B' to use our linker instead
150# of the default linker, which is why we only run our tests under gcc.
a360aedd 151
e2827e5f 152if NATIVE_LINKER
351a8000 153if GCC
e2827e5f 154
351a8000
ILT
155# Each of these .o's is a useful, small complete program. They're
156# particularly useful for making sure ld-new's flags do what they're
157# supposed to (hence their names), but are used for many tests that
158# don't actually involve analyzing input data.
43771f76
ILT
159flagstest_debug.o: constructor_test.cc
160 $(CXXCOMPILE) -O0 -g -c -o $@ $<
161flagstest_ndebug.o: constructor_test.cc
162 $(CXXCOMPILE) -O0 -c -o $@ $<
163
325e6408
RÁE
164check_SCRIPTS += incremental_test.sh
165check_DATA += incremental_test.stdout
0ec6429b 166MOSTLYCLEANFILES += incremental_test incremental_test.cmdline
325e6408
RÁE
167incremental_test_1.o: incremental_test_1.c
168 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
169incremental_test_2.o: incremental_test_2.c
170 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
171incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
943c8b43 172 $(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
173incremental_test.stdout: incremental_test ../incremental-dump
174 ../incremental-dump incremental_test > $@
43771f76 175
531813ad
ST
176check_SCRIPTS += gc_comdat_test.sh
177check_DATA += gc_comdat_test.stdout
72fef11a 178MOSTLYCLEANFILES += gc_comdat_test
2b64b551 179gc_comdat_test_1.o: gc_comdat_test_1.cc
4daadc0d 180 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
2b64b551 181gc_comdat_test_2.o: gc_comdat_test_2.cc
4daadc0d 182 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
531813ad 183gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
4daadc0d 184 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
531813ad
ST
185gc_comdat_test.stdout: gc_comdat_test
186 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
187
27721062
ST
188check_SCRIPTS += gc_tls_test.sh
189check_DATA += gc_tls_test.stdout
72fef11a 190MOSTLYCLEANFILES += gc_tls_test
27721062
ST
191gc_tls_test.o: gc_tls_test.cc
192 $(CXXCOMPILE) -O0 -c -g -o $@ $<
193gc_tls_test:gc_tls_test.o gcctestdir/ld
194 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
195gc_tls_test.stdout: gc_tls_test
196 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
197
f1ec9ded
ST
198check_SCRIPTS += gc_orphan_section_test.sh
199check_DATA += gc_orphan_section_test.stdout
200MOSTLYCLEANFILES += gc_orphan_section_test
201gc_orphan_section_test.o: gc_orphan_section_test.cc
202 $(CXXCOMPILE) -O0 -c -g -o $@ $<
203gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
204 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o
205gc_orphan_section_test.stdout: gc_orphan_section_test
206 $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout
207
b9b2ae8b
NC
208check_SCRIPTS += pr14265.sh
209check_DATA += pr14265.stdout
210MOSTLYCLEANFILES += pr14265
211pr14265.o: pr14265.c
212 $(COMPILE) -O0 -c -o $@ $<
2b64b551 213pr14265: pr14265.o
1496b446 214 $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,-T,$(srcdir)/pr14265.t -o $@ $<
b9b2ae8b
NC
215pr14265.stdout: pr14265
216 $(TEST_NM) --format=bsd --numeric-sort $< > $@
217
fd834e57
CC
218check_SCRIPTS += gc_dynamic_list_test.sh
219check_DATA += gc_dynamic_list_test.stdout
220MOSTLYCLEANFILES += gc_dynamic_list_test
221gc_dynamic_list_test.o: gc_dynamic_list_test.c
222 $(COMPILE) -c -ffunction-sections -o $@ $<
223gc_dynamic_list_test: gc_dynamic_list_test.o gcctestdir/ld $(srcdir)/gc_dynamic_list_test.t
224 $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,--dynamic-list,$(srcdir)/gc_dynamic_list_test.t gc_dynamic_list_test.o
225gc_dynamic_list_test.stdout: gc_dynamic_list_test
226 $(TEST_NM) gc_dynamic_list_test > $@
227
ef15dade 228check_SCRIPTS += icf_test.sh
4d9aa155
AM
229check_DATA += icf_test.map
230MOSTLYCLEANFILES += icf_test icf_test.map
2b64b551 231icf_test.o: icf_test.cc
ef15dade 232 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
54de2ea6 233icf_test: icf_test.o gcctestdir/ld
4d9aa155 234 $(CXXLINK) -o icf_test -Bgcctestdir/ -Wl,--icf=all,-Map,icf_test.map icf_test.o
54de2ea6
CC
235icf_test.map: icf_test
236 @touch icf_test.map
ef15dade 237
48c187ce
ST
238check_SCRIPTS += icf_keep_unique_test.sh
239check_DATA += icf_keep_unique_test.stdout
72fef11a 240MOSTLYCLEANFILES += icf_keep_unique_test
48c187ce
ST
241icf_keep_unique_test.o: icf_keep_unique_test.cc
242 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
243icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
032ce4e9 244 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
48c187ce 245icf_keep_unique_test.stdout: icf_keep_unique_test
4d9aa155 246 $(TEST_NM) -C $< > $@
531813ad 247
032ce4e9 248check_SCRIPTS += icf_safe_test.sh
4d9aa155
AM
249check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout icf_safe_test.map
250MOSTLYCLEANFILES += icf_safe_test icf_safe_test.map
21bb3914 251icf_safe_test.o: icf_safe_test.cc
032ce4e9 252 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
54de2ea6 253icf_safe_test: icf_safe_test.o gcctestdir/ld
4d9aa155 254 $(CXXLINK) -o icf_safe_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_test.map icf_safe_test.o
54de2ea6
CC
255icf_safe_test.map: icf_safe_test
256 @touch icf_safe_test.map
21bb3914 257icf_safe_test_1.stdout: icf_safe_test
4d9aa155 258 $(TEST_NM) $< > $@
21bb3914 259icf_safe_test_2.stdout: icf_safe_test
4d9aa155 260 $(TEST_READELF) -h $< > $@
21bb3914
ST
261
262check_SCRIPTS += icf_safe_so_test.sh
4d9aa155
AM
263check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout icf_safe_so_test.map
264MOSTLYCLEANFILES += icf_safe_so_test icf_safe_so_test.map
21bb3914
ST
265icf_safe_so_test.o: icf_safe_so_test.cc
266 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
54de2ea6 267icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
4d9aa155 268 $(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
269icf_safe_so_test.map:
270 @touch icf_safe_so_test.map
21bb3914 271icf_safe_so_test_1.stdout: icf_safe_so_test
4d9aa155 272 $(TEST_NM) $< > $@
21bb3914 273icf_safe_so_test_2.stdout: icf_safe_so_test
4d9aa155 274 $(TEST_READELF) -h $< > $@
032ce4e9 275
6e9ba2ca
ST
276check_SCRIPTS += final_layout.sh
277check_DATA += final_layout.stdout
9e9143bc 278MOSTLYCLEANFILES += final_layout final_layout_sequence.txt final_layout_script.lds
6e9ba2ca
ST
279final_layout.o: final_layout.cc
280 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
281final_layout_sequence.txt:
282 (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
9e9143bc 283final_layout_script.lds:
a39e4af6 284 (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .sbss : { *(.sbss*) } .bss : { *(.bss*) } }") > final_layout_script.lds
9e9143bc
ST
285final_layout: final_layout.o final_layout_sequence.txt final_layout_script.lds gcctestdir/ld
286 $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt -Wl,-T,final_layout_script.lds final_layout.o
6e9ba2ca 287final_layout.stdout: final_layout
864a1b56 288 $(TEST_NM) -n --synthetic final_layout > final_layout.stdout
6e9ba2ca 289
28f2a4ac 290check_SCRIPTS += text_section_grouping.sh
c6ac678d
ST
291check_DATA += text_section_grouping.stdout text_section_no_grouping.stdout
292MOSTLYCLEANFILES += text_section_grouping text_section_no_grouping
28f2a4ac
ST
293text_section_grouping.o: text_section_grouping.cc
294 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
295text_section_grouping: text_section_grouping.o gcctestdir/ld
296 $(CXXLINK) -Bgcctestdir/ text_section_grouping.o
c6ac678d
ST
297text_section_no_grouping: text_section_grouping.o gcctestdir/ld
298 $(CXXLINK) -Bgcctestdir/ -Wl,--no-text-reorder text_section_grouping.o
28f2a4ac 299text_section_grouping.stdout: text_section_grouping
c6ac678d
ST
300 $(TEST_NM) -n --synthetic text_section_grouping > text_section_grouping.stdout
301text_section_no_grouping.stdout: text_section_no_grouping
2b64b551 302 $(TEST_NM) -n --synthetic text_section_no_grouping > text_section_no_grouping.stdout
28f2a4ac 303
6934001a
CC
304check_SCRIPTS += section_sorting_name.sh
305check_DATA += section_sorting_name.stdout
306MOSTLYCLEANFILES += section_sorting_name
307section_sorting_name.o: section_sorting_name.cc
308 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
309section_sorting_name: section_sorting_name.o gcctestdir/ld
310 $(CXXLINK) -Bgcctestdir/ -Wl,--sort-section=name section_sorting_name.o
311section_sorting_name.stdout: section_sorting_name
312 $(TEST_NM) -n --synthetic section_sorting_name > section_sorting_name.stdout
313
2253bfba 314check_PROGRAMS += icf_virtual_function_folding_test
0ec6429b 315MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map
ce97fa81
ST
316icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
317 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
318icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld
319 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie
320
321check_SCRIPTS += icf_preemptible_functions_test.sh
322check_DATA += icf_preemptible_functions_test.stdout
323MOSTLYCLEANFILES += icf_preemptible_functions_test
324icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
325 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
326icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
327 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared
328icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
329 $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout
330
331check_SCRIPTS += icf_string_merge_test.sh
332check_DATA += icf_string_merge_test.stdout
333MOSTLYCLEANFILES += icf_string_merge_test
334icf_string_merge_test.o: icf_string_merge_test.cc
335 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
336icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
337 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o
338icf_string_merge_test.stdout: icf_string_merge_test
339 $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
340
41cbeecc
ST
341check_SCRIPTS += icf_sht_rel_addend_test.sh
342check_DATA += icf_sht_rel_addend_test.stdout
343MOSTLYCLEANFILES += icf_sht_rel_addend_test
344icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
345 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
346icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
347 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
348icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
349 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
350icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
351 $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
352
7fb47cc9
CC
353check_PROGRAMS += large_symbol_alignment
354large_symbol_alignment_SOURCES = large_symbol_alignment.cc
355large_symbol_alignment_DEPENDENCIES = gcctestdir/ld
356large_symbol_alignment_LDFLAGS = -Bgcctestdir/
54de2ea6 357large_symbol_alignment_LDADD =
7fb47cc9 358
e31908b6
CC
359check_SCRIPTS += merge_string_literals.sh
360check_DATA += merge_string_literals.stdout
361MOSTLYCLEANFILES += merge_string_literals
2b64b551 362merge_string_literals_1.o: merge_string_literals_1.cc
e31908b6 363 $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $<
2b64b551 364merge_string_literals_2.o: merge_string_literals_2.cc
e31908b6
CC
365 $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $<
366merge_string_literals: merge_string_literals_1.o merge_string_literals_2.o gcctestdir/ld
367 $(CXXLINK) -Bgcctestdir/ merge_string_literals_1.o merge_string_literals_2.o -O2 -shared -nostdlib
368merge_string_literals.stdout: merge_string_literals
369 $(TEST_OBJDUMP) -s -j.rodata merge_string_literals > merge_string_literals.stdout
370
351a8000 371check_PROGRAMS += basic_test
351a8000 372check_PROGRAMS += basic_pic_test
56ba9a23 373basic_test.o: basic_test.cc
22dc1b09 374 $(CXXCOMPILE) -O0 -c -o $@ $<
56ba9a23
ILT
375basic_test: basic_test.o gcctestdir/ld
376 $(CXXLINK) -Bgcctestdir/ basic_test.o
328c7c2f
ILT
377
378if HAVE_STATIC
379check_PROGRAMS += basic_static_test
56ba9a23
ILT
380basic_static_test: basic_test.o gcctestdir/ld
381 $(CXXLINK) -Bgcctestdir/ -static basic_test.o
328c7c2f 382endif
22dc1b09 383
56ba9a23 384basic_pic_test.o: basic_test.cc
22dc1b09 385 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
56ba9a23
ILT
386basic_pic_test: basic_pic_test.o gcctestdir/ld
387 $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
328c7c2f
ILT
388
389if HAVE_STATIC
390check_PROGRAMS += basic_static_pic_test
56ba9a23
ILT
391basic_static_pic_test: basic_pic_test.o gcctestdir/ld
392 $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
328c7c2f 393endif
22dc1b09 394
374ad285
ILT
395check_PROGRAMS += basic_pie_test
396basic_pie_test.o: basic_test.cc
397 $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
398basic_pie_test: basic_pie_test.o gcctestdir/ld
399 $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o
351a8000
ILT
400
401check_PROGRAMS += constructor_test
d5026652
ILT
402constructor_test_SOURCES = constructor_test.cc
403constructor_test_DEPENDENCIES = gcctestdir/ld
404constructor_test_LDFLAGS = -Bgcctestdir/
1abce4a6 405constructor_test_LDADD =
d5026652 406
328c7c2f
ILT
407if HAVE_STATIC
408check_PROGRAMS += constructor_static_test
351a8000
ILT
409constructor_static_test_SOURCES = $(constructor_test_SOURCES)
410constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
411constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
1abce4a6 412constructor_static_test_LDADD = $(constructor_test_LDADD)
328c7c2f 413endif
351a8000
ILT
414
415check_PROGRAMS += two_file_test
351a8000 416check_PROGRAMS += two_file_pic_test
3bd52c28
ILT
417two_file_test_SOURCES = \
418 two_file_test_1.cc \
03e8f2b2 419 two_file_test_1b.cc \
3bd52c28
ILT
420 two_file_test_2.cc \
421 two_file_test_main.cc \
422 two_file_test.h
423two_file_test_DEPENDENCIES = gcctestdir/ld
424two_file_test_LDFLAGS = -Bgcctestdir/
1abce4a6 425two_file_test_LDADD =
3bd52c28 426
328c7c2f
ILT
427if HAVE_STATIC
428check_PROGRAMS += two_file_static_test
351a8000
ILT
429two_file_static_test_SOURCES = $(two_file_test_SOURCES)
430two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
431two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
1abce4a6 432two_file_static_test_LDADD = $(two_file_test_LDADD)
328c7c2f 433endif
f958d5fc
ILT
434
435two_file_pic_test_SOURCES = two_file_test_main.cc
436two_file_pic_test_DEPENDENCIES = \
03e8f2b2 437 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 438two_file_pic_test_LDFLAGS = -Bgcctestdir/
03e8f2b2 439two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 440
351a8000
ILT
441
442check_PROGRAMS += two_file_shared_1_test
443check_PROGRAMS += two_file_shared_2_test
444check_PROGRAMS += two_file_shared_1_pic_2_test
445check_PROGRAMS += two_file_shared_2_pic_1_test
446check_PROGRAMS += two_file_same_shared_test
447check_PROGRAMS += two_file_separate_shared_12_test
448check_PROGRAMS += two_file_separate_shared_21_test
449two_file_test_1_pic.o: two_file_test_1.cc
450 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
451two_file_test_1b_pic.o: two_file_test_1b.cc
452 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000
ILT
453two_file_test_2_pic.o: two_file_test_2.cc
454 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
455two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
456 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
351a8000
ILT
457two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
458 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
03e8f2b2
ILT
459two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
460 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
351a8000 461
3bd52c28
ILT
462two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
463two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
464two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
465two_file_shared_1_test_LDADD = two_file_shared_1.so
466
03e8f2b2 467two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
468two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
469two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
470two_file_shared_2_test_LDADD = two_file_shared_2.so
471
386c048c
ILT
472two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
473two_file_shared_1_pic_2_test_DEPENDENCIES = \
2f2de248 474 gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o
386c048c 475two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
03e8f2b2 476two_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
477
478two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
479two_file_shared_2_pic_1_test_DEPENDENCIES = \
e051a5b5 480 gcctestdir/ld two_file_shared_1.so two_file_test_2_pic.o
386c048c
ILT
481two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
482two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
483
3bd52c28
ILT
484two_file_same_shared_test_SOURCES = two_file_test_main.cc
485two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
486two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
487two_file_same_shared_test_LDADD = two_file_shared.so
488
489two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
490two_file_separate_shared_12_test_DEPENDENCIES = \
491 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
492two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
493two_file_separate_shared_12_test_LDADD = \
494 two_file_shared_1.so two_file_shared_2.so
495
496two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
497two_file_separate_shared_21_test_DEPENDENCIES = \
498 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
499two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
500two_file_separate_shared_21_test_LDADD = \
501 two_file_shared_2.so two_file_shared_1.so
502
6a74a719
ILT
503check_PROGRAMS += two_file_relocatable_test
504two_file_relocatable_test_SOURCES = two_file_test_main.cc
505two_file_relocatable_test_DEPENDENCIES = \
506 gcctestdir/ld two_file_relocatable.o
507two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
508two_file_relocatable_test_LDADD = two_file_relocatable.o
509two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
510 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
511
374ad285
ILT
512check_PROGRAMS += two_file_pie_test
513two_file_test_1_pie.o: two_file_test_1.cc
514 $(CXXCOMPILE) -c -fpie -o $@ $<
515two_file_test_1b_pie.o: two_file_test_1b.cc
516 $(CXXCOMPILE) -c -fpie -o $@ $<
517two_file_test_2_pie.o: two_file_test_2.cc
518 $(CXXCOMPILE) -c -fpie -o $@ $<
519two_file_test_main_pie.o: two_file_test_main.cc
520 $(CXXCOMPILE) -c -fpie -o $@ $<
521two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
522 two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
523 $(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
524
a82bef93
ST
525check_PROGRAMS += pie_copyrelocs_test
526pie_copyrelocs_test_SOURCES = pie_copyrelocs_test.cc
527pie_copyrelocs_test_DEPENDENCIES = gcctestdir/ld pie_copyrelocs_shared_test.so
4759c34e 528pie_copyrelocs_test_CXXFLAGS = -fno-exceptions -fno-asynchronous-unwind-tables
a82bef93
ST
529pie_copyrelocs_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -pie
530pie_copyrelocs_test_LDADD = pie_copyrelocs_shared_test.so
531pie_copyrelocs_shared_test.o: pie_copyrelocs_shared_test.cc
532 $(CXXCOMPILE) -O2 -fpic -c -o $@ $<
533pie_copyrelocs_shared_test.so: pie_copyrelocs_shared_test.o gcctestdir/ld
534 $(CXXLINK) -Bgcctestdir/ -shared pie_copyrelocs_shared_test.o
535
031cdbed
ILT
536check_SCRIPTS += two_file_shared.sh
537check_DATA += two_file_shared.dbg
72fef11a 538MOSTLYCLEANFILES += two_file_shared.dbg
031cdbed
ILT
539two_file_shared.dbg: two_file_shared.so
540 $(TEST_READELF) -w $< >$@ 2>/dev/null
541
63402fe4
ILT
542# The nonpic tests will fail on platforms which can not put non-PIC
543# code into shared libraries, so we just don't run them in that case.
63402fe4 544if FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 545
351a8000
ILT
546check_PROGRAMS += two_file_shared_1_nonpic_test
547check_PROGRAMS += two_file_shared_2_nonpic_test
548check_PROGRAMS += two_file_same_shared_nonpic_test
549check_PROGRAMS += two_file_separate_shared_12_nonpic_test
550check_PROGRAMS += two_file_separate_shared_21_nonpic_test
03e8f2b2
ILT
551check_PROGRAMS += two_file_mixed_shared_test
552check_PROGRAMS += two_file_mixed_2_shared_test
351a8000 553two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
611062c0 554 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext
351a8000
ILT
555two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
556 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
03e8f2b2 557two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
611062c0 558 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext
03e8f2b2 559two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
611062c0 560 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext
03e8f2b2 561two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
611062c0 562 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext
351a8000 563
3bd52c28
ILT
564two_file_shared_1_nonpic_test_SOURCES = \
565 two_file_test_2.cc two_file_test_main.cc
566two_file_shared_1_nonpic_test_DEPENDENCIES = \
567 gcctestdir/ld two_file_shared_1_nonpic.so
568two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
569two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
570
571two_file_shared_2_nonpic_test_SOURCES = \
03e8f2b2 572 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
573two_file_shared_2_nonpic_test_DEPENDENCIES = \
574 gcctestdir/ld two_file_shared_2_nonpic.so
575two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
576two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
577
578two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
579two_file_same_shared_nonpic_test_DEPENDENCIES = \
580 gcctestdir/ld two_file_shared_nonpic.so
581two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
582two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
583
584two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
585two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
586 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
587two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
588two_file_separate_shared_12_nonpic_test_LDADD = \
589 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
590
591two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
592two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
593 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
594two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
595two_file_separate_shared_21_nonpic_test_LDADD = \
596 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
597
03e8f2b2
ILT
598two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
599two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
600two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
601two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
602
603two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
604two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
605two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
606two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
607
d89051bd
CC
608check_PROGRAMS += two_file_mixed_pie_test
609two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
610 two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
611 $(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
612
351a8000 613endif FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 614
6835af53
ILT
615check_PROGRAMS += two_file_strip_test
616two_file_strip_test: two_file_test
617 $(TEST_STRIP) -o two_file_strip_test two_file_test
618
619check_PROGRAMS += two_file_same_shared_strip_test
620two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
621two_file_same_shared_strip_test_DEPENDENCIES = \
622 gcctestdir/ld two_file_shared_strip.so
623two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
624two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
625two_file_shared_strip.so: two_file_shared.so
626 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
627
49bdd526
ILT
628check_PROGRAMS += common_test_1
629common_test_1_SOURCES = common_test_1.c
630common_test_1_DEPENDENCIES = gcctestdir/ld
631common_test_1_LDFLAGS = -Bgcctestdir/
1abce4a6 632common_test_1_LDADD =
351a8000 633
eda294df
ILT
634check_PROGRAMS += common_test_2
635common_test_2_SOURCES = common_test_1.c
636common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
637common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
638common_test_2_LDADD = common_test_2.so common_test_3.so
639common_test_2_pic.o: common_test_2.c
640 $(COMPILE) -c -fpic -o $@ $<
641common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld
642 $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so
643common_test_3_pic.o: common_test_3.c
644 $(COMPILE) -c -fpic -o $@ $<
645common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld
646 $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script
647
351a8000 648check_PROGRAMS += exception_test
351a8000
ILT
649check_PROGRAMS += exception_shared_1_test
650check_PROGRAMS += exception_shared_2_test
651check_PROGRAMS += exception_same_shared_test
652check_PROGRAMS += exception_separate_shared_12_test
653check_PROGRAMS += exception_separate_shared_21_test
654exception_test_1_pic.o: exception_test_1.cc
655 $(CXXCOMPILE) -c -fpic -o $@ $<
656exception_test_2_pic.o: exception_test_2.cc
657 $(CXXCOMPILE) -c -fpic -o $@ $<
658exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
659 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
660exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
661 $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
662exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
663 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
63402fe4 664
3151305a
ILT
665exception_test_SOURCES = \
666 exception_test_main.cc \
667 exception_test_1.cc \
668 exception_test_2.cc \
669 exception_test.h
670exception_test_DEPENDENCIES = gcctestdir/ld
671exception_test_LDFLAGS = -Bgcctestdir/
1abce4a6 672exception_test_LDADD =
3151305a 673
328c7c2f
ILT
674if HAVE_STATIC
675check_PROGRAMS += exception_static_test
351a8000
ILT
676exception_static_test_SOURCES = $(exception_test_SOURCES)
677exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
678exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
1abce4a6 679exception_static_test_LDADD = $(exception_test_LDADD)
328c7c2f 680endif
3151305a
ILT
681
682exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
683exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
684exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
685exception_shared_1_test_LDADD = exception_shared_1.so
686
687exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
688exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
689exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
690exception_shared_2_test_LDADD = exception_shared_2.so
691
692exception_same_shared_test_SOURCES = exception_test_main.cc
693exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
694exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
695exception_same_shared_test_LDADD = exception_shared.so
696
697exception_separate_shared_12_test_SOURCES = exception_test_main.cc
698exception_separate_shared_12_test_DEPENDENCIES = \
699 gcctestdir/ld exception_shared_1.so exception_shared_2.so
59965708
CC
700exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \
701 -Wl,--no-as-needed
3151305a
ILT
702exception_separate_shared_12_test_LDADD = \
703 exception_shared_1.so exception_shared_2.so
704
705exception_separate_shared_21_test_SOURCES = exception_test_main.cc
706exception_separate_shared_21_test_DEPENDENCIES = \
707 gcctestdir/ld exception_shared_1.so exception_shared_2.so
59965708
CC
708exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \
709 -Wl,--no-as-needed
3151305a
ILT
710exception_separate_shared_21_test_LDADD = \
711 exception_shared_2.so exception_shared_1.so
712
3151305a 713
351a8000 714check_PROGRAMS += weak_test
a360aedd 715weak_test_SOURCES = weak_test.cc
0e470e5c 716weak_test_DEPENDENCIES = gcctestdir/ld
a360aedd 717weak_test_LDFLAGS = -Bgcctestdir/
1abce4a6 718weak_test_LDADD =
a360aedd 719
86925eef 720check_PROGRAMS += weak_undef_test
72fef11a 721MOSTLYCLEANFILES += alt/weak_undef_lib.so
86925eef
CC
722weak_undef_test_SOURCES = weak_undef_test.cc
723weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
724weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
725weak_undef_test_LDADD = -L . weak_undef_lib.so
726weak_undef_file1.o: weak_undef_file1.cc
727 $(CXXCOMPILE) -c -fpic -o $@ $<
728weak_undef_file2.o: weak_undef_file2.cc
729 $(CXXCOMPILE) -c -fpic -o $@ $<
730weak_undef_lib.so: weak_undef_file1.o
731 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
732alt/weak_undef_lib.so: weak_undef_file2.o
733 test -d alt || mkdir -p alt
734 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
351a8000 735
1f25b93b
CC
736check_PROGRAMS += weak_undef_test_2
737weak_undef_test_2_SOURCES = weak_undef_test_2.cc
738weak_undef_test_2_DEPENDENCIES = gcctestdir/ld libweak_undef_2.a
739weak_undef_test_2_LDFLAGS = -Bgcctestdir/ -u weak_undef_2
740weak_undef_test_2_LDADD = -L . -lweak_undef_2
dddcc5b9 741MOSTLYCLEANFILES += libweak_undef_2.a
1f25b93b
CC
742libweak_undef_2.a: weak_undef_file3.o weak_undef_file4.o
743 $(TEST_AR) rc $@ $^
744weak_undef_file3.o: weak_undef_file3.cc
745 $(CXXCOMPILE) -c -o $@ $<
746weak_undef_file4.o: weak_undef_file4.cc
747 $(CXXCOMPILE) -c -o $@ $<
748
f3c69fca
CC
749if FN_PTRS_IN_SO_WITHOUT_PIC
750check_PROGRAMS += weak_undef_nonpic_test
72fef11a 751MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so
f3c69fca
CC
752weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
753weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
754weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
755weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
756weak_undef_file1_nonpic.o: weak_undef_file1.cc
757 $(CXXCOMPILE) -c -o $@ $<
758weak_undef_file2_nonpic.o: weak_undef_file2.cc
759 $(CXXCOMPILE) -c -o $@ $<
760weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
611062c0 761 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext
f3c69fca
CC
762alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
763 test -d alt || mkdir -p alt
611062c0 764 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext
f3c69fca
CC
765endif FN_PTRS_IN_SO_WITHOUT_PIC
766
767
99a37bfd
ILT
768check_PROGRAMS += weak_alias_test
769weak_alias_test_SOURCES = weak_alias_test_main.cc
770weak_alias_test_DEPENDENCIES = \
771 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
21131061 772 weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so
99a37bfd
ILT
773weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
774weak_alias_test_LDADD = \
775 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
21131061 776 weak_alias_test_4.so weak_alias_test_5.so
99a37bfd
ILT
777weak_alias_test_1_pic.o: weak_alias_test_1.cc
778 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 779weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
99a37bfd
ILT
780 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
781weak_alias_test_2_pic.o: weak_alias_test_2.cc
782 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 783weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
99a37bfd
ILT
784 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
785weak_alias_test_3.o: weak_alias_test_3.cc
786 $(CXXCOMPILE) -c -o $@ $<
787weak_alias_test_4_pic.o: weak_alias_test_4.cc
788 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 789weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
99a37bfd 790 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
21131061
ILT
791weak_alias_test_5_pic.o: weak_alias_test_5.cc
792 $(CXXCOMPILE) -c -fpic -o $@ $<
793weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld
794 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \
795 -Wl,--version-script,$(srcdir)/weak_alias_test.script
99a37bfd 796
de4c45bd
ILT
797check_SCRIPTS += weak_plt.sh
798check_PROGRAMS += weak_plt
799check_DATA += weak_plt_shared.so
800weak_plt_main_pic.o: weak_plt_main.cc
801 $(CXXCOMPILE) -c -fpic -o $@ $<
802weak_plt: weak_plt_main_pic.o gcctestdir/ld
803 $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
804weak_plt_shared_pic.o: weak_plt_shared.cc
805 $(CXXCOMPILE) -c -fpic -o $@ $<
806weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
807 $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
808
f34787f8
ILT
809check_PROGRAMS += copy_test
810copy_test_SOURCES = copy_test.cc
811copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
812copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
813copy_test_LDADD = copy_test_1.so copy_test_2.so
814copy_test_1_pic.o: copy_test_1.cc
815 $(CXXCOMPILE) -c -fpic -o $@ $<
816copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
817 $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
818copy_test_2_pic.o: copy_test_2.cc
819 $(CXXCOMPILE) -c -fpic -o $@ $<
820copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
821 $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
822
6eee141f
ILT
823if TLS
824
351a8000
ILT
825check_PROGRAMS += tls_test
826check_PROGRAMS += tls_pic_test
c7177d31 827check_PROGRAMS += tls_pie_test
b3705d2a 828check_PROGRAMS += tls_pie_pic_test
351a8000 829check_PROGRAMS += tls_shared_test
c03c7692 830check_PROGRAMS += tls_shared_ie_test
c2b45e22 831check_PROGRAMS += tls_shared_gd_to_ie_test
351a8000
ILT
832tls_test_pic.o: tls_test.cc
833 $(CXXCOMPILE) -c -fpic -o $@ $<
834tls_test_file2_pic.o: tls_test_file2.cc
835 $(CXXCOMPILE) -c -fpic -o $@ $<
155a0dd7
ILT
836tls_test_c_pic.o: tls_test_c.c
837 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
838tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
9c2d0ef9 839 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
c2b45e22
CC
840tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
841 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
351a8000 842
c03c7692
ILT
843tls_test_pic_ie.o: tls_test.cc
844 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
845tls_test_file2_pic_ie.o: tls_test_file2.cc
846 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
155a0dd7
ILT
847tls_test_c_pic_ie.o: tls_test_c.c
848 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
849tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
850 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
c03c7692 851
e0374858 852tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
155a0dd7 853tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
6eee141f 854tls_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
855tls_test_LDADD = tls_test_c.o -lpthread
856tls_test_c.o: tls_test_c.c
857 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
6eee141f
ILT
858
859tls_pic_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
860tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
861 tls_test_c_pic.o
6eee141f 862tls_pic_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
863tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
864 -lpthread
6eee141f 865
c7177d31
ILT
866tls_test_main_pie.o: tls_test_main.cc tls_test.h
867 $(CXXCOMPILE) -c -fpie -o $@ $<
868tls_test_pie.o: tls_test.cc tls_test.h
869 $(CXXCOMPILE) -c -fpie -o $@ $<
870tls_test_file2_pie.o: tls_test_file2.cc tls_test.h
871 $(CXXCOMPILE) -c -fpie -o $@ $<
872tls_test_c_pie.o: tls_test_c.c
873 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
874tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \
875 tls_test_c_pie.o gcctestdir/ld
876 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread
877
b3705d2a
ILT
878tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \
879 tls_test_c_pic.o gcctestdir/ld
880 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread
881
6eee141f
ILT
882tls_shared_test_SOURCES = tls_test_main.cc
883tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
884tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
885tls_shared_test_LDADD = tls_test_shared.so -lpthread
886
c03c7692
ILT
887tls_shared_ie_test_SOURCES = tls_test_main.cc
888tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
889tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
890tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
891
c2b45e22 892tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
893tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
894 tls_test_c_pic.o tls_test_shared2.so
c2b45e22 895tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
896tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
897 tls_test_shared2.so -lpthread
c2b45e22
CC
898
899if TLS_GNU2_DIALECT
900
901check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
902
903tls_test_gnu2.o: tls_test.cc
904 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
905tls_test_file2_gnu2.o: tls_test_file2.cc
906 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
155a0dd7
ILT
907tls_test_c_gnu2.o: tls_test_c.c
908 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
c2b45e22
CC
909tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
910 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
911
912tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
913tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
914 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
c2b45e22 915tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
916tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
917 tls_test_gnu2_shared2.so -lpthread
c2b45e22
CC
918
919if TLS_DESCRIPTORS
920
921check_PROGRAMS += tls_shared_gnu2_test
922
155a0dd7
ILT
923tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
924 $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
c2b45e22
CC
925
926tls_shared_gnu2_test_SOURCES = tls_test_main.cc
927tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
928tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
929tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
930
931endif TLS_DESCRIPTORS
932
933endif TLS_GNU2_DIALECT
934
328c7c2f 935if HAVE_STATIC
351a8000
ILT
936if STATIC_TLS
937check_PROGRAMS += tls_static_test
938check_PROGRAMS += tls_static_pic_test
939
940tls_static_test_SOURCES = $(tls_test_SOURCES)
941tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
942tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
943tls_static_test_LDADD = $(tls_test_LDADD)
944
945tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
946tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
947tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
948tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
949endif
328c7c2f 950endif
6eee141f
ILT
951
952if FN_PTRS_IN_SO_WITHOUT_PIC
351a8000 953check_PROGRAMS += tls_shared_nonpic_test
155a0dd7 954tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
611062c0 955 $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext
6eee141f
ILT
956
957tls_shared_nonpic_test_SOURCES = tls_test_main.cc
958tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
959tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
960tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
351a8000 961endif FN_PTRS_IN_SO_WITHOUT_PIC
6eee141f 962
351a8000 963endif TLS
6eee141f 964
1fa29f10
IT
965if DEFAULT_TARGET_X86_64
966
967check_SCRIPTS += x86_64_mov_to_lea.sh
968check_DATA += x86_64_mov_to_lea1.stdout x86_64_mov_to_lea2.stdout \
969 x86_64_mov_to_lea3.stdout x86_64_mov_to_lea4.stdout \
970 x86_64_mov_to_lea5.stdout x86_64_mov_to_lea6.stdout \
971 x86_64_mov_to_lea7.stdout x86_64_mov_to_lea8.stdout \
972 x86_64_mov_to_lea9.stdout x86_64_mov_to_lea10.stdout \
973 x86_64_mov_to_lea11.stdout x86_64_mov_to_lea12.stdout \
974 x86_64_mov_to_lea13.stdout x86_64_mov_to_lea14.stdout
975MOSTLYCLEANFILES += x86_64_mov_to_lea1 x86_64_mov_to_lea2 \
976 x86_64_mov_to_lea3 x86_64_mov_to_lea4 x86_64_mov_to_lea5 \
977 x86_64_mov_to_lea6 x86_64_mov_to_lea7 x86_64_mov_to_lea8 \
978 x86_64_mov_to_lea9 x86_64_mov_to_lea10 x86_64_mov_to_lea11 \
979 x86_64_mov_to_lea12 x86_64_mov_to_lea13 x86_64_mov_to_lea14
980
981x86_64_mov_to_lea1.o: x86_64_mov_to_lea1.s
982 $(TEST_AS) --64 -o $@ $<
983x86_64_mov_to_lea2.o: x86_64_mov_to_lea1.s
984 $(TEST_AS) --x32 -o $@ $<
985x86_64_mov_to_lea3.o: x86_64_mov_to_lea2.s
986 $(TEST_AS) --x32 -o $@ $<
987x86_64_mov_to_lea4.o: x86_64_mov_to_lea2.s
988 $(TEST_AS) --64 -o $@ $<
989x86_64_mov_to_lea5.o: x86_64_mov_to_lea3.s
990 $(TEST_AS) --x32 -o $@ $<
991x86_64_mov_to_lea6.o: x86_64_mov_to_lea3.s
992 $(TEST_AS) --64 -o $@ $<
993x86_64_mov_to_lea7.o: x86_64_mov_to_lea4.s
994 $(TEST_AS) --x32 -o $@ $<
995x86_64_mov_to_lea8.o: x86_64_mov_to_lea4.s
996 $(TEST_AS) --64 -o $@ $<
997x86_64_mov_to_lea1: x86_64_mov_to_lea1.o
998 ../ld-new -Bsymbolic -shared -melf_x86_64 -o $@ $<
999x86_64_mov_to_lea2: x86_64_mov_to_lea1.o
1000 ../ld-new -pie -melf_x86_64 -o $@ $<
1001x86_64_mov_to_lea3: x86_64_mov_to_lea1.o
1002 ../ld-new -melf_x86_64 -o $@ $<
1003x86_64_mov_to_lea4: x86_64_mov_to_lea2.o
1004 ../ld-new -Bsymbolic -shared -melf32_x86_64 -o $@ $<
1005x86_64_mov_to_lea5: x86_64_mov_to_lea2.o
1006 ../ld-new -pie -melf32_x86_64 -o $@ $<
1007x86_64_mov_to_lea6: x86_64_mov_to_lea2.o
1008 ../ld-new -melf32_x86_64 -o $@ $<
1009x86_64_mov_to_lea7: x86_64_mov_to_lea3.o
1010 ../ld-new -melf32_x86_64 -pie -o $@ $<
1011x86_64_mov_to_lea8: x86_64_mov_to_lea4.o
1012 ../ld-new -melf_x86_64 -pie -o $@ $<
1013x86_64_mov_to_lea9: x86_64_mov_to_lea5.o
1014 ../ld-new -melf32_x86_64 -o $@ $<
1015x86_64_mov_to_lea10: x86_64_mov_to_lea6.o
1016 ../ld-new -melf_x86_64 -o $@ $<
1017x86_64_mov_to_lea11: x86_64_mov_to_lea1.o
1018 ../ld-new -melf32_x86_64 -shared -o $@ $<
1019x86_64_mov_to_lea12: x86_64_mov_to_lea2.o
1020 ../ld-new -melf_x86_64 -shared -o $@ $<
1021x86_64_mov_to_lea13: x86_64_mov_to_lea7.o
1022 ../ld-new -melf32_x86_64 -shared -o $@ $<
1023x86_64_mov_to_lea14: x86_64_mov_to_lea8.o
1024 ../ld-new -melf_x86_64 -shared -o $@ $<
1025x86_64_mov_to_lea1.stdout: x86_64_mov_to_lea1
1026 $(TEST_OBJDUMP) -dw $< > $@
1027x86_64_mov_to_lea2.stdout: x86_64_mov_to_lea2
1028 $(TEST_OBJDUMP) -dw $< > $@
1029x86_64_mov_to_lea3.stdout: x86_64_mov_to_lea3
1030 $(TEST_OBJDUMP) -dw $< > $@
1031x86_64_mov_to_lea4.stdout: x86_64_mov_to_lea4
1032 $(TEST_OBJDUMP) -dw $< > $@
1033x86_64_mov_to_lea5.stdout: x86_64_mov_to_lea5
1034 $(TEST_OBJDUMP) -dw $< > $@
1035x86_64_mov_to_lea6.stdout: x86_64_mov_to_lea6
1036 $(TEST_OBJDUMP) -dw $< > $@
1037x86_64_mov_to_lea7.stdout: x86_64_mov_to_lea7
1038 $(TEST_OBJDUMP) -dw $< > $@
1039x86_64_mov_to_lea8.stdout: x86_64_mov_to_lea8
1040 $(TEST_OBJDUMP) -dw $< > $@
1041x86_64_mov_to_lea9.stdout: x86_64_mov_to_lea9
1042 $(TEST_OBJDUMP) -dw $< > $@
1043x86_64_mov_to_lea10.stdout: x86_64_mov_to_lea10
1044 $(TEST_OBJDUMP) -dw $< > $@
1045x86_64_mov_to_lea11.stdout: x86_64_mov_to_lea11
1046 $(TEST_OBJDUMP) -dw $< > $@
1047x86_64_mov_to_lea12.stdout: x86_64_mov_to_lea12
1048 $(TEST_OBJDUMP) -dw $< > $@
1049x86_64_mov_to_lea13.stdout: x86_64_mov_to_lea13
1050 $(TEST_OBJDUMP) -dw $< > $@
1051x86_64_mov_to_lea14.stdout: x86_64_mov_to_lea14
1052 $(TEST_OBJDUMP) -dw $< > $@
1053
1054endif DEFAULT_TARGET_X86_64
1055
c4fc4724
IT
1056if DEFAULT_TARGET_I386
1057
1058check_SCRIPTS += i386_mov_to_lea.sh
1059check_DATA += i386_mov_to_lea1.stdout i386_mov_to_lea2.stdout \
1060 i386_mov_to_lea3.stdout i386_mov_to_lea4.stdout \
1061 i386_mov_to_lea5.stdout i386_mov_to_lea6.stdout \
1062 i386_mov_to_lea7.stdout i386_mov_to_lea8.stdout
1063MOSTLYCLEANFILES += i386_mov_to_lea1 i386_mov_to_lea2 i386_mov_to_lea3 \
1064 i386_mov_to_lea4 i386_mov_to_lea5 i386_mov_to_lea6 \
1065 i386_mov_to_lea7 i386_mov_to_lea8
1066
1067i386_mov_to_lea1.o: i386_mov_to_lea1.s
1068 $(TEST_AS) --32 -o $@ $<
1069i386_mov_to_lea2.o: i386_mov_to_lea2.s
1070 $(TEST_AS) --32 -o $@ $<
1071i386_mov_to_lea3.o: i386_mov_to_lea3.s
1072 $(TEST_AS) --32 -o $@ $<
1073i386_mov_to_lea4.o: i386_mov_to_lea4.s
1074 $(TEST_AS) --32 -o $@ $<
1075i386_mov_to_lea5.o: i386_mov_to_lea5.s
1076 $(TEST_AS) --32 -o $@ $<
1077i386_mov_to_lea1: i386_mov_to_lea1.o
1078 ../ld-new -Bsymbolic -shared -melf_i386 -o $@ $<
1079i386_mov_to_lea2: i386_mov_to_lea1.o
1080 ../ld-new -pie -melf_i386 -o $@ $<
1081i386_mov_to_lea3: i386_mov_to_lea1.o
1082 ../ld-new -melf_i386 -o $@ $<
1083i386_mov_to_lea4: i386_mov_to_lea1.o
1084 ../ld-new -melf_i386 -shared -o $@ $<
1085i386_mov_to_lea5: i386_mov_to_lea2.o
1086 ../ld-new -melf_i386 -shared -o $@ $<
1087i386_mov_to_lea6: i386_mov_to_lea3.o
1088 ../ld-new -melf_i386 -shared -o $@ $<
1089i386_mov_to_lea7: i386_mov_to_lea4.o
1090 ../ld-new -melf_i386 -shared -o $@ $<
1091i386_mov_to_lea8: i386_mov_to_lea5.o
1092 ../ld-new -melf_i386 -shared -o $@ $<
1093i386_mov_to_lea1.stdout: i386_mov_to_lea1
1094 $(TEST_OBJDUMP) -dw $< > $@
1095i386_mov_to_lea2.stdout: i386_mov_to_lea2
1096 $(TEST_OBJDUMP) -dw $< > $@
1097i386_mov_to_lea3.stdout: i386_mov_to_lea3
1098 $(TEST_OBJDUMP) -dw $< > $@
1099i386_mov_to_lea4.stdout: i386_mov_to_lea4
1100 $(TEST_OBJDUMP) -dw $< > $@
1101i386_mov_to_lea5.stdout: i386_mov_to_lea5
1102 $(TEST_OBJDUMP) -dw $< > $@
1103i386_mov_to_lea6.stdout: i386_mov_to_lea6
1104 $(TEST_OBJDUMP) -dw $< > $@
1105i386_mov_to_lea7.stdout: i386_mov_to_lea7
1106 $(TEST_OBJDUMP) -dw $< > $@
1107i386_mov_to_lea8.stdout: i386_mov_to_lea8
1108 $(TEST_OBJDUMP) -dw $< > $@
1109
1110endif DEFAULT_TARGET_I386
1111
d491d34e
ILT
1112check_PROGRAMS += many_sections_test
1113many_sections_test_SOURCES = many_sections_test.cc
1114many_sections_test_DEPENDENCIES = gcctestdir/ld
1115many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
1abce4a6 1116many_sections_test_LDADD =
d491d34e
ILT
1117
1118BUILT_SOURCES += many_sections_define.h
72fef11a 1119MOSTLYCLEANFILES += many_sections_define.h
d491d34e
ILT
1120many_sections_define.h:
1121 (for i in `seq 1 70000`; do \
1122 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
1123 done) > $@.tmp
1124 mv -f $@.tmp $@
1125
1126BUILT_SOURCES += many_sections_check.h
72fef11a 1127MOSTLYCLEANFILES += many_sections_check.h
d491d34e 1128many_sections_check.h:
4c94d6ae 1129 (for i in `seq 1 1000 70000`; do \
d491d34e
ILT
1130 echo "assert(var_$$i == $$i);"; \
1131 done) > $@.tmp
1132 mv -f $@.tmp $@
1133
1134check_PROGRAMS += many_sections_r_test
d491d34e
ILT
1135many_sections_r_test.o: many_sections_test.o gcctestdir/ld
1136 gcctestdir/ld -r -o $@ many_sections_test.o
7bc3e21a
ILT
1137many_sections_r_test: many_sections_r_test.o gcctestdir/ld
1138 $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
6eee141f 1139
2fd32231
ILT
1140check_PROGRAMS += initpri1
1141initpri1_SOURCES = initpri1.c
1142initpri1_DEPENDENCIES = gcctestdir/ld
1143initpri1_LDFLAGS = -Bgcctestdir/
1abce4a6 1144initpri1_LDADD =
2fd32231 1145
5393d741
ILT
1146check_PROGRAMS += initpri2
1147initpri2_SOURCES = initpri2.c
1148initpri2_DEPENDENCIES = gcctestdir/ld
7b5de7ee 1149initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array
5393d741 1150initpri2_LDADD =
2fd32231 1151
487b39df
ILT
1152check_PROGRAMS += initpri3a
1153initpri3a_SOURCES = initpri3.c
1154initpri3a_DEPENDENCIES = gcctestdir/ld
1155initpri3a_LDFLAGS = -Bgcctestdir/
1156initpri3a_LDADD =
1157
7c6109da
DK
1158# This test fails on targets not using .ctors and .dtors sections (e.g. ARM
1159# EABI). Given that gcc is moving towards using .init_array in all cases,
1160# this test is commented out. A better fix would be checking whether gcc
1161# uses .ctors or .init_array sections in configure.
1162
1163# check_PROGRAMS += initpri3b
1164# initpri3b_SOURCES = initpri3.c
1165# initpri3b_DEPENDENCIES = gcctestdir/ld
1166# initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
1167# initpri3b_LDADD =
487b39df 1168
351a8000
ILT
1169# Test --detect-odr-violations
1170check_SCRIPTS += debug_msg.sh
6eee141f 1171
351a8000
ILT
1172# Create the data files that debug_msg.sh analyzes.
1173check_DATA += debug_msg.err
1174MOSTLYCLEANFILES += debug_msg.err
1175debug_msg.o: debug_msg.cc
1176 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
1177odr_violation1.o: odr_violation1.cc
1178 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
71ff8986
ILT
1179# Compile with different optimization flags to check that rearranged
1180# instructions don't cause a false positive.
351a8000 1181odr_violation2.o: odr_violation2.cc
71ff8986 1182 $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
351a8000
ILT
1183debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
1184 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
1185 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
1186 then \
1187 echo 1>&2 "Link of debug_msg should have failed"; \
1188 rm -f $@; \
1189 exit 1; \
1190 fi
1191
93acabad
CC
1192# Test error message when a vtable is undefined.
1193check_SCRIPTS += missing_key_func.sh
1194check_DATA += missing_key_func.err
1195MOSTLYCLEANFILES += missing_key_func.err
1196missing_key_func.o: missing_key_func.cc
1197 $(CXXCOMPILE) -O0 -g -c -o $@ $(srcdir)/missing_key_func.cc
1198missing_key_func.err: missing_key_func.o gcctestdir/ld
1199 @echo $(CXXLINK) -Bgcctestdir/ -o missing_key_func missing_key_func.o "2>$@"
1200 @if $(CXXLINK) -Bgcctestdir/ -o missing_key_func missing_key_func.o 2>$@; \
1201 then \
1202 echo 1>&2 "Link of missing_key_func should have failed"; \
1203 rm -f $@; \
1204 exit 1; \
1205 fi
472076e4 1206
472076e4
CC
1207# Check that --detect-odr-violations works with compressed debug sections.
1208check_DATA += debug_msg_cdebug.err
1209MOSTLYCLEANFILES += debug_msg_cdebug.err
1210debug_msg_cdebug.o: debug_msg.cc gcctestdir/as
1211 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc
1212odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as
1213 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc
1214odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as
1215 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc
1216debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld
1217 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@"
1218 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \
1219 then \
1220 echo 1>&2 "Link of debug_msg_cdebug should have failed"; \
1221 rm -f $@; \
1222 exit 1; \
1223 fi
1224
351a8000
ILT
1225# See if we can also detect problems when we're linking .so's, not .o's.
1226check_DATA += debug_msg_so.err
1227MOSTLYCLEANFILES += debug_msg_so.err
1228debug_msg.so: debug_msg.cc gcctestdir/ld
1229 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
1230odr_violation1.so: odr_violation1.cc gcctestdir/ld
1231 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
1232odr_violation2.so: odr_violation2.cc gcctestdir/ld
71ff8986 1233 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
351a8000 1234debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
3d587466
CC
1235 @echo $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
1236 @if $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
351a8000
ILT
1237 then \
1238 echo 1>&2 "Link of debug_msg_so should have failed"; \
1239 rm -f $@; \
1240 exit 1; \
1241 fi
1242
1243# We also want to make sure we do something reasonable when there's no
1244# debug info available. For the best test, we use .so's.
1245check_DATA += debug_msg_ndebug.err
1246MOSTLYCLEANFILES += debug_msg_ndebug.err
1247debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
1248 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
1249odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
1250 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
1251odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
71ff8986 1252 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
351a8000 1253debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
3d587466
CC
1254 @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>$@"
1255 @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
1256 then \
1257 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
1258 rm -f $@; \
1259 exit 1; \
1260 fi
1261
1262
1263# Similar to --detect-odr-violations: check for undefined symbols in .so's
1264check_SCRIPTS += undef_symbol.sh
1265check_DATA += undef_symbol.err
1266MOSTLYCLEANFILES += undef_symbol.err
1267undef_symbol.o: undef_symbol.cc
1268 $(CXXCOMPILE) -O0 -g -c -fPIC $<
1269undef_symbol.so: undef_symbol.o gcctestdir/ld
1270 $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
1271undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
1272 @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
1273 @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
1274 then \
1275 echo 1>&2 "Link of undef_symbol_test should have failed"; \
1276 rm -f $@; \
1277 exit 1; \
1278 fi
1279
1280
351a8000
ILT
1281# Test -o when emitting to a special file (such as something in /dev).
1282check_PROGRAMS += flagstest_o_specialfile
0e470e5c 1283flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
351a8000
ILT
1284 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
1285 chmod a+x $@
1286 test -s $@
1287
7fcd0256
ILT
1288# Test --compress-debug-sections. FIXME: check we actually compress.
1289check_PROGRAMS += flagstest_compress_debug_sections
1290flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
1291 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
1292 test -s $@
1293
1294
351a8000
ILT
1295# The specialfile output has a tricky case when we also compress debug
1296# sections, because it requires output-file resizing.
1297check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
0e470e5c
ILT
1298flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
1299 gcctestdir/ld
126f3ece 1300 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
351a8000
ILT
1301 chmod a+x $@
1302 test -s $@
1303
d12a5ea8
ILT
1304# Test -TText and -Tdata.
1305check_PROGRAMS += flagstest_o_ttext_1
1306flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld
1307 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000
1308
1309# This version won't be runnable, because there is no way to put the
1310# PT_PHDR segment at file offset 0. We just make sure that we can
1311# build it without error.
1312check_DATA += flagstest_o_ttext_2
0ec6429b 1313MOSTLYCLEANFILES += flagstest_o_ttext_2
d12a5ea8
ILT
1314flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld
1315 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010
1316
99f8faca
ILT
1317# Test symbol versioning.
1318check_PROGRAMS += ver_test
1319ver_test_SOURCES = ver_test_main.cc
1320ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
1321ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1322ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
1323ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
1324 $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
09124467 1325ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
41d0ab5f 1326 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so
09124467
ILT
1327ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
1328 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
99f8faca
ILT
1329ver_test_1.o: ver_test_1.cc
1330 $(CXXCOMPILE) -c -fpic -o $@ $<
1331ver_test_2.o: ver_test_2.cc
1332 $(CXXCOMPILE) -c -fpic -o $@ $<
1333ver_test_3.o: ver_test_3.cc
1334 $(CXXCOMPILE) -c -fpic -o $@ $<
1335ver_test_4.o: ver_test_4.cc
1336 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000 1337
0602e05a
ILT
1338check_SCRIPTS += ver_test_1.sh
1339check_DATA += ver_test_1.syms
1340ver_test_1.syms: ver_test_1.so
1341 $(TEST_READELF) -s $< >$@ 2>/dev/null
1342
be3e6201
ILT
1343check_PROGRAMS += ver_test_2
1344ver_test_2_SOURCES = ver_test_main_2.cc
1345ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
1346ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1347ver_test_2_LDADD = ver_test_4.so ver_test_2.so
1348
be3e6201
ILT
1349check_SCRIPTS += ver_test_2.sh
1350check_DATA += ver_test_2.syms
1351ver_test_2.syms: ver_test_2
6835af53 1352 $(TEST_READELF) -s $< >$@ 2>/dev/null
be3e6201 1353
686c8caf
ILT
1354check_SCRIPTS += ver_test_4.sh
1355check_DATA += ver_test_4.syms
1356ver_test_4.syms: ver_test_4.so
6835af53 1357 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f
ILT
1358
1359ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
1360 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
1361ver_test_5.o: ver_test_5.cc
1362 $(CXXCOMPILE) -c -fpic -o $@ $<
1363check_SCRIPTS += ver_test_5.sh
1364check_DATA += ver_test_5.syms
1365ver_test_5.syms: ver_test_5.so
6835af53 1366 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f 1367
18e6b24e
ILT
1368check_PROGRAMS += ver_test_6
1369ver_test_6_SOURCES = ver_test_6.c
1370ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
1371ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1372ver_test_6_LDADD = ver_test_2.so
1373
479f6503
ILT
1374ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
1375 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
1376ver_test_7.o: ver_test_7.cc
1377 $(CXXCOMPILE) -c -fpic -o $@ $<
1378check_SCRIPTS += ver_test_7.sh
1379check_DATA += ver_test_7.syms
1380ver_test_7.syms: ver_test_7.so
6835af53 1381 $(TEST_READELF) -s $< >$@ 2>/dev/null
479f6503 1382
75517b77
ILT
1383check_PROGRAMS += ver_test_8
1384ver_test_8_SOURCES = two_file_test_main.cc
1385ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
1386ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1387ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
1388ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
1389 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
1390ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
1391 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
1392
95d14cd3
ILT
1393check_PROGRAMS += ver_test_9
1394ver_test_9_SOURCES = ver_test_main.cc
1395ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
1396ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1397ver_test_9_LDADD = ver_test_9.so
1398ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
41d0ab5f 1399 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so
95d14cd3
ILT
1400ver_test_9.o: ver_test_9.cc
1401 $(CXXCOMPILE) -c -fpic -o $@ $<
1402
057ead22
ILT
1403check_SCRIPTS += ver_test_10.sh
1404check_DATA += ver_test_10.syms
1405ver_test_10.syms: ver_test_10.so
1406 $(TEST_READELF) -s $< >$@ 2>/dev/null
1407ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
1408 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
1409
9c5b8369 1410check_PROGRAMS += ver_test_11
72fef11a 1411MOSTLYCLEANFILES += ver_test_11.a
9c5b8369
ILT
1412ver_test_11_SOURCES = ver_test_main_2.cc
1413ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
1414ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1415ver_test_11_LDADD = ver_test_11.a
1416ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
1417 $(TEST_AR) rc $@ $^
1418
6d1c4efb
ILT
1419check_PROGRAMS += ver_test_12
1420ver_test_12_SOURCES = ver_test_main_2.cc
1421ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o
1422ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1423ver_test_12_LDADD = ver_test_12.o
1424ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o
1425 gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o
1426
8bdcdf2c
ILT
1427check_PROGRAMS += protected_1
1428protected_1_SOURCES = \
1429 protected_main_1.cc protected_main_2.cc protected_main_3.cc
1430protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
1431protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1432protected_1_LDADD = protected_1.so
1433
1434protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
1435 $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
1436protected_1_pic.o: protected_1.cc
1437 $(CXXCOMPILE) -c -fpic -o $@ $<
1438protected_2_pic.o: protected_2.cc
1439 $(CXXCOMPILE) -c -fpic -o $@ $<
1440protected_3_pic.o: protected_3.cc
1441 $(CXXCOMPILE) -c -fpic -o $@ $<
1442
1443check_PROGRAMS += protected_2
1444protected_2_SOURCES = protected_main_1.cc protected_3.cc
1445protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
1446protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1447protected_2_LDADD = protected_1.so
1448
837504c4
ILT
1449check_DATA += protected_3.err
1450MOSTLYCLEANFILES += protected_3.err
1451protected_4_pic.o: protected_4.cc
1452 $(CXXCOMPILE) -c -fpic -o $@ $<
1453protected_3.err: protected_4_pic.o gcctestdir/ld
1454 @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@"
1455 @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \
1456 echo 1>&2 "Link of protected_4.so should have failed"; \
1457 rm -f $@; \
1458 exit 1; \
1459 fi
1460
9f1d377b 1461check_PROGRAMS += relro_test
fc497986
CC
1462check_SCRIPTS += relro_test.sh
1463check_DATA += relro_test.stdout
9f1d377b
ILT
1464relro_test_SOURCES = relro_test_main.cc
1465relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
1466relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1467relro_test_LDADD = relro_test.so
1468relro_test.so: gcctestdir/ld relro_test_pic.o
1469 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
1470relro_test_pic.o: relro_test.cc
1471 $(CXXCOMPILE) -c -fpic -o $@ $<
fc497986
CC
1472relro_test.stdout: relro_test.so
1473 $(TEST_READELF) -SlW relro_test.so > relro_test.stdout
9f1d377b 1474
9446efde
ILT
1475check_PROGRAMS += relro_now_test
1476relro_now_test_SOURCES = relro_test_main.cc
1477relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so
1478relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now
1479relro_now_test_LDADD = relro_now_test.so
1480relro_now_test.so: gcctestdir/ld relro_test_pic.o
1481 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o
1482
5f1ab67a
ILT
1483check_PROGRAMS += relro_strip_test
1484relro_strip_test_SOURCES = relro_test_main.cc
1485relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
1486relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1487relro_strip_test_LDADD = relro_strip_test.so
1488relro_strip_test.so: relro_test.so
1489 $(TEST_STRIP) -o $@ $<
1490
2d924fd9
ILT
1491check_PROGRAMS += relro_script_test
1492relro_script_test_SOURCES = relro_test_main.cc
1493relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
1494relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1495relro_script_test_LDADD = relro_script_test.so
1496relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
1496b446 1497 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o
2d924fd9 1498
e5756efb
ILT
1499check_PROGRAMS += script_test_1
1500script_test_1_SOURCES = script_test_1.cc
1501script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
1496b446 1502script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t
1abce4a6 1503script_test_1_LDADD =
e5756efb 1504
a445fddf
ILT
1505check_PROGRAMS += script_test_2
1506script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
1507script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
1496b446 1508script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t
1abce4a6 1509script_test_2_LDADD =
a445fddf 1510
88dd47ac
ILT
1511check_PROGRAMS += justsyms
1512justsyms_SOURCES = justsyms_1.cc
1513justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
1514justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
1abce4a6 1515justsyms_LDADD =
88dd47ac
ILT
1516justsyms_2.o: justsyms_2.cc
1517 $(CXXCOMPILE) -c -o $@ $<
83bfb6b7 1518justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
52dc3f9c 1519 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
88dd47ac 1520
c3f7b0e5
CC
1521check_PROGRAMS += justsyms_exec
1522justsyms_exec_SOURCES = justsyms_exec.c
1523justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib
1524justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib
1525justsyms_exec_LDADD =
0ec6429b 1526MOSTLYCLEANFILES += justsyms_lib
c3f7b0e5
CC
1527justsyms_lib.o: justsyms_lib.c
1528 $(COMPILE) -c -o $@ $<
1529justsyms_lib: justsyms_lib.o gcctestdir/ld
1530 gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o
1531
bc644c6c 1532check_PROGRAMS += binary_test
72fef11a 1533MOSTLYCLEANFILES += binary.txt
bc644c6c
ILT
1534binary_test_SOURCES = binary_test.cc
1535binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
1536binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
1abce4a6 1537binary_test_LDADD =
bc644c6c
ILT
1538# Copy the file to the build directory to avoid worrying about the
1539# full pathname in the generated symbols.
1540binary.txt: $(srcdir)/binary.in
1541 rm -f $@
1542 $(LN_S) $< $@
1543
09124467
ILT
1544check_SCRIPTS += ver_matching_test.sh
1545check_DATA += ver_matching_test.stdout
1546MOSTLYCLEANFILES += ver_matching_test.stdout
2fbb4320
ILT
1547ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld
1548 $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map
1549ver_matching_def_pic.o: ver_matching_def.cc
1550 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
09124467 1551ver_matching_test.stdout: ver_matching_def.so
52dc3f9c 1552 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1c4f3631
ILT
1553
1554check_PROGRAMS += script_test_3
1555check_SCRIPTS += script_test_3.sh
1556check_DATA += script_test_3.stdout
1557MOSTLYCLEANFILES += script_test_3.stdout
1558script_test_3: basic_test.o gcctestdir/ld script_test_3.t
1496b446 1559 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_3.t
1c4f3631 1560script_test_3.stdout: script_test_3
2cefc357 1561 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
09124467 1562
4ebf39db
ILT
1563check_PROGRAMS += tls_phdrs_script_test
1564tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
1565tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
1496b446 1566tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t
4ebf39db
ILT
1567tls_phdrs_script_test_LDADD = $(tls_test_LDADD)
1568
e6188289
ILT
1569check_SCRIPTS += script_test_4.sh
1570check_DATA += script_test_4.stdout
72fef11a 1571MOSTLYCLEANFILES += script_test_4
e6188289 1572script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
1496b446 1573 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_4.t
e6188289
ILT
1574script_test_4.stdout: script_test_4
1575 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
1576
6c93b22c
ILT
1577check_PROGRAMS += tls_script_test
1578tls_script_test_SOURCES = $(tls_test_SOURCES)
1579tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t
1496b446 1580tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_4.t
6c93b22c
ILT
1581tls_script_test_LDADD = $(tls_test_LDADD)
1582
401a9a73
CC
1583check_SCRIPTS += script_test_5.sh
1584check_DATA += script_test_5.stdout
72fef11a 1585MOSTLYCLEANFILES += script_test_5
401a9a73 1586script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
1496b446 1587 $(CXXLINK) -Bgcctestdir/ script_test_5.o -Wl,-T,$(srcdir)/script_test_5.t
401a9a73
CC
1588script_test_5.stdout: script_test_5
1589 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
1590
3c12dcdb
DK
1591check_SCRIPTS += script_test_6.sh
1592check_DATA += script_test_6.stdout
1593MOSTLYCLEANFILES += script_test_6
1594script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t
1496b446 1595 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_6.t \
3c12dcdb
DK
1596 -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000
1597script_test_6.stdout: script_test_6
1598 $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout
1599
1600check_SCRIPTS += script_test_7.sh
1601check_DATA += script_test_7.stdout
1602MOSTLYCLEANFILES += script_test_7
1603script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1496b446 1604 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_7.t
3c12dcdb
DK
1605script_test_7.stdout: script_test_7
1606 $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout
1607
1608check_SCRIPTS += script_test_8.sh
1609check_DATA += script_test_8.stdout
1610MOSTLYCLEANFILES += script_test_8
1611script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1496b446 1612 $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_7.t \
3c12dcdb
DK
1613 -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000
1614script_test_8.stdout: script_test_8
1615 $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout
1616
d103a984
RÁE
1617check_SCRIPTS += script_test_9.sh
1618check_DATA += script_test_9.stdout
0ec6429b 1619MOSTLYCLEANFILES += script_test_9
d103a984
RÁE
1620script_test_9.o: script_test_9.cc
1621 $(CXXCOMPILE) -O0 -c -o $@ $<
1622script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
1496b446 1623 $(CXXLINK) -Bgcctestdir/ script_test_9.o -Wl,-T,$(srcdir)/script_test_9.t
d103a984
RÁE
1624script_test_9.stdout: script_test_9
1625 $(TEST_READELF) -lW script_test_9 > script_test_9.stdout
1626
502e8a84
CC
1627# Test scripts with a relocatable link.
1628# The -g option is necessary to trigger a bug where a section
1629# declared in a script file is assigned a non-zero starting address.
1630check_PROGRAMS += script_test_11
1631script_test_11: gcctestdir/ld script_test_11_r.o
1632 $(LINK) -Bgcctestdir/ script_test_11_r.o
1633script_test_11_r.o: gcctestdir/ld $(srcdir)/script_test_11.t script_test_11.o
52dc3f9c 1634 gcctestdir/ld -r -o $@ -T $(srcdir)/script_test_11.t script_test_11.o
502e8a84
CC
1635script_test_11.o: script_test_11.c
1636 $(COMPILE) -c -g -o $@ $<
d103a984 1637
c82fbeee
CS
1638# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
1639# and --dynamic-list-cpp-typeinfo
1640
1641check_SCRIPTS += dynamic_list.sh
1642check_DATA += dynamic_list.stdout
72fef11a 1643MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout
c82fbeee
CS
1644dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
1645 $(CXXLINK) -Bgcctestdir/ basic_test.o \
1646 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
1647 -Wl,--dynamic-list-data \
1648 -Wl,--dynamic-list-cpp-new \
1649 -Wl,--dynamic-list-cpp-typeinfo
1650dynamic_list.stdout: dynamic_list
94e6ee91 1651 $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout
c82fbeee 1652
fd834e57
CC
1653check_PROGRAMS += dynamic_list_2
1654dynamic_list_2_SOURCES = dynamic_list_2.cc
1655dynamic_list_2_DEPENDENCIES = gcctestdir/ld dynamic_list_lib1.so dynamic_list_lib2.so
1656dynamic_list_2_LDFLAGS = -Bgcctestdir/ -L. -Wl,-R,. -Wl,--no-as-needed
1657dynamic_list_2_LDADD = dynamic_list_lib1.so dynamic_list_lib2.so
1658
1659dynamic_list_lib1.so: gcctestdir/ld dynamic_list_lib1.o
1660 $(CXXLINK) -Bgcctestdir/ -shared dynamic_list_lib1.o
1661dynamic_list_lib1.o: dynamic_list_lib1.cc
1662 $(CXXCOMPILE) -c -fpic -o $@ $<
1663
1664dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
e9c1bdad 1665 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
fd834e57
CC
1666dynamic_list_lib2.o: dynamic_list_lib2.cc
1667 $(CXXCOMPILE) -c -fpic -o $@ $<
1668
fbd8a257 1669check_PROGRAMS += thin_archive_test_1
72fef11a
CC
1670MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
1671 alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
1672 alt/libthin2.a alt/libthin4.a
fbd8a257
CC
1673thin_archive_test_1_SOURCES = thin_archive_main.cc
1674thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
1675thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
1676thin_archive_test_1_LDADD = libthin1.a -lthin2
1677
1678check_PROGRAMS += thin_archive_test_2
1679thin_archive_test_2_SOURCES = thin_archive_main.cc
1680thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
1681thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
1682thin_archive_test_2_LDADD = -lthinall
1683
1684libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
1685 rm -f $@
1686 $(TEST_AR) crT $@ $^
1687alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
1688 rm -f $@
1689 $(TEST_AR) crT $@ $^
1690libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
1691 rm -f $@
1692 $(TEST_AR) crT $@ $^
1693alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
1694 rm -f $@
1695 $(TEST_AR) crT $@ $^
1696libthinall.a: libthin3.a alt/libthin4.a
1697 rm -f $@
1698 $(TEST_AR) crT $@ $^
1699alt/thin_archive_test_2.o: thin_archive_test_2.cc
1700 test -d alt || mkdir -p alt
1701 $(CXXCOMPILE) -c -o $@ $<
1702alt/thin_archive_test_4.o: thin_archive_test_4.cc
1703 test -d alt || mkdir -p alt
1704 $(CXXCOMPILE) -c -o $@ $<
1705
89fc3421
CC
1706if PLUGINS
1707
1708check_PROGRAMS += plugin_test_1
1709check_SCRIPTS += plugin_test_1.sh
1710check_DATA += plugin_test_1.err
1711MOSTLYCLEANFILES += plugin_test_1.err
2cfbf2fe
CC
1712plugin_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
1713 $(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
1714plugin_test_1.err: plugin_test_1
1715 @touch plugin_test_1.err
1716
1717check_PROGRAMS += plugin_test_2
1718check_SCRIPTS += plugin_test_2.sh
1719check_DATA += plugin_test_2.err
1720MOSTLYCLEANFILES += plugin_test_2.err
2cfbf2fe
CC
1721plugin_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
1722 $(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
1723plugin_test_2.err: plugin_test_2
1724 @touch plugin_test_2.err
1725
d66a9eb3
CC
1726check_PROGRAMS += plugin_test_3
1727check_SCRIPTS += plugin_test_3.sh
1728check_DATA += plugin_test_3.err
1729MOSTLYCLEANFILES += plugin_test_3.err
2cfbf2fe
CC
1730plugin_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
1731 $(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
1732plugin_test_3.err: plugin_test_3
1733 @touch plugin_test_3.err
1734
0f7c0701
CC
1735check_PROGRAMS += plugin_test_4
1736check_SCRIPTS += plugin_test_4.sh
1737check_DATA += plugin_test_4.err
72fef11a 1738MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
0f7c0701
CC
1739plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
1740 $(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
1741plugin_test_4.err: plugin_test_4
1742 @touch plugin_test_4.err
1743
2cfbf2fe 1744plugin_test_4.a: two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms
0f7c0701
CC
1745 $(TEST_AR) cr $@ $^
1746
24998053 1747check_PROGRAMS += plugin_test_5
2cfbf2fe
CC
1748plugin_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
1749 $(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 1750
be234d88
CC
1751check_PROGRAMS += plugin_test_6
1752check_SCRIPTS += plugin_test_6.sh
1753check_DATA += plugin_test_6.err
1754MOSTLYCLEANFILES += plugin_test_6.err
2cfbf2fe
CC
1755plugin_test_6: plugin_common_test_1.o.syms plugin_common_test_2.o.syms gcctestdir/ld plugin_test.so
1756 $(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
1757plugin_test_6.err: plugin_test_6
1758 @touch plugin_test_6.err
1759
5e0f337e
RÁE
1760check_PROGRAMS += plugin_test_7
1761check_SCRIPTS += plugin_test_7.sh
2cfbf2fe 1762check_DATA += plugin_test_7.err plugin_test_7.o.syms
5e0f337e 1763MOSTLYCLEANFILES += plugin_test_7.err
2cfbf2fe
CC
1764plugin_test_7: plugin_test_7_1.o plugin_test_7_1.o.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
1765 $(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
1766plugin_test_7.o.syms: plugin_test_7
5e0f337e
RÁE
1767 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1768plugin_test_7_1.o: plugin_test_7_1.c
1769 $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1770plugin_test_7_1_orig.o: plugin_test_7_1.c
1771 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2cfbf2fe 1772plugin_test_7_1.o.syms: plugin_test_7_1_orig.o
5e0f337e
RÁE
1773 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1774plugin_test_7_2.o: plugin_test_7_2.c
1775 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1776plugin_test_7.err: plugin_test_7
1777
f3a2388f
CC
1778# Test plugins with -r.
1779check_PROGRAMS += plugin_test_8
2cfbf2fe
CC
1780plugin_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
1781 ../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
1782plugin_test_8: plugin_test_8.o gcctestdir/ld
1783 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o
1784
1785# Test that symbols known in the IR file but not in the replacement file
1786# produce an unresolved symbol error.
1787check_DATA += plugin_test_9.err
1788MOSTLYCLEANFILES += plugin_test_9.err
2cfbf2fe
CC
1789plugin_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
1790 @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>$@"
1791 @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
1792 echo 1>&2 "Link of plugin_test_9 should have failed"; \
1793 rm -f $@; \
1794 exit 1; \
1795 fi
1796# Make a .syms file that claims to define the symbol _Z4t16av.
2cfbf2fe
CC
1797two_file_test_1c.o.syms: two_file_test_1.o.syms two_file_test_1c.o
1798 cp two_file_test_1.o.syms $@.tmp
1799 grep "_Z4t16av" two_file_test_1b.o.syms >> $@.tmp
f3a2388f
CC
1800 mv -f $@.tmp $@
1801# Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
1802MOSTLYCLEANFILES += two_file_test_1c.o
1803two_file_test_1c.o: two_file_test_1.o
1804 cp two_file_test_1.o $@
1805
c0c71592
RÁE
1806check_PROGRAMS += plugin_test_10
1807check_SCRIPTS += plugin_test_10.sh
1808check_DATA += plugin_test_10.sections
1809MOSTLYCLEANFILES += plugin_test_10.sections
2cfbf2fe
CC
1810plugin_test_10: plugin_common_test_1.o.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so
1811 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o
c0c71592
RÁE
1812plugin_test_10.sections: plugin_test_10
1813 $(TEST_READELF) -SW $< >$@ 2>/dev/null
1814
2cfbf2fe
CC
1815check_PROGRAMS += plugin_test_11
1816check_SCRIPTS += plugin_test_11.sh
1817check_DATA += plugin_test_11.err
dddcc5b9 1818MOSTLYCLEANFILES += plugin_test_11.err plugin_test_thin.a
2cfbf2fe
CC
1819PLUGIN_TEST_11_SYMS = two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms
1820plugin_test_11: two_file_test_main.o plugin_test_thin.a gcctestdir/ld plugin_test.so $(PLUGIN_TEST_11_SYMS)
1821 $(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
1822plugin_test_11.err: plugin_test_11
1823 @touch plugin_test_11.err
1824plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o
1825 rm -f $@
1826 $(TEST_AR) crT $@ $^
c0c71592 1827
89fc3421
CC
1828plugin_test.so: plugin_test.o
1829 $(LINK) -Bgcctestdir/ -shared plugin_test.o
1830plugin_test.o: plugin_test.c
1831 $(COMPILE) -O0 -c -fpic -o $@ $<
1832
2cfbf2fe 1833two_file_test_main.o.syms: two_file_test_main.o
89fc3421 1834 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 1835two_file_test_1.o.syms: two_file_test_1.o
89fc3421 1836 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 1837two_file_test_1b.o.syms: two_file_test_1b.o
89fc3421 1838 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 1839two_file_test_2.o.syms: two_file_test_2.o
89fc3421 1840 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 1841plugin_common_test_1.o.syms: plugin_common_test_1.o
be234d88 1842 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2cfbf2fe 1843plugin_common_test_2.o.syms: plugin_common_test_2.o
be234d88 1844 $(TEST_READELF) -sW $< >$@ 2>/dev/null
24998053 1845
2cfbf2fe 1846empty.o.syms:
24998053
CC
1847 @echo "" >$@
1848 @echo "Symbol table" >>$@
1849
32364e50
CC
1850if TLS
1851
1852check_PROGRAMS += plugin_test_tls
1853check_SCRIPTS += plugin_test_tls.sh
1854check_DATA += plugin_test_tls.err
1855MOSTLYCLEANFILES += plugin_test_tls.err
2cfbf2fe
CC
1856plugin_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
1857 $(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
1858plugin_test_tls.err: plugin_test_tls
1859 @touch plugin_test_tls.err
1860
2cfbf2fe 1861two_file_test_2_tls.o.syms: two_file_test_2_tls.o
32364e50
CC
1862 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1863
1864endif TLS
1865
24998053 1866MOSTLYCLEANFILES += unused.c
2cfbf2fe 1867unused.o.syms: unused.o
24998053
CC
1868 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1869 @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@
1870unused.o: unused.c
1871 $(COMPILE) -c -o $@ $<
1872unused.c:
1873 @cp /dev/null $@
89fc3421 1874
f0558624 1875check_SCRIPTS += plugin_final_layout.sh
16164a6b 1876check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout
0ec6429b 1877MOSTLYCLEANFILES += plugin_final_layout
f0558624
ST
1878plugin_final_layout.o: plugin_final_layout.cc
1879 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
1880plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
1881 $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
1882plugin_final_layout.stdout: plugin_final_layout
864a1b56 1883 $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout
16164a6b
ST
1884plugin_final_layout_readelf.stdout: plugin_final_layout
1885 $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout
f0558624
ST
1886
1887plugin_section_order.so: plugin_section_order.o
1888 $(LINK) -Bgcctestdir/ -shared plugin_section_order.o
1889plugin_section_order.o: plugin_section_order.c
1890 $(COMPILE) -O0 -c -fpic -o $@ $<
1891
89fc3421
CC
1892endif PLUGINS
1893
65514900
CC
1894check_PROGRAMS += exclude_libs_test
1895check_SCRIPTS += exclude_libs_test.sh
1896check_DATA += exclude_libs_test.syms
1897MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
2fdd743f 1898 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
65514900
CC
1899exclude_libs_test_SOURCES = exclude_libs_test.c
1900exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
2fdd743f
DK
1901 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1902exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
1903 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
1904 -Wl,--exclude-libs,libexclude_libs_test_3
1905exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
1906 alt/libexclude_libs_test_3.a
65514900
CC
1907exclude_libs_test.syms: exclude_libs_test
1908 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1909libexclude_libs_test_1.a: exclude_libs_test_1.o
1910 $(TEST_AR) rc $@ $^
1911libexclude_libs_test_2.a: exclude_libs_test_2.o
1912 $(TEST_AR) rc $@ $^
2fdd743f
DK
1913alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
1914 test -d alt || mkdir -p alt
1915 $(TEST_AR) rc $@ $^
65514900 1916
805bb01c
DK
1917check_PROGRAMS += local_labels_test
1918local_labels_test.o: ver_test_6.c
1919 $(COMPILE) -g -c -Wa,-L -o $@ $<
1920local_labels_test: local_labels_test.o
1921 $(LINK) -Bgcctestdir/ local_labels_test.o
1922
bb04269c
DK
1923check_PROGRAMS += discard_locals_test
1924check_SCRIPTS += discard_locals_test.sh
d3bbad62
ILT
1925check_DATA += discard_locals_test.syms \
1926 discard_locals_relocatable_test1.syms \
1927 discard_locals_relocatable_test2.syms
1928MOSTLYCLEANFILES += discard_locals_test.syms \
1929 discard_locals_relocatable_test1.syms \
1930 discard_locals_relocatable_test2.syms \
1931 discard_locals_relocatable_test1.out \
1932 discard_locals_relocatable_test2.out
bb04269c
DK
1933discard_locals_test_SOURCES = discard_locals_test.c
1934discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
1935discard_locals_test.syms: discard_locals_test
1936 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1937# '-Wa,-L' is required to preserve the local label used for testing.
1938discard_locals_test.o: discard_locals_test.c
1939 $(COMPILE) -c -Wa,-L -o $@ $<
1940
d3bbad62
ILT
1941discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out
1942 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1943discard_locals_relocatable_test.o: discard_locals_relocatable_test.c
1944 $(COMPILE) -c -Wa,-L -fPIC -o $@ $<
1945discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new
1946 ../ld-new --discard-locals -relocatable -o $@ $<
1947
1948discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out
1949 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1950discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new
1951 ../ld-new --discard-all -relocatable -o $@ $<
1952
8a5e3e08
ILT
1953if MCMODEL_MEDIUM
1954check_PROGRAMS += large
1955large_SOURCES = large.c
1956large_CFLAGS = -mcmodel=medium
1957large_DEPENDENCIES = gcctestdir/ld
1958large_LDFLAGS = -Bgcctestdir/
1abce4a6 1959large_LDADD =
8a5e3e08
ILT
1960endif MCMODEL_MEDIUM
1961
645afe0c
CC
1962# Test that hidden and internal symbols in the main program cannot be
1963# referenced by a shared library.
1964check_SCRIPTS += hidden_test.sh
1965check_DATA += hidden_test.err
1966MOSTLYCLEANFILES += hidden_test hidden_test.err
1967libhidden.so: hidden_test_1.c gcctestdir/ld
1968 $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
1969hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
1970 $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
1971hidden_test.err: hidden_test
1972 @touch hidden_test.err
1973
8c604651
CS
1974# Test -retain-symbols-file.
1975check_SCRIPTS += retain_symbols_file_test.sh
1976check_DATA += retain_symbols_file_test.stdout
1977MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
1978 retain_symbols_file_test.stdout
1979retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld
1980 echo 'main' > retain_symbols_file_test.in
1981 echo 't1' >> retain_symbols_file_test.in
1982 echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in
1983 echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
1984 echo '_Z3t18v' >> retain_symbols_file_test.in
2b64b551 1985 echo '__tcf_0' >> retain_symbols_file_test.in
8c604651
CS
1986 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
1987retain_symbols_file_test.stdout: retain_symbols_file_test.so
1988 $(TEST_NM) -C retain_symbols_file_test.so > $@
1989
1990
6a89f575
CC
1991# Test that if the output file already exists and is empty,
1992# it will get execute permission.
1993check_PROGRAMS += permission_test
1994permission_test: basic_test.o gcctestdir/ld
1995 umask 022; \
1996 rm -f $@; \
1997 touch $@; \
1998 chmod 600 $@; \
1999 $(CXXLINK) -Bgcctestdir/ basic_test.o
2000
ae3b5189
CD
2001# Check -l:foo.a
2002check_PROGRAMS += searched_file_test
2003MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
2004 alt/searched_file_test_lib.a
2005searched_file_test_SOURCES = searched_file_test.cc
2006searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
2007searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
2008searched_file_test_LDADD = -l:searched_file_test_lib.a
2009searched_file_test_lib.o: searched_file_test_lib.cc
2010 $(CXXCOMPILE) -c -o $@ $<
2011alt/searched_file_test_lib.a: searched_file_test_lib.o
2012 test -d alt || mkdir -p alt
2013 $(TEST_AR) rc $@ $^
2014
2b64b551 2015# Test that no .gnu.version sections are created when
c5617f2f
DK
2016# symbol versioning is not used.
2017check_SCRIPTS += no_version_test.sh
2018check_DATA += no_version_test.stdout
2019MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
2020# We invoke the linker directly since gcc may include additional objects that
2021# uses symbol versioning.
2022libno_version_test.so: no_version_test.o gcctestdir/ld
2023 gcctestdir/ld -shared -o $@ no_version_test.o
2024no_version_test.o: no_version_test.c
2025 $(COMPILE) -o $@ -c -fPIC $<
2026no_version_test.stdout: libno_version_test.so
2027 $(TEST_OBJDUMP) -h $< > $@
2028
7223e9ca
ILT
2029# Test STT_GNU_IFUNC symbols.
2030if IFUNC
2031
2032ifuncmod1.o: ifuncmod1.c
661d7a80 2033 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2034ifuncmod1.so: ifuncmod1.o gcctestdir/ld
2035 $(LINK) -Bgcctestdir/ -shared ifuncmod1.o
2036
2037ifuncdep1.o: ifuncmod1.c
2038 $(COMPILE) -c -o $@ $<
2039
2040ifuncmain1pic.o: ifuncmain1.c
661d7a80 2041 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca 2042ifuncmain1pie.o: ifuncmain1.c
661d7a80 2043 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca 2044
328c7c2f 2045if HAVE_STATIC
ebb300b2 2046if IFUNC_STATIC
7223e9ca
ILT
2047check_PROGRAMS += ifuncmain1static
2048ifuncmain1static_SOURCES = ifuncmain1.c
2049ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
2050ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
2051ifuncmain1static_LDADD = ifuncdep1.o
2052
2053check_PROGRAMS += ifuncmain1picstatic
2054ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
2055 $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
328c7c2f 2056endif
ebb300b2 2057endif
7223e9ca
ILT
2058
2059check_PROGRAMS += ifuncmain1
2060ifuncmain1_SOURCES = ifuncmain1.c
2061ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
2062ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2063ifuncmain1_LDADD = ifuncmod1.so
2064
2065check_PROGRAMS += ifuncmain1pic
2066ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
2067 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
2068
2069check_PROGRAMS += ifuncmain1vis
2070ifuncmain1vis_SOURCES = ifuncmain1vis.c
2071ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
2072ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2073ifuncmain1vis_LDADD = ifuncmod1.so
2074
2075check_PROGRAMS += ifuncmain1vispic
2076ifuncmain1vispic.o: ifuncmain1vis.c
661d7a80 2077 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2078ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
2079 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
2080
2081check_PROGRAMS += ifuncmain1staticpic
2082ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
2083 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
2084
2085check_PROGRAMS += ifuncmain1pie
2086ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
2087 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
2088
2089check_PROGRAMS += ifuncmain1vispie
2090ifuncmain1vispie.o: ifuncmain1vis.c
661d7a80 2091 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca
ILT
2092ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
2093 $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
2094
2095check_PROGRAMS += ifuncmain1staticpie
2096ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
2097 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
2098
2099ifuncmain2pic.o: ifuncmain2.c
661d7a80 2100 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2101
2102ifuncdep2pic.o: ifuncdep2.c
661d7a80 2103 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca 2104
328c7c2f 2105if HAVE_STATIC
ebb300b2 2106if IFUNC_STATIC
7223e9ca
ILT
2107check_PROGRAMS += ifuncmain2static
2108ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
2109ifuncmain2static_DEPENDENCIES = gcctestdir/ld
2110ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
f8e9a930 2111ifuncmain2static_LDADD =
7223e9ca
ILT
2112
2113check_PROGRAMS += ifuncmain2picstatic
2114ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
2115 $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
328c7c2f 2116endif
ebb300b2 2117endif
7223e9ca
ILT
2118
2119check_PROGRAMS += ifuncmain2
2120ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
2121ifuncmain2_DEPENDENCIES = gcctestdir/ld
2122ifuncmain2_LDFLAGS = -Bgcctestdir/
f8e9a930 2123ifuncmain2_LDADD =
7223e9ca
ILT
2124
2125check_PROGRAMS += ifuncmain2pic
2126ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
2127 $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
2128
2129ifuncmod3.o: ifuncmod3.c
661d7a80 2130 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2131ifuncmod3.so: ifuncmod3.o gcctestdir/ld
2132 $(LINK) -Bgcctestdir/ -shared ifuncmod3.o
2133
2134check_PROGRAMS += ifuncmain3
2135ifuncmain3_SOURCES = ifuncmain3.c
2136ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
2137ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
2138ifuncmain3_LDADD = -ldl
2139
2140ifuncmain4pic.o: ifuncmain4.c
661d7a80 2141 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca 2142
328c7c2f 2143if HAVE_STATIC
ebb300b2 2144if IFUNC_STATIC
7223e9ca
ILT
2145check_PROGRAMS += ifuncmain4static
2146ifuncmain4static_SOURCES = ifuncmain4.c
2147ifuncmain4static_DEPENDENCIES = gcctestdir/ld
2148ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
f8e9a930 2149ifuncmain4static_LDADD =
7223e9ca
ILT
2150
2151check_PROGRAMS += ifuncmain4picstatic
2152ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
2153 $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
328c7c2f 2154endif
ebb300b2 2155endif
7223e9ca
ILT
2156
2157check_PROGRAMS += ifuncmain4
2158ifuncmain4_SOURCES = ifuncmain4.c
2159ifuncmain4_DEPENDENCIES = gcctestdir/ld
2160ifuncmain4_LDFLAGS = -Bgcctestdir/
f8e9a930 2161ifuncmain4_LDADD =
7223e9ca
ILT
2162
2163ifuncmain5pic.o: ifuncmain5.c
661d7a80 2164 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2165
2166ifuncmain5pie.o: ifuncmain5.c
661d7a80 2167 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca
ILT
2168
2169ifuncmod5.o: ifuncmod5.c
661d7a80 2170 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2171ifuncmod5.so: ifuncmod5.o gcctestdir/ld
2172 $(LINK) -Bgcctestdir/ -shared ifuncmod5.o
2173
2174ifuncdep5.o: ifuncmod5.c
2175 $(COMPILE) -c -o $@ $<
2176
328c7c2f 2177if HAVE_STATIC
ebb300b2 2178if IFUNC_STATIC
7223e9ca
ILT
2179check_PROGRAMS += ifuncmain5static
2180ifuncmain5static_SOURCES = ifuncmain5.c
2181ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
2182ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
2183ifuncmain5static_LDADD = ifuncdep5.o
2184
2185check_PROGRAMS += ifuncmain5picstatic
2186ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
2187 $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
328c7c2f 2188endif
ebb300b2 2189endif
7223e9ca
ILT
2190
2191check_PROGRAMS += ifuncmain5
2192ifuncmain5_SOURCES = ifuncmain5.c
2193ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
2194ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2195ifuncmain5_LDADD = ifuncmod5.so
2196
2197check_PROGRAMS += ifuncmain5pic
2198ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
2199 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
2200
2201check_PROGRAMS += ifuncmain5staticpic
2202ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
2203 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
2204
2205check_PROGRAMS += ifuncmain5pie
2206ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
2207 $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
2208
2209ifuncmain6pie.o: ifuncmain6pie.c
661d7a80 2210 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca
ILT
2211
2212ifuncmod6.o: ifuncmod6.c
661d7a80 2213 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2214ifuncmod6.so: ifuncmod6.o gcctestdir/ld
2215 $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
2216
2217check_PROGRAMS += ifuncmain6pie
2218ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
2219 $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
2220
2221ifuncmain7pic.o: ifuncmain7.c
661d7a80 2222 $(COMPILE) -c -fPIC -o $@ $<
7223e9ca
ILT
2223
2224ifuncmain7pie.o: ifuncmain7.c
661d7a80 2225 $(COMPILE) -c -fPIE -o $@ $<
7223e9ca 2226
328c7c2f 2227if HAVE_STATIC
ebb300b2 2228if IFUNC_STATIC
7223e9ca
ILT
2229check_PROGRAMS += ifuncmain7static
2230ifuncmain7static_SOURCES = ifuncmain7.c
2231ifuncmain7static_DEPENDENCIES = gcctestdir/ld
2232ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
f8e9a930 2233ifuncmain7static_LDADD =
7223e9ca
ILT
2234
2235check_PROGRAMS += ifuncmain7picstatic
2236ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
2237 $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
328c7c2f 2238endif
ebb300b2 2239endif
7223e9ca
ILT
2240
2241check_PROGRAMS += ifuncmain7
2242ifuncmain7_SOURCES = ifuncmain7.c
2243ifuncmain7_DEPENDENCIES = gcctestdir/ld
2244ifuncmain7_LDFLAGS = -Bgcctestdir/
f8e9a930 2245ifuncmain7_LDADD =
7223e9ca
ILT
2246
2247check_PROGRAMS += ifuncmain7pic
2248ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
2249 $(LINK) -Bgcctestdir/ ifuncmain7pic.o
2250
2251check_PROGRAMS += ifuncmain7pie
2252ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
2253 $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
2254
67181c72
ILT
2255check_PROGRAMS += ifuncvar
2256ifuncvar1_pic.o: ifuncvar1.c
661d7a80 2257 $(COMPILE) -c -fPIC -o $@ $<
2b64b551 2258ifuncvar2_pic.o: ifuncvar2.c
661d7a80 2259 $(COMPILE) -c -fPIC -o $@ $<
67181c72
ILT
2260ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
2261 $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o
2262ifuncvar_SOURCES = ifuncvar3.c
2263ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
2264ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
2265ifuncvar_LDADD = ifuncvar.so
2266
7223e9ca
ILT
2267endif IFUNC
2268
74f67560
DK
2269# Test that strong reference to a weak symbol in a DSO remains strong.
2270check_SCRIPTS += strong_ref_weak_def.sh
2271check_DATA += strong_ref_weak_def.stdout
2272MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
2273 strong_ref_weak_def.stdout
2274strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
2275 $(COMPILE) -o $@ -c -fPIC $<
2276strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
2277 gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
2278strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
2279 $(COMPILE) -o $@ -c -fPIC $<
2280strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
2281 gcctestdir/ld
2282 gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
2283 strong_ref_weak_def_2.so
2284strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
2285 $(TEST_READELF) -sWD $< > $@
2286
a4649286
DK
2287# Test that a strong weak reference remains strong if there is another
2288# weak reference in a DSO.
2289check_SCRIPTS += dyn_weak_ref.sh
2290check_DATA += dyn_weak_ref.stdout
2291MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
2292 dyn_weak_ref.stdout
2293dyn_weak_ref_2.o: dyn_weak_ref_2.c
2294 $(COMPILE) -o $@ -c -fPIC $<
2295dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
2296 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
2297dyn_weak_ref_1.o: dyn_weak_ref_1.c
2298 $(COMPILE) -o $@ -c -fPIC $<
2299# We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
2300# so that the weak ref there goes to gold's symbol table first.
2301dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
2302 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
2303dyn_weak_ref.stdout: dyn_weak_ref_1.so
2304 $(TEST_READELF) -sWD $< > $@
2305
2306
97b4be1c
CC
2307# Test that --start-lib and --end-lib function correctly.
2308check_PROGRAMS += start_lib_test
0ec6429b 2309MOSTLYCLEANFILES += libstart_lib_test.a
97b4be1c
CC
2310start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
2311 gcctestdir/ld
2312 $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
2313 -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib
2314libstart_lib_test.a: start_lib_test_1.o
2315 $(TEST_AR) rc $@ $^
2316
7f8cd844
NC
2317# Test that MEMORY region support works.
2318check_SCRIPTS += memory_test.sh
2319check_DATA += memory_test.stdout
2320MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o
d4d91489
ILT
2321memory_test.o: memory_test.s
2322 $(COMPILE) -o $@ -c $<
2323memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t
1496b446 2324 $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o
7f8cd844 2325memory_test.stdout: memory_test
41a8542a 2326 $(TEST_READELF) -lWS $< > $@
7f8cd844 2327
410da591
CC
2328# Test INCLUDE directives in linker scripts.
2329# The binary isn't runnable, so we just check that we can build it without errors.
2330check_DATA += memory_test_2
2331MOSTLYCLEANFILES += memory_test_inc_1.t memory_test_inc_2.t memory_test_inc_3.t
2332memory_test_inc_1.t: $(srcdir)/memory_test_inc_1.t.src
2333 cp $< $@
2334memory_test_inc_2.t: $(srcdir)/memory_test_inc_2.t.src
2335 cp $< $@
2336memory_test_inc_3.t: $(srcdir)/memory_test_inc_3.t.src
2337 cp $< $@
2338memory_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
2339 $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o
2340
f1415016
CC
2341if HAVE_PUBNAMES
2342
2343# Test that --gdb-index functions correctly without gcc-generated pubnames.
c1027032
CC
2344check_SCRIPTS += gdb_index_test_1.sh
2345check_DATA += gdb_index_test_1.stdout
2346MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1
2347gdb_index_test.o: gdb_index_test.cc
f1415016 2348 $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $<
c1027032
CC
2349gdb_index_test_1: gdb_index_test.o gcctestdir/ld
2350 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2351gdb_index_test_1.stdout: gdb_index_test_1
2352 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2353
f1415016 2354# Test that --gdb-index functions correctly with compressed debug sections.
c1027032
CC
2355check_SCRIPTS += gdb_index_test_2.sh
2356check_DATA += gdb_index_test_2.stdout
2357MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2
2358gdb_index_test_cdebug.o: gdb_index_test.cc
2359 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
2360gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
2361 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2362gdb_index_test_2.stdout: gdb_index_test_2
2363 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2364
f1415016 2365# Another simple C test (DW_AT_high_pc encoding) for --gdb-index.
57923f48
MW
2366check_SCRIPTS += gdb_index_test_3.sh
2367check_DATA += gdb_index_test_3.stdout
2368MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3
2369gdb_index_test_3.o: gdb_index_test_3.c
2370 $(COMPILE) -O0 -g -c -o $@ $<
2371gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld
2372 $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $<
2373gdb_index_test_3.stdout: gdb_index_test_3
2374 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2375
f1415016
CC
2376# Test that --gdb-index functions correctly with gcc-generated pubnames.
2377check_SCRIPTS += gdb_index_test_4.sh
2378check_DATA += gdb_index_test_4.stdout
2379MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4
2380gdb_index_test_pub.o: gdb_index_test.cc
2381 $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $<
2382gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld
2383 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2384gdb_index_test_4.stdout: gdb_index_test_4
2385 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2386
2387endif HAVE_PUBNAMES
57923f48 2388
d1bddd3c
CC
2389# Test that __ehdr_start is defined correctly.
2390check_PROGRAMS += ehdr_start_test_1
2391ehdr_start_test_1_SOURCES = ehdr_start_test.cc
2392ehdr_start_test_1_DEPENDENCIES = gcctestdir/ld
2393ehdr_start_test_1_CXXFLAGS =
2394ehdr_start_test_1_LDFLAGS = -Bgcctestdir/
2395ehdr_start_test_1_LDADD =
2396
2397# Test that __ehdr_start is defined correctly with a weak reference.
2398check_PROGRAMS += ehdr_start_test_2
2399ehdr_start_test_2_SOURCES = ehdr_start_test.cc
2400ehdr_start_test_2_DEPENDENCIES = gcctestdir/ld
2401ehdr_start_test_2_CXXFLAGS = -DEHDR_START_WEAK
2402ehdr_start_test_2_LDFLAGS = -Bgcctestdir/
2403ehdr_start_test_2_LDADD =
2404
2405# Test that __ehdr_start is defined correctly when used with a linker script.
2406check_PROGRAMS += ehdr_start_test_3
2407ehdr_start_test_3_SOURCES = ehdr_start_test.cc
2408ehdr_start_test_3_DEPENDENCIES = gcctestdir/ld $(srcdir)/ehdr_start_test.t
2409ehdr_start_test_3_CXXFLAGS = -DEHDR_START_WEAK
2410ehdr_start_test_3_LDFLAGS = -Bgcctestdir/ -Wl,-T,$(srcdir)/ehdr_start_test.t
2411ehdr_start_test_3_LDADD =
2412
2413# Test that __ehdr_start is left undefined when the text segment is not
2414# appropriately aligned.
2415check_SCRIPTS += ehdr_start_test_4.sh
2416check_DATA += ehdr_start_test_4.syms
2417MOSTLYCLEANFILES += ehdr_start_test_4
2418ehdr_start_test_4.syms: ehdr_start_test_4
2419 $(TEST_NM) ehdr_start_test_4 > $@
2420ehdr_start_test_4: ehdr_start_test_4.o gcctestdir/ld
f6fb8322 2421 $(CXXLINK) -Bgcctestdir/ -Wl,-Ttext=0x100100 $<
d1bddd3c
CC
2422ehdr_start_test_4.o: ehdr_start_test.cc
2423 $(CXXCOMPILE) -c -DEHDR_START_WEAK -o $@ $<
2424
2425# Test that __ehdr_start is not overridden when supplied by the user.
2426check_PROGRAMS += ehdr_start_test_5
2427ehdr_start_test_5_SOURCES = ehdr_start_test.cc ehdr_start_def.cc
2428ehdr_start_test_5_DEPENDENCIES = gcctestdir/ld
2429ehdr_start_test_5_CXXFLAGS = -DEHDR_START_USER_DEF
2430ehdr_start_test_5_LDFLAGS = -Bgcctestdir/
2431ehdr_start_test_5_LDADD =
2432
e051745c
CC
2433# Test that the --defsym option copies the symbol type and visibility.
2434check_SCRIPTS += defsym_test.sh
2435check_DATA += defsym_test.syms
dddcc5b9 2436MOSTLYCLEANFILES += defsym_test defsym_test.syms
e051745c
CC
2437defsym_test.syms: defsym_test
2438 $(TEST_READELF) -sW $< > $@
2439defsym_test: defsym_test.o gcctestdir/ld
2440 $(LINK) -Bgcctestdir/ -Wl,--defsym=bar=foo defsym_test.o
2441defsym_test.o: defsym_test.c
2442 $(COMPILE) -c -o $@ $<
2443
2eedd706
CC
2444# End-to-end incremental linking tests.
2445# Incremental linking is currently supported only on the x86_64 target.
2446
2447if DEFAULT_TARGET_X86_64
2448
33c15b45
CC
2449two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
2450 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2451two_file_test_1_ndebug.o: two_file_test_1.cc
2452 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2453two_file_test_1b_ndebug.o: two_file_test_1b.cc
2454 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2455two_file_test_2_ndebug.o: two_file_test_2.cc
2456 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2457two_file_test_main_ndebug.o: two_file_test_main.cc
2458 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2459
2eedd706 2460check_PROGRAMS += incremental_test_2
c49875be 2461MOSTLYCLEANFILES += two_file_test_tmp_2.o
33c15b45
CC
2462incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
2463 two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
2464 cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
943c8b43 2465 $(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 2466 @sleep 1
33c15b45 2467 cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
943c8b43 2468 $(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
2469
2470check_PROGRAMS += incremental_test_3
c49875be 2471MOSTLYCLEANFILES += two_file_test_tmp_3.o
2eedd706
CC
2472incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2473 two_file_test_2.o two_file_test_main.o gcctestdir/ld
c49875be 2474 cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
943c8b43 2475 $(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 2476 @sleep 1
c49875be 2477 cp -f two_file_test_1b.o two_file_test_tmp_3.o
943c8b43 2478 $(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
2479
2480check_PROGRAMS += incremental_test_4
c49875be 2481MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
2eedd706
CC
2482incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
2483 two_file_test_2.o two_file_test_main.o gcctestdir/ld
c49875be 2484 cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
943c8b43 2485 $(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 2486 mv -f incremental_test_4 incremental_test_4.base
2eedd706 2487 @sleep 1
c49875be 2488 cp -f two_file_test_2.o two_file_test_tmp_4.o
943c8b43 2489 $(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 2490
e24719f6
CC
2491check_PROGRAMS += incremental_test_5
2492MOSTLYCLEANFILES += two_file_test_5.a
2493incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2494 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2495 cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
2496 $(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 2497 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
e24719f6
CC
2498 @sleep 1
2499 cp -f two_file_test_1b.o two_file_test_tmp_5.o
2500 $(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 2501 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
e24719f6
CC
2502
2503# Test the --incremental-unchanged flag with an archive library.
2504# The second link should not update the library.
2505check_PROGRAMS += incremental_test_6
2506MOSTLYCLEANFILES += two_file_test_6.a
2507incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2508 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2509 cp -f two_file_test_1b.o two_file_test_tmp_6.o
2510 $(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 2511 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
e24719f6
CC
2512 @sleep 1
2513 cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
2514 $(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 2515 $(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 2516
a5ee4d5d
CC
2517check_PROGRAMS += incremental_copy_test
2518incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
2519 cp -f copy_test_v1.o copy_test_tmp.o
943c8b43 2520 $(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
2521 @sleep 1
2522 cp -f copy_test.o copy_test_tmp.o
943c8b43 2523 $(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
2524
2525check_PROGRAMS += incremental_common_test_1
2526incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
2527 cp -f common_test_1_v1.o common_test_1_tmp.o
943c8b43 2528 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o
a5ee4d5d
CC
2529 @sleep 1
2530 cp -f common_test_1_v2.o common_test_1_tmp.o
943c8b43 2531 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o
a5ee4d5d 2532
1206d0d5
CC
2533check_PROGRAMS += incremental_comdat_test_1
2534incremental_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
2535 cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
943c8b43 2536 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
1206d0d5
CC
2537 @sleep 1
2538 cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
943c8b43 2539 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
1206d0d5
CC
2540 @sleep 1
2541 cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
943c8b43 2542 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
1206d0d5 2543
2eedd706
CC
2544endif DEFAULT_TARGET_X86_64
2545
f49fe902
L
2546if DEFAULT_TARGET_X86_64
2547check_PROGRAMS += exception_x86_64_bnd_test
2548exception_x86_64_bnd_test_SOURCES = exception_test_main.cc
635aa30e 2549exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
f49fe902 2550exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS)
635aa30e 2551exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
0c075858 2552exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as
f49fe902 2553 $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $<
0c075858 2554exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as
f49fe902
L
2555 $(CXXCOMPILE) -c -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $<
2556endif DEFAULT_TARGET_X86_64
2557
351a8000
ILT
2558endif GCC
2559endif NATIVE_LINKER
364c7fa5 2560
eb373049
ILT
2561# These tests work with native and cross linkers.
2562
2563if NATIVE_OR_CROSS_LINKER
2564
2565# Test script section order.
2566check_SCRIPTS += script_test_10.sh
2567check_DATA += script_test_10.stdout
0ec6429b 2568MOSTLYCLEANFILES += script_test_10
eb373049
ILT
2569script_test_10.o: script_test_10.s
2570 $(TEST_AS) -o $@ $<
2571script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
52dc3f9c 2572 gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t
eb373049
ILT
2573script_test_10.stdout: script_test_10
2574 $(TEST_READELF) -SW script_test_10 > $@
2575
2576# These tests work with cross linkers only.
364c7fa5
ILT
2577
2578if DEFAULT_TARGET_I386
2579
2580check_SCRIPTS += split_i386.sh
2581check_DATA += split_i386_1.stdout split_i386_2.stdout \
2582 split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
2583SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
2584split_i386_1.o: split_i386_1.s
2585 $(TEST_AS) -o $@ $<
2586split_i386_2.o: split_i386_2.s
2587 $(TEST_AS) -o $@ $<
2588split_i386_3.o: split_i386_3.s
2589 $(TEST_AS) -o $@ $<
2590split_i386_4.o: split_i386_4.s
2591 $(TEST_AS) -o $@ $<
2592split_i386_n.o: split_i386_n.s
2593 $(TEST_AS) -o $@ $<
2594split_i386_1: split_i386_1.o split_i386_n.o ../ld-new
2595 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o
2596split_i386_1.stdout: split_i386_1
2597 $(TEST_OBJDUMP) -d $< > $@
2598split_i386_2: split_i386_2.o split_i386_n.o ../ld-new
2599 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o
2600split_i386_2.stdout: split_i386_2
2601 $(TEST_OBJDUMP) -d $< > $@
2602split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new
2603 ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0
2604split_i386_4: split_i386_4.o split_i386_n.o ../ld-new
2605 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o
2606split_i386_4.stdout: split_i386_4
2607 $(TEST_OBJDUMP) -d $< > $@
2608split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new
2609 ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0
2610MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \
2611 split_i386_4 split_i386_r
2612
2613endif DEFAULT_TARGET_I386
2614
2615if DEFAULT_TARGET_X86_64
2616
2617check_SCRIPTS += split_x86_64.sh
2618check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \
2619 split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
2620SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
2621split_x86_64_1.o: split_x86_64_1.s
2622 $(TEST_AS) -o $@ $<
2623split_x86_64_2.o: split_x86_64_2.s
2624 $(TEST_AS) -o $@ $<
2625split_x86_64_3.o: split_x86_64_3.s
2626 $(TEST_AS) -o $@ $<
2627split_x86_64_4.o: split_x86_64_4.s
2628 $(TEST_AS) -o $@ $<
2629split_x86_64_n.o: split_x86_64_n.s
2630 $(TEST_AS) -o $@ $<
2631split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new
2632 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o
2633split_x86_64_1.stdout: split_x86_64_1
2634 $(TEST_OBJDUMP) -d $< > $@
2635split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new
2636 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o
2637split_x86_64_2.stdout: split_x86_64_2
2638 $(TEST_OBJDUMP) -d $< > $@
2639split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new
2640 ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0
2641split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new
2642 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o
2643split_x86_64_4.stdout: split_x86_64_4
2644 $(TEST_OBJDUMP) -d $< > $@
2645split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
2646 ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0
2647MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
2648 split_x86_64_4 split_x86_64_r
2649
2650endif DEFAULT_TARGET_X86_64
e4782e83 2651
4fc1b9d4
L
2652if DEFAULT_TARGET_X32
2653
2654check_SCRIPTS += split_x32.sh
2655check_DATA += split_x32_1.stdout split_x32_2.stdout \
2656 split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout
2657SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
2658split_x32_1.o: split_x32_1.s
2659 $(TEST_AS) -o $@ $<
2660split_x32_2.o: split_x32_2.s
2661 $(TEST_AS) -o $@ $<
2662split_x32_3.o: split_x32_3.s
2663 $(TEST_AS) -o $@ $<
2664split_x32_4.o: split_x32_4.s
2665 $(TEST_AS) -o $@ $<
2666split_x32_n.o: split_x32_n.s
2667 $(TEST_AS) -o $@ $<
2668split_x32_1: split_x32_1.o split_x32_n.o ../ld-new
2669 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_1.o split_x32_n.o
2670split_x32_1.stdout: split_x32_1
2671 $(TEST_OBJDUMP) -d $< > $@
2672split_x32_2: split_x32_2.o split_x32_n.o ../ld-new
2673 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_2.o split_x32_n.o
2674split_x32_2.stdout: split_x32_2
2675 $(TEST_OBJDUMP) -d $< > $@
2676split_x32_3.stdout: split_x32_3.o split_x32_n.o ../ld-new
2677 ../ld-new $(SPLIT_DEFSYMS) -o split_x32_3 split_x32_3.o split_x32_n.o > $@ 2>&1 || exit 0
2678split_x32_4: split_x32_4.o split_x32_n.o ../ld-new
2679 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_4.o split_x32_n.o
2680split_x32_4.stdout: split_x32_4
2681 $(TEST_OBJDUMP) -d $< > $@
2682split_x32_r.stdout: split_x32_1.o split_x32_n.o ../ld-new
2683 ../ld-new -r split_x32_1.o split_x32_n.o -o split_x32_r > $@ 2>&1 || exit 0
2684MOSTLYCLEANFILES += split_x32_1 split_x32_2 split_x32_3 \
2685 split_x32_4 split_x32_r
2686
2687endif DEFAULT_TARGET_X32
2688
e4782e83
DK
2689if DEFAULT_TARGET_ARM
2690
2691check_SCRIPTS += arm_abs_global.sh
2692check_DATA += arm_abs_global.stdout
2693arm_abs_lib.o: arm_abs_lib.s
2694 $(TEST_AS) -march=armv7-a -o $@ $<
d3bbad62 2695libarm_abs.so: arm_abs_lib.o ../ld-new
e4782e83
DK
2696 ../ld-new -shared -o $@ arm_abs_lib.o
2697arm_abs_global.o: arm_abs_global.s
2698 $(TEST_AS) -march=armv7-a -o $@ $<
d3bbad62 2699arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new
e4782e83
DK
2700 ../ld-new -o $@ arm_abs_global.o -L. -larm_abs
2701arm_abs_global.stdout: arm_abs_global
2702 $(TEST_READELF) -r $< > $@
2703
2704MOSTLYCLEANFILES += arm_abs_global
2705
aa98ff75 2706check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh
2a2b6d42
DK
2707check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \
2708 thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \
a2c7281b
DK
2709 thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \
2710 thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \
aa98ff75 2711 thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \
57eb9b50
DK
2712 thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \
2713 arm_thm_jump8.stdout
2a2b6d42
DK
2714
2715arm_bl_in_range.stdout: arm_bl_in_range
2716 $(TEST_OBJDUMP) -D $< > $@
2717
d3bbad62 2718arm_bl_in_range: arm_bl_in_range.o ../ld-new
52dc3f9c 2719 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
2a2b6d42
DK
2720
2721arm_bl_in_range.o: arm_bl_in_range.s
2722 $(TEST_AS) -o $@ $<
2723
2724arm_bl_out_of_range.stdout: arm_bl_out_of_range
2725 $(TEST_OBJDUMP) -S $< > $@
2726
d3bbad62 2727arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new
52dc3f9c 2728 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
2a2b6d42
DK
2729
2730arm_bl_out_of_range.o: arm_bl_out_of_range.s
2731 $(TEST_AS) -o $@ $<
2732
2733thumb_bl_in_range.stdout: thumb_bl_in_range
2734 $(TEST_OBJDUMP) -D $< > $@
2735
d3bbad62 2736thumb_bl_in_range: thumb_bl_in_range.o ../ld-new
52dc3f9c 2737 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2a2b6d42
DK
2738
2739thumb_bl_in_range.o: thumb_bl_in_range.s
2740 $(TEST_AS) -o $@ -march=armv5te $<
2741
2742thumb_bl_out_of_range.stdout: thumb_bl_out_of_range
2743 $(TEST_OBJDUMP) -D $< > $@
2744
a2c7281b 2745thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new
52dc3f9c 2746 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2a2b6d42 2747
a2c7281b 2748thumb_bl_out_of_range.o: thumb_bl_out_of_range.s
2a2b6d42
DK
2749 $(TEST_AS) -o $@ -march=armv5te $<
2750
2751thumb2_bl_in_range.stdout: thumb2_bl_in_range
2752 $(TEST_OBJDUMP) -D $< > $@
2753
d3bbad62 2754thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new
52dc3f9c 2755 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2a2b6d42
DK
2756
2757thumb2_bl_in_range.o: thumb_bl_in_range.s
2758 $(TEST_AS) -o $@ -march=armv7-a $<
2759
2760thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range
2761 $(TEST_OBJDUMP) -D $< > $@
2762
a2c7281b 2763thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new
52dc3f9c 2764 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2a2b6d42 2765
a2c7281b
DK
2766thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s
2767 $(TEST_AS) -o $@ -march=armv7-a $<
2768
2769thumb_blx_in_range.stdout: thumb_blx_in_range
2770 $(TEST_OBJDUMP) -D $< > $@
2771
2772thumb_blx_in_range: thumb_blx_in_range.o ../ld-new
52dc3f9c 2773 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
a2c7281b
DK
2774
2775thumb_blx_in_range.o: thumb_blx_in_range.s
2776 $(TEST_AS) -o $@ -march=armv5te $<
2777
2778thumb_blx_out_of_range.stdout: thumb_blx_out_of_range
2779 $(TEST_OBJDUMP) -D $< > $@
2780
2781thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new
52dc3f9c 2782 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
a2c7281b
DK
2783
2784thumb_blx_out_of_range.o: thumb_blx_out_of_range.s
2785 $(TEST_AS) -o $@ -march=armv5te $<
2786
2787thumb2_blx_in_range.stdout: thumb2_blx_in_range
2788 $(TEST_OBJDUMP) -D $< > $@
2789
2790thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new
52dc3f9c 2791 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
a2c7281b
DK
2792
2793thumb2_blx_in_range.o: thumb_blx_in_range.s
2794 $(TEST_AS) -o $@ -march=armv7-a $<
2795
2796thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range
2797 $(TEST_OBJDUMP) -D $< > $@
2798
2799thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new
52dc3f9c 2800 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
a2c7281b
DK
2801
2802thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s
2a2b6d42
DK
2803 $(TEST_AS) -o $@ -march=armv7-a $<
2804
aa98ff75
DK
2805thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local
2806 $(TEST_OBJDUMP) -D $< > $@
2807
2808thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new
52dc3f9c 2809 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
aa98ff75
DK
2810
2811thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s
2812 $(TEST_AS) -o $@ -march=armv5te $<
2813
57eb9b50
DK
2814arm_thm_jump11.stdout: arm_thm_jump11
2815 $(TEST_OBJDUMP) -D $< > $@
2816
2817arm_thm_jump11: arm_thm_jump11.o ../ld-new
52dc3f9c 2818 ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $<
57eb9b50
DK
2819
2820arm_thm_jump11.o: arm_thm_jump11.s
2821 $(TEST_AS) -o $@ $<
2822
2823arm_thm_jump8.stdout: arm_thm_jump8
2824 $(TEST_OBJDUMP) -D $< > $@
2825
2826arm_thm_jump8: arm_thm_jump8.o ../ld-new
52dc3f9c 2827 ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $<
57eb9b50
DK
2828
2829arm_thm_jump8.o: arm_thm_jump8.s
2830 $(TEST_AS) -o $@ $<
2831
2a2b6d42 2832MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \
a2c7281b
DK
2833 thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \
2834 thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \
57eb9b50
DK
2835 thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \
2836 arm_thm_jump8
2a2b6d42 2837
2fd9ae7a
DK
2838check_SCRIPTS += arm_fix_v4bx.sh
2839check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \
2840 arm_no_fix_v4bx.stdout
2841
2842arm_fix_v4bx.stdout: arm_fix_v4bx
2843 $(TEST_OBJDUMP) -D -j.text $< > $@
2844
d3bbad62 2845arm_fix_v4bx: arm_fix_v4bx.o ../ld-new
a8e2273b 2846 ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $<
2fd9ae7a
DK
2847
2848arm_fix_v4bx.o: arm_fix_v4bx.s
2849 $(TEST_AS) -o $@ $<
2850
2851arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking
2852 $(TEST_OBJDUMP) -D -j.text $< > $@
2853
d3bbad62 2854arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new
a8e2273b 2855 ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $<
2fd9ae7a
DK
2856
2857arm_no_fix_v4bx.stdout: arm_no_fix_v4bx
2858 $(TEST_OBJDUMP) -D -j.text $< > $@
2859
d3bbad62 2860arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new
a8e2273b 2861 ../ld-new --no-fix-arm1176 -o $@ $<
2fd9ae7a
DK
2862
2863MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx
2864
da59ad79
DK
2865check_SCRIPTS += arm_attr_merge.sh
2866check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
2867 arm_attr_merge_7.stdout
2868
2869arm_attr_merge_6.stdout: arm_attr_merge_6
2870 $(TEST_READELF) -A $< > $@
2871
2872arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o
2873 ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
2874
2875arm_attr_merge_6a.o: arm_attr_merge_6a.s
2876 $(TEST_AS) -o $@ $<
2877
2878arm_attr_merge_6b.o: arm_attr_merge_6b.s
2879 $(TEST_AS) -o $@ $<
2880
2881arm_attr_merge_6r.stdout: arm_attr_merge_6r
2882 $(TEST_READELF) -A $< > $@
2883
2884arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o
2885 ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
2886
2887arm_attr_merge_7.stdout: arm_attr_merge_7
2888 $(TEST_READELF) -A $< > $@
2889
2890arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o
2891 ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
2892
2893arm_attr_merge_7a.o: arm_attr_merge_7a.s
2894 $(TEST_AS) -o $@ $<
2895
2896arm_attr_merge_7b.o: arm_attr_merge_7b.s
2897 $(TEST_AS) -o $@ $<
2898
2899MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7
2900
a8e2273b
ILT
2901# ARM1176 workaround test.
2902check_SCRIPTS += arm_fix_1176.sh
2903check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \
2904 arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \
2905 arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout
2906
2907arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z
2908 $(TEST_OBJDUMP) -D -j.foo $< > $@
2909
2910arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new
2911 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2912
2913arm_fix_1176_default_v6z.o: arm_fix_1176.s
2914 $(TEST_AS) -march=armv6z -o $@ $<
2915
2916arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z
2917 $(TEST_OBJDUMP) -D -j.foo $< > $@
2918
2919arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new
2920 ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $<
2921
2922arm_fix_1176_on_v6z.o: arm_fix_1176.s
2923 $(TEST_AS) -march=armv6z -o $@ $<
2924
2925arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z
2926 $(TEST_OBJDUMP) -D -j.foo $< > $@
2927
2928arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new
2929 ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $<
2930
2931arm_fix_1176_off_v6z.o: arm_fix_1176.s
2932 $(TEST_AS) -march=armv6z -o $@ $<
2933
2934arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te
2935 $(TEST_OBJDUMP) -D -j.foo $< > $@
2936
2937arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new
2938 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2939
2940arm_fix_1176_default_v5te.o: arm_fix_1176.s
2941 $(TEST_AS) -march=armv5te -o $@ $<
2942
2943arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a
2944 $(TEST_OBJDUMP) -D -j.foo $< > $@
2945
2946arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new
2947 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2948
2949arm_fix_1176_default_v7a.o: arm_fix_1176.s
2950 $(TEST_AS) -march=armv7-a -o $@ $<
2951
2952arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s
2953 $(TEST_OBJDUMP) -D -j.foo $< > $@
2954
2955arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new
2956 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2957
2958arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s
2959 $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $<
2960
2961MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \
2962 arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s
2963
aa98ff75
DK
2964# Cortex-A8 workaround test.
2965
2966check_SCRIPTS += arm_cortex_a8.sh
2967check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \
2968 arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \
2969 arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout
2970
2971arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond
2972 $(TEST_OBJDUMP) -D -j.text $< > $@
2973
2974arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new
2975 ../ld-new -o $@ $<
2976
2977arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s
2978 $(TEST_AS) -o $@ $<
2979
2980arm_cortex_a8_b.stdout: arm_cortex_a8_b
2981 $(TEST_OBJDUMP) -D -j.text $< > $@
2982
2983arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new
2984 ../ld-new --fix-cortex-a8 -o $@ $<
2985
2986arm_cortex_a8_b.o: arm_cortex_a8_b.s
2987 $(TEST_AS) -o $@ $<
2988
2989arm_cortex_a8_bl.stdout: arm_cortex_a8_bl
2990 $(TEST_OBJDUMP) -D -j.text $< > $@
2991
2992arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new
2993 ../ld-new -o $@ $<
2994
2995arm_cortex_a8_bl.o: arm_cortex_a8_bl.s
2996 $(TEST_AS) -o $@ $<
2997
2998arm_cortex_a8_blx.stdout: arm_cortex_a8_blx
2999 $(TEST_OBJDUMP) -D -j.text $< > $@
3000
3001arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new
3002 ../ld-new -o $@ $<
3003
3004arm_cortex_a8_blx.o: arm_cortex_a8_blx.s
3005 $(TEST_AS) -o $@ $<
3006
3007arm_cortex_a8_local.stdout: arm_cortex_a8_local
3008 $(TEST_OBJDUMP) -D -j.text $< > $@
3009
3010arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new
3011 ../ld-new -o $@ $<
3012
3013arm_cortex_a8_local.o: arm_cortex_a8_local.s
3014 $(TEST_AS) -o $@ $<
3015
3016arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc
3017 $(TEST_OBJDUMP) -D -j.text $< > $@
3018
3019arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new
3020 ../ld-new -o $@ $<
3021
3022arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s
3023 $(TEST_AS) -o $@ $<
3024
3025MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \
3026 arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc
3027
c87e4302
DK
3028check_SCRIPTS += arm_exidx_test.sh
3029check_DATA += arm_exidx_test.stdout
3030
3031arm_exidx_test.stdout: arm_exidx_test.so
647f1574 3032 $(TEST_READELF) -Sr $< > $@
c87e4302
DK
3033
3034arm_exidx_test.so: arm_exidx_test.o ../ld-new
3035 ../ld-new -shared -o $@ $<
3036
3037arm_exidx_test.o: arm_exidx_test.s
3038 $(TEST_AS) -o $@ $<
3039
f62a3ca7
DK
3040check_SCRIPTS += pr12826.sh
3041check_DATA += pr12826.stdout
3042
3043pr12826.stdout: pr12826.so
3044 $(TEST_READELF) -A $< > $@
3045
3046pr12826.so: pr12826_1.o pr12826_2.o ../ld-new
3047 ../ld-new -shared -o $@ $<
3048
3049pr12826_1.o: pr12826_1.s
3050 $(TEST_AS) -o $@ $<
3051
3052pr12826_2.o: pr12826_2.s
3053 $(TEST_AS) -o $@ $<
c87e4302 3054
f6cccc2c 3055check_SCRIPTS += arm_unaligned_reloc.sh
2c339f71 3056check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout
f6cccc2c
DK
3057
3058arm_unaligned_reloc.stdout: arm_unaligned_reloc
3059 $(TEST_OBJDUMP) -D $< > $@
3060
2c339f71
DK
3061arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r
3062 $(TEST_OBJDUMP) -Dr $< > $@
3063
f6cccc2c
DK
3064arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new
3065 ../ld-new -o $@ $<
3066
2c339f71
DK
3067arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new
3068 ../ld-new -r -o $@ $<
3069
f6cccc2c
DK
3070arm_unaligned_reloc.o: arm_unaligned_reloc.s
3071 $(TEST_AS) -o $@ $<
3072
2c339f71 3073MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r
f6cccc2c 3074
cd6eab1c
ILT
3075# Check ARM to ARM farcall veneers
3076
3077check_SCRIPTS += arm_farcall_arm_arm.sh
3078check_DATA += arm_farcall_arm_arm.stdout
3079
3080arm_farcall_arm_arm.stdout: arm_farcall_arm_arm
3081 $(TEST_OBJDUMP) -d $< > $@
3082
3083arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new
a8e2273b 3084 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $<
cd6eab1c
ILT
3085
3086arm_farcall_arm_arm.o: arm_farcall_arm_arm.s
3087 $(TEST_AS) -o $@ $<
3088
3089MOSTLYCLEANFILES += arm_farcall_arm_arm
3090
3091# Check ARM to Thumb farcall veneers
3092
3093check_SCRIPTS += arm_farcall_arm_thumb.sh
3094check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout
3095
3096arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb
3097 $(TEST_OBJDUMP) -D $< > $@
3098
3099arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new
3100 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3101
3102arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s
3103 $(TEST_AS) -o $@ $<
3104
3105arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t
3106 $(TEST_OBJDUMP) -D $< > $@
3107
3108arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new
a8e2273b 3109 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
cd6eab1c
ILT
3110
3111arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s
3112 $(TEST_AS) -march=armv5t -o $@ $<
3113
3114MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t
3115
3116# Check Thumb to Thumb farcall veneers
3117
3118check_SCRIPTS += arm_farcall_thumb_thumb.sh
3119check_DATA += arm_farcall_thumb_thumb.stdout \
3120 arm_farcall_thumb_thumb_5t.stdout \
3121 arm_farcall_thumb_thumb_7m.stdout \
3122 arm_farcall_thumb_thumb_6m.stdout
3123
3124arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb
3125 $(TEST_OBJDUMP) -D $< > $@
3126
3127arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new
3128 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3129
3130arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s
3131 $(TEST_AS) -march=armv4t -o $@ $<
3132
3133arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t
3134 $(TEST_OBJDUMP) -D $< > $@
3135
3136arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new
a8e2273b 3137 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
cd6eab1c
ILT
3138
3139arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s
3140 $(TEST_AS) -march=armv5t -o $@ $<
3141
3142arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m
3143 $(TEST_OBJDUMP) -D $< > $@
3144
3145arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new
3146 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3147
3148arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s
3149 $(TEST_AS) -march=armv7-m -o $@ $<
3150
3151arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m
3152 $(TEST_OBJDUMP) -D $< > $@
3153
3154arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new
3155 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3156
3157arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s
3158 $(TEST_AS) -march=armv6-m -o $@ $<
3159
3160MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \
3161 arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m
3162
3163# Check Thumb to ARM farcall veneers
3164
3165check_SCRIPTS += arm_farcall_thumb_arm.sh
3166check_DATA += arm_farcall_thumb_arm.stdout \
3167 arm_farcall_thumb_arm_5t.stdout
3168
3169arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm
3170 $(TEST_OBJDUMP) -D $< > $@
3171
3172arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new
3173 ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
3174
3175arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s
3176 $(TEST_AS) -o $@ $<
3177
3178arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t
3179 $(TEST_OBJDUMP) -D $< > $@
3180
3181arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new
a8e2273b 3182 ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
cd6eab1c
ILT
3183
3184arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s
3185 $(TEST_AS) -march=armv5t -o $@ $<
3186
3187MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t
3188
e4782e83 3189endif DEFAULT_TARGET_ARM
eb373049
ILT
3190
3191endif NATIVE_OR_CROSS_LINKER
3192
35c813e2
CC
3193# Tests for the dwp tool.
3194# We don't want to rely yet on GCC support for -gsplit-dwarf,
3195# so we use (for now) test cases in x86 assembly language,
3196# compiled from the dwp_test_*.cc sources.
3197
3198if DEFAULT_TARGET_X86_64
3199
3200dwp_test_main.o: dwp_test_main.s
3201 $(TEST_AS) -o $@ $<
3202dwp_test_1.o: dwp_test_1.s
3203 $(TEST_AS) -o $@ $<
3204dwp_test_1b.o: dwp_test_1b.s
3205 $(TEST_AS) -o $@ $<
3206dwp_test_2.o: dwp_test_2.s
3207 $(TEST_AS) -o $@ $<
3208
3209dwp_test_main.dwo: dwp_test_main.o
3210 $(TEST_OBJCOPY) --extract-dwo $< $@
3211dwp_test_1.dwo: dwp_test_1.o
3212 $(TEST_OBJCOPY) --extract-dwo $< $@
3213dwp_test_1b.dwo: dwp_test_1b.o
3214 $(TEST_OBJCOPY) --extract-dwo $< $@
3215dwp_test_2.dwo: dwp_test_2.o
3216 $(TEST_OBJCOPY) --extract-dwo $< $@
3217
0ec6429b 3218MOSTLYCLEANFILES += *.dwo *.dwp
35c813e2
CC
3219check_SCRIPTS += dwp_test_1.sh
3220check_DATA += dwp_test_1.stdout
3221dwp_test_1.stdout: dwp_test_1.dwp
3222 $(TEST_READELF) -wi $< > $@
3223dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
3224 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
3225
3226check_SCRIPTS += dwp_test_2.sh
3227check_DATA += dwp_test_2.stdout
3228dwp_test_2.stdout: dwp_test_2.dwp
3229 $(TEST_READELF) -wi $< > $@
3230dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp
3231 ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp
3232dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo
3233 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo
3234dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo
3235 ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo
3236
3237endif DEFAULT_TARGET_X86_64
This page took 0.523687 seconds and 4 git commands to generate.