2010-09-08 Rafael Espindola <espindola@google.com>
[binutils.git] / gold / testsuite / Makefile.am
blobeab055755ead13433748ccb9a32948846b42eded
1 # Process this file with automake to generate Makefile.in
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.
7 # Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS
8 AUTOMAKE_OPTIONS = foreign -Wno-portability
10 # The two_file_test tests -fmerge-constants, so we simply always turn
11 # it on.  This may need to be controlled by a configure option
12 # eventually.
13 AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants
14 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants
16 AM_CPPFLAGS = \
17         -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
18         -I$(srcdir)/../../elfcpp -I.. \
19         -DLOCALEDIR="\"$(datadir)/locale\"" \
20         @INCINTL@
22 TEST_READELF = $(top_builddir)/../binutils/readelf
23 TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
24 TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
25 TEST_STRIP = $(top_builddir)/../binutils/strip-new
26 TEST_AR = $(top_builddir)/../binutils/ar
27 TEST_NM = $(top_builddir)/../binutils/nm-new
28 TEST_AS = $(top_builddir)/../gas/as-new
30 if PLUGINS
31 LIBDL = -ldl
32 endif
34 if THREADS
35 THREADSLIB = -lpthread
36 endif
38 if OMP_SUPPORT
39 TLS_TEST_C_CFLAGS = -fopenmp
40 endif
42 # 'make clean' is good about deleting some intermediate files (such as
43 # .o's), but not all of them (such as .so's and .err files).  We
44 # improve on that here.  automake-1.9 info docs say "mostlyclean" is
45 # the right choice for files 'make' builds that people rebuild.
46 MOSTLYCLEANFILES = *.so *.syms *.stdout
49 # We will add to these later, for each individual test.  Note
50 # that we add each test under check_SCRIPTS or check_PROGRAMS;
51 # the TESTS variable is automatically populated from these.
52 check_SCRIPTS =
53 check_DATA =
54 check_PROGRAMS =
55 BUILT_SOURCES =
57 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
59 # ---------------------------------------------------------------------
60 # These tests test the internals of gold (unittests).
62 # Infrastucture needed for the unittests
63 check_LIBRARIES = libgoldtest.a
64 libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
66 DEPENDENCIES = \
67         libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
68 LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
69         $(THREADSLIB) $(LIBDL)
72 # The unittests themselves
73 check_PROGRAMS += object_unittest
74 object_unittest_SOURCES = object_unittest.cc
76 check_PROGRAMS += binary_unittest
77 binary_unittest_SOURCES = binary_unittest.cc
80 # ---------------------------------------------------------------------
81 # These tests test the output of gold (end-to-end tests).  In
82 # particular, they make sure that gold can link "difficult" object
83 # files, and the resulting object files run correctly.  These can only
84 # run if we've built ld-new for the native architecture (that is,
85 # we're not cross-compiling it), since we run ld-new as part of these
86 # tests.  We use the gcc-specific flag '-B' to use our linker instead
87 # of the default linker, which is why we only run our tests under gcc.
89 if NATIVE_LINKER
90 if GCC
92 # Infrastucture needed for the unittests: a directory where the linker
93 # is named 'ld'.  This is because the -B flag appends 'ld' to its arg.
94 gcctestdir/ld: ../ld-new
95         test -d gcctestdir || mkdir -p gcctestdir
96         rm -f gcctestdir/ld
97         (cd gcctestdir && $(LN_S) ../../ld-new ld)
99 # Each of these .o's is a useful, small complete program.  They're
100 # particularly useful for making sure ld-new's flags do what they're
101 # supposed to (hence their names), but are used for many tests that
102 # don't actually involve analyzing input data.
103 flagstest_debug.o: constructor_test.cc
104         $(CXXCOMPILE) -O0 -g -c -o $@ $<
105 flagstest_ndebug.o: constructor_test.cc
106         $(CXXCOMPILE) -O0 -c -o $@ $<
108 check_SCRIPTS += incremental_test.sh
109 check_DATA += incremental_test.stdout
110 MOSTLYCLEANFILES += incremental_test
111 incremental_test_1.o: incremental_test_1.c
112         $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
113 incremental_test_2.o: incremental_test_2.c
114         $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
115 incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
116         $(LINK) -Bgcctestdir/ -Wl,-incremental incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
117 incremental_test.stdout: incremental_test ../incremental-dump
118         ../incremental-dump incremental_test > $@
120 check_SCRIPTS += gc_comdat_test.sh
121 check_DATA += gc_comdat_test.stdout
122 MOSTLYCLEANFILES += gc_comdat_test
123 gc_comdat_test_1.o: gc_comdat_test_1.cc 
124         $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
125 gc_comdat_test_2.o: gc_comdat_test_2.cc 
126         $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
127 gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
128         $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
129 gc_comdat_test.stdout: gc_comdat_test
130         $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
132 check_SCRIPTS += gc_tls_test.sh
133 check_DATA += gc_tls_test.stdout
134 MOSTLYCLEANFILES += gc_tls_test
135 gc_tls_test.o: gc_tls_test.cc
136         $(CXXCOMPILE) -O0 -c -g -o $@ $<
137 gc_tls_test:gc_tls_test.o gcctestdir/ld
138         $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
139 gc_tls_test.stdout: gc_tls_test
140         $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
142 check_SCRIPTS += gc_orphan_section_test.sh
143 check_DATA += gc_orphan_section_test.stdout
144 MOSTLYCLEANFILES += gc_orphan_section_test
145 gc_orphan_section_test.o: gc_orphan_section_test.cc
146         $(CXXCOMPILE) -O0 -c -g -o $@ $<
147 gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
148         $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o
149 gc_orphan_section_test.stdout: gc_orphan_section_test
150         $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout
152 check_SCRIPTS += icf_test.sh
153 check_DATA += icf_test.stdout
154 MOSTLYCLEANFILES += icf_test
155 icf_test.o: icf_test.cc 
156         $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
157 icf_test: icf_test.o gcctestdir/ld
158         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_test.o
159 icf_test.stdout: icf_test
160         $(TEST_NM) -C icf_test > icf_test.stdout
162 check_SCRIPTS += icf_keep_unique_test.sh
163 check_DATA += icf_keep_unique_test.stdout
164 MOSTLYCLEANFILES += icf_keep_unique_test
165 icf_keep_unique_test.o: icf_keep_unique_test.cc
166         $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
167 icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
168         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
169 icf_keep_unique_test.stdout: icf_keep_unique_test
170         $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout
172 check_SCRIPTS += icf_safe_test.sh
173 check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout
174 MOSTLYCLEANFILES += icf_safe_test
175 icf_safe_test.o: icf_safe_test.cc
176         $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
177 icf_safe_test: icf_safe_test.o gcctestdir/ld
178         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_test.o
179 icf_safe_test_1.stdout: icf_safe_test
180         $(TEST_NM) icf_safe_test > icf_safe_test_1.stdout
181 icf_safe_test_2.stdout: icf_safe_test
182         $(TEST_READELF) -h icf_safe_test > icf_safe_test_2.stdout
184 check_SCRIPTS += icf_safe_so_test.sh
185 check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout
186 MOSTLYCLEANFILES += icf_safe_so_test
187 icf_safe_so_test.o: icf_safe_so_test.cc
188         $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
189 icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
190         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_so_test.o -fPIC -shared
191 icf_safe_so_test_1.stdout: icf_safe_so_test
192         $(TEST_NM) icf_safe_so_test > icf_safe_so_test_1.stdout
193 icf_safe_so_test_2.stdout: icf_safe_so_test
194         $(TEST_READELF) -h icf_safe_so_test > icf_safe_so_test_2.stdout
196 check_SCRIPTS += final_layout.sh
197 check_DATA += final_layout.stdout
198 MOSTLYCLEANFILES += final_layout
199 final_layout.o: final_layout.cc
200         $(CXXCOMPILE) -O0 -c -ffunction-sections  -fdata-sections -g -o $@ $<
201 final_layout_sequence.txt:
202         (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
203 final_layout: final_layout.o final_layout_sequence.txt gcctestdir/ld
204         $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt final_layout.o
205 final_layout.stdout: final_layout
206         $(TEST_NM) final_layout > final_layout.stdout
208 check_PROGRAMS += icf_virtual_function_folding_test
209 MOSTLYCLEANFILES += icf_virtual_function_folding_test
210 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
211         $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
212 icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld
213         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie
215 check_SCRIPTS += icf_preemptible_functions_test.sh
216 check_DATA += icf_preemptible_functions_test.stdout
217 MOSTLYCLEANFILES += icf_preemptible_functions_test
218 icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
219         $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
220 icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
221         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared
222 icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
223         $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout
225 check_SCRIPTS += icf_string_merge_test.sh
226 check_DATA += icf_string_merge_test.stdout
227 MOSTLYCLEANFILES += icf_string_merge_test
228 icf_string_merge_test.o: icf_string_merge_test.cc
229         $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
230 icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
231         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o
232 icf_string_merge_test.stdout: icf_string_merge_test
233         $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
235 check_SCRIPTS += icf_sht_rel_addend_test.sh
236 check_DATA += icf_sht_rel_addend_test.stdout
237 MOSTLYCLEANFILES += icf_sht_rel_addend_test
238 icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
239         $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
240 icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
241         $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
242 icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
243         $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
244 icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
245         $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
247 check_PROGRAMS += basic_test
248 check_PROGRAMS += basic_static_test
249 check_PROGRAMS += basic_pic_test
250 check_PROGRAMS += basic_static_pic_test
251 basic_test.o: basic_test.cc
252         $(CXXCOMPILE) -O0 -c -o $@ $<
253 basic_test: basic_test.o gcctestdir/ld
254         $(CXXLINK) -Bgcctestdir/ basic_test.o
255 basic_static_test: basic_test.o gcctestdir/ld
256         $(CXXLINK) -Bgcctestdir/ -static basic_test.o
258 basic_pic_test.o: basic_test.cc
259         $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
260 basic_pic_test: basic_pic_test.o gcctestdir/ld
261         $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
262 basic_static_pic_test: basic_pic_test.o gcctestdir/ld
263         $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
265 check_PROGRAMS += basic_pie_test
266 basic_pie_test.o: basic_test.cc
267         $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
268 basic_pie_test: basic_pie_test.o gcctestdir/ld
269         $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o
271 check_PROGRAMS += constructor_test
272 check_PROGRAMS += constructor_static_test
273 constructor_test_SOURCES = constructor_test.cc
274 constructor_test_DEPENDENCIES = gcctestdir/ld
275 constructor_test_LDFLAGS = -Bgcctestdir/
276 constructor_test_LDADD =
278 constructor_static_test_SOURCES = $(constructor_test_SOURCES)
279 constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
280 constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
281 constructor_static_test_LDADD = $(constructor_test_LDADD)
284 check_PROGRAMS += two_file_test
285 check_PROGRAMS += two_file_static_test
286 check_PROGRAMS += two_file_pic_test
287 two_file_test_SOURCES = \
288         two_file_test_1.cc \
289         two_file_test_1b.cc \
290         two_file_test_2.cc \
291         two_file_test_main.cc \
292         two_file_test.h
293 two_file_test_DEPENDENCIES = gcctestdir/ld
294 two_file_test_LDFLAGS = -Bgcctestdir/
295 two_file_test_LDADD =
297 two_file_static_test_SOURCES = $(two_file_test_SOURCES)
298 two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
299 two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
300 two_file_static_test_LDADD = $(two_file_test_LDADD)
302 two_file_pic_test_SOURCES = two_file_test_main.cc
303 two_file_pic_test_DEPENDENCIES = \
304         gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
305 two_file_pic_test_LDFLAGS = -Bgcctestdir/
306 two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
309 check_PROGRAMS += two_file_shared_1_test
310 check_PROGRAMS += two_file_shared_2_test
311 check_PROGRAMS += two_file_shared_1_pic_2_test
312 check_PROGRAMS += two_file_shared_2_pic_1_test
313 check_PROGRAMS += two_file_same_shared_test
314 check_PROGRAMS += two_file_separate_shared_12_test
315 check_PROGRAMS += two_file_separate_shared_21_test
316 two_file_test_1_pic.o: two_file_test_1.cc
317         $(CXXCOMPILE) -c -fpic -o $@ $<
318 two_file_test_1b_pic.o: two_file_test_1b.cc
319         $(CXXCOMPILE) -c -fpic -o $@ $<
320 two_file_test_2_pic.o: two_file_test_2.cc
321         $(CXXCOMPILE) -c -fpic -o $@ $<
322 two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
323         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
324 two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
325         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
326 two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
327         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
329 two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
330 two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
331 two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
332 two_file_shared_1_test_LDADD = two_file_shared_1.so
334 two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
335 two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
336 two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
337 two_file_shared_2_test_LDADD = two_file_shared_2.so
339 two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
340 two_file_shared_1_pic_2_test_DEPENDENCIES = \
341         gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o
342 two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
343 two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so
345 two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
346 two_file_shared_2_pic_1_test_DEPENDENCIES = \
347         gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
348 two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
349 two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
351 two_file_same_shared_test_SOURCES = two_file_test_main.cc
352 two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
353 two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
354 two_file_same_shared_test_LDADD = two_file_shared.so
356 two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
357 two_file_separate_shared_12_test_DEPENDENCIES = \
358         gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
359 two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
360 two_file_separate_shared_12_test_LDADD = \
361         two_file_shared_1.so two_file_shared_2.so
363 two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
364 two_file_separate_shared_21_test_DEPENDENCIES = \
365         gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
366 two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
367 two_file_separate_shared_21_test_LDADD = \
368         two_file_shared_2.so two_file_shared_1.so
370 check_PROGRAMS += two_file_relocatable_test
371 two_file_relocatable_test_SOURCES = two_file_test_main.cc
372 two_file_relocatable_test_DEPENDENCIES = \
373         gcctestdir/ld two_file_relocatable.o
374 two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
375 two_file_relocatable_test_LDADD = two_file_relocatable.o
376 two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
377         gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
379 check_PROGRAMS += two_file_pie_test
380 two_file_test_1_pie.o: two_file_test_1.cc
381         $(CXXCOMPILE) -c -fpie -o $@ $<
382 two_file_test_1b_pie.o: two_file_test_1b.cc
383         $(CXXCOMPILE) -c -fpie -o $@ $<
384 two_file_test_2_pie.o: two_file_test_2.cc
385         $(CXXCOMPILE) -c -fpie -o $@ $<
386 two_file_test_main_pie.o: two_file_test_main.cc
387         $(CXXCOMPILE) -c -fpie -o $@ $<
388 two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
389                 two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
390         $(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
392 check_SCRIPTS += two_file_shared.sh
393 check_DATA += two_file_shared.dbg
394 MOSTLYCLEANFILES += two_file_shared.dbg
395 two_file_shared.dbg: two_file_shared.so
396         $(TEST_READELF) -w $< >$@ 2>/dev/null
398 # The nonpic tests will fail on platforms which can not put non-PIC
399 # code into shared libraries, so we just don't run them in that case.
400 if FN_PTRS_IN_SO_WITHOUT_PIC
402 check_PROGRAMS += two_file_shared_1_nonpic_test
403 check_PROGRAMS += two_file_shared_2_nonpic_test
404 check_PROGRAMS += two_file_same_shared_nonpic_test
405 check_PROGRAMS += two_file_separate_shared_12_nonpic_test
406 check_PROGRAMS += two_file_separate_shared_21_nonpic_test
407 check_PROGRAMS += two_file_mixed_shared_test
408 check_PROGRAMS += two_file_mixed_2_shared_test
409 two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
410         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
411 two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
412         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
413 two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
414         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
415 two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
416         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
417 two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
418         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so
420 two_file_shared_1_nonpic_test_SOURCES = \
421         two_file_test_2.cc two_file_test_main.cc
422 two_file_shared_1_nonpic_test_DEPENDENCIES = \
423         gcctestdir/ld two_file_shared_1_nonpic.so
424 two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
425 two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
427 two_file_shared_2_nonpic_test_SOURCES = \
428         two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
429 two_file_shared_2_nonpic_test_DEPENDENCIES = \
430         gcctestdir/ld two_file_shared_2_nonpic.so
431 two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
432 two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
434 two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
435 two_file_same_shared_nonpic_test_DEPENDENCIES = \
436         gcctestdir/ld two_file_shared_nonpic.so
437 two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
438 two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
440 two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
441 two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
442         gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
443 two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
444 two_file_separate_shared_12_nonpic_test_LDADD = \
445         two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
447 two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
448 two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
449         gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
450 two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
451 two_file_separate_shared_21_nonpic_test_LDADD = \
452         two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
454 two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
455 two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
456 two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
457 two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
459 two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
460 two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
461 two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
462 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
464 endif FN_PTRS_IN_SO_WITHOUT_PIC
466 check_PROGRAMS += two_file_strip_test
467 two_file_strip_test: two_file_test
468         $(TEST_STRIP) -o two_file_strip_test two_file_test
470 check_PROGRAMS += two_file_same_shared_strip_test
471 two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
472 two_file_same_shared_strip_test_DEPENDENCIES = \
473         gcctestdir/ld two_file_shared_strip.so
474 two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
475 two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
476 two_file_shared_strip.so: two_file_shared.so
477         $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
479 check_PROGRAMS += common_test_1
480 common_test_1_SOURCES = common_test_1.c
481 common_test_1_DEPENDENCIES = gcctestdir/ld
482 common_test_1_LDFLAGS = -Bgcctestdir/
483 common_test_1_LDADD =
485 check_PROGRAMS += common_test_2
486 common_test_2_SOURCES = common_test_1.c
487 common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
488 common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
489 common_test_2_LDADD = common_test_2.so common_test_3.so
490 common_test_2_pic.o: common_test_2.c
491         $(COMPILE) -c -fpic -o $@ $<
492 common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld
493         $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so
494 common_test_3_pic.o: common_test_3.c
495         $(COMPILE) -c -fpic -o $@ $<
496 common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld
497         $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script
499 check_PROGRAMS += exception_test
500 check_PROGRAMS += exception_static_test
501 check_PROGRAMS += exception_shared_1_test
502 check_PROGRAMS += exception_shared_2_test
503 check_PROGRAMS += exception_same_shared_test
504 check_PROGRAMS += exception_separate_shared_12_test
505 check_PROGRAMS += exception_separate_shared_21_test
506 exception_test_1_pic.o: exception_test_1.cc
507         $(CXXCOMPILE) -c -fpic -o $@ $<
508 exception_test_2_pic.o: exception_test_2.cc
509         $(CXXCOMPILE) -c -fpic -o $@ $<
510 exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
511         $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
512 exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
513         $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
514 exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
515         $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
517 exception_test_SOURCES = \
518         exception_test_main.cc \
519         exception_test_1.cc \
520         exception_test_2.cc \
521         exception_test.h
522 exception_test_DEPENDENCIES = gcctestdir/ld
523 exception_test_LDFLAGS = -Bgcctestdir/
524 exception_test_LDADD =
526 exception_static_test_SOURCES = $(exception_test_SOURCES)
527 exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
528 exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
529 exception_static_test_LDADD = $(exception_test_LDADD)
531 exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
532 exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
533 exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
534 exception_shared_1_test_LDADD = exception_shared_1.so
536 exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
537 exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
538 exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
539 exception_shared_2_test_LDADD = exception_shared_2.so
541 exception_same_shared_test_SOURCES = exception_test_main.cc
542 exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
543 exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
544 exception_same_shared_test_LDADD = exception_shared.so
546 exception_separate_shared_12_test_SOURCES = exception_test_main.cc
547 exception_separate_shared_12_test_DEPENDENCIES = \
548         gcctestdir/ld exception_shared_1.so exception_shared_2.so
549 exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
550 exception_separate_shared_12_test_LDADD = \
551         exception_shared_1.so exception_shared_2.so
553 exception_separate_shared_21_test_SOURCES = exception_test_main.cc
554 exception_separate_shared_21_test_DEPENDENCIES = \
555         gcctestdir/ld exception_shared_1.so exception_shared_2.so
556 exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
557 exception_separate_shared_21_test_LDADD = \
558         exception_shared_2.so exception_shared_1.so
561 check_PROGRAMS += weak_test
562 weak_test_SOURCES = weak_test.cc
563 weak_test_DEPENDENCIES = gcctestdir/ld
564 weak_test_LDFLAGS = -Bgcctestdir/
565 weak_test_LDADD =
567 check_PROGRAMS += weak_undef_test
568 MOSTLYCLEANFILES += alt/weak_undef_lib.so
569 weak_undef_test_SOURCES = weak_undef_test.cc
570 weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
571 weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
572 weak_undef_test_LDADD = -L . weak_undef_lib.so
573 weak_undef_file1.o: weak_undef_file1.cc
574         $(CXXCOMPILE) -c -fpic -o $@ $<
575 weak_undef_file2.o: weak_undef_file2.cc
576         $(CXXCOMPILE) -c -fpic -o $@ $<
577 weak_undef_lib.so: weak_undef_file1.o
578         $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
579 alt/weak_undef_lib.so: weak_undef_file2.o
580         test -d alt || mkdir -p alt
581         $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
583 if FN_PTRS_IN_SO_WITHOUT_PIC
584 check_PROGRAMS += weak_undef_nonpic_test
585 MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so
586 weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
587 weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
588 weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
589 weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
590 weak_undef_file1_nonpic.o: weak_undef_file1.cc
591         $(CXXCOMPILE) -c -o $@ $<
592 weak_undef_file2_nonpic.o: weak_undef_file2.cc
593         $(CXXCOMPILE) -c -o $@ $<
594 weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
595         $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
596 alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
597         test -d alt || mkdir -p alt
598         $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
599 endif FN_PTRS_IN_SO_WITHOUT_PIC
602 check_PROGRAMS += weak_alias_test
603 weak_alias_test_SOURCES = weak_alias_test_main.cc
604 weak_alias_test_DEPENDENCIES = \
605         gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
606         weak_alias_test_3.o weak_alias_test_4.so
607 weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
608 weak_alias_test_LDADD = \
609         weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
610         weak_alias_test_4.so
611 weak_alias_test_1_pic.o: weak_alias_test_1.cc
612         $(CXXCOMPILE) -c -fpic -o $@ $<
613 weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
614         $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
615 weak_alias_test_2_pic.o: weak_alias_test_2.cc
616         $(CXXCOMPILE) -c -fpic -o $@ $<
617 weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
618         $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
619 weak_alias_test_3.o: weak_alias_test_3.cc
620         $(CXXCOMPILE) -c -o $@ $<
621 weak_alias_test_4_pic.o: weak_alias_test_4.cc
622         $(CXXCOMPILE) -c -fpic -o $@ $<
623 weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
624         $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
626 check_SCRIPTS += weak_plt.sh
627 check_PROGRAMS += weak_plt
628 check_DATA += weak_plt_shared.so
629 weak_plt_main_pic.o: weak_plt_main.cc
630         $(CXXCOMPILE) -c -fpic -o $@ $<
631 weak_plt: weak_plt_main_pic.o gcctestdir/ld
632         $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
633 weak_plt_shared_pic.o: weak_plt_shared.cc
634         $(CXXCOMPILE) -c -fpic -o $@ $<
635 weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
636         $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
638 check_PROGRAMS += copy_test
639 copy_test_SOURCES = copy_test.cc
640 copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
641 copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
642 copy_test_LDADD = copy_test_1.so copy_test_2.so
643 copy_test_1_pic.o: copy_test_1.cc
644         $(CXXCOMPILE) -c -fpic -o $@ $<
645 copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
646         $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
647 copy_test_2_pic.o: copy_test_2.cc
648         $(CXXCOMPILE) -c -fpic -o $@ $<
649 copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
650         $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
652 if TLS
654 check_PROGRAMS += tls_test
655 check_PROGRAMS += tls_pic_test
656 check_PROGRAMS += tls_pie_test
657 check_PROGRAMS += tls_pie_pic_test
658 check_PROGRAMS += tls_shared_test
659 check_PROGRAMS += tls_shared_ie_test
660 check_PROGRAMS += tls_shared_gd_to_ie_test
661 tls_test_pic.o: tls_test.cc
662         $(CXXCOMPILE) -c -fpic -o $@ $<
663 tls_test_file2_pic.o: tls_test_file2.cc
664         $(CXXCOMPILE) -c -fpic -o $@ $<
665 tls_test_c_pic.o: tls_test_c.c
666         $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
667 tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
668         $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
669 tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
670         $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
672 tls_test_pic_ie.o: tls_test.cc
673         $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
674 tls_test_file2_pic_ie.o: tls_test_file2.cc
675         $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
676 tls_test_c_pic_ie.o: tls_test_c.c
677         $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
678 tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
679         $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
681 tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
682 tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
683 tls_test_LDFLAGS = -Bgcctestdir/
684 tls_test_LDADD = tls_test_c.o -lpthread
685 tls_test_c.o: tls_test_c.c
686         $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
688 tls_pic_test_SOURCES = tls_test_main.cc
689 tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
690         tls_test_c_pic.o
691 tls_pic_test_LDFLAGS = -Bgcctestdir/
692 tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
693         -lpthread
695 tls_test_main_pie.o: tls_test_main.cc tls_test.h
696         $(CXXCOMPILE) -c -fpie -o $@ $<
697 tls_test_pie.o: tls_test.cc tls_test.h
698         $(CXXCOMPILE) -c -fpie -o $@ $<
699 tls_test_file2_pie.o: tls_test_file2.cc tls_test.h
700         $(CXXCOMPILE) -c -fpie -o $@ $<
701 tls_test_c_pie.o: tls_test_c.c
702         $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
703 tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \
704                 tls_test_c_pie.o gcctestdir/ld
705         $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread
707 tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \
708                 tls_test_c_pic.o gcctestdir/ld
709         $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread
711 tls_shared_test_SOURCES = tls_test_main.cc
712 tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
713 tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
714 tls_shared_test_LDADD = tls_test_shared.so -lpthread
716 tls_shared_ie_test_SOURCES = tls_test_main.cc
717 tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
718 tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
719 tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
721 tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
722 tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
723         tls_test_c_pic.o tls_test_shared2.so
724 tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
725 tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
726         tls_test_shared2.so -lpthread
728 if TLS_GNU2_DIALECT
730 check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
732 tls_test_gnu2.o: tls_test.cc
733         $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
734 tls_test_file2_gnu2.o: tls_test_file2.cc
735         $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
736 tls_test_c_gnu2.o: tls_test_c.c
737         $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
738 tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
739         $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
741 tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
742 tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
743         tls_test_c_gnu2.o tls_test_gnu2_shared2.so
744 tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
745 tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
746         tls_test_gnu2_shared2.so -lpthread
748 if TLS_DESCRIPTORS
750 check_PROGRAMS += tls_shared_gnu2_test
752 tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
753         $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
755 tls_shared_gnu2_test_SOURCES = tls_test_main.cc
756 tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
757 tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
758 tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
760 endif TLS_DESCRIPTORS
762 endif TLS_GNU2_DIALECT
764 if STATIC_TLS
765 check_PROGRAMS += tls_static_test
766 check_PROGRAMS += tls_static_pic_test
768 tls_static_test_SOURCES = $(tls_test_SOURCES)
769 tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
770 tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
771 tls_static_test_LDADD = $(tls_test_LDADD)
773 tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
774 tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
775 tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
776 tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
777 endif
779 if FN_PTRS_IN_SO_WITHOUT_PIC
780 check_PROGRAMS += tls_shared_nonpic_test
781 tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
782         $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
784 tls_shared_nonpic_test_SOURCES = tls_test_main.cc
785 tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
786 tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
787 tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
788 endif FN_PTRS_IN_SO_WITHOUT_PIC
790 endif TLS
792 check_PROGRAMS += many_sections_test
793 many_sections_test_SOURCES = many_sections_test.cc
794 many_sections_test_DEPENDENCIES = gcctestdir/ld
795 many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
796 many_sections_test_LDADD =
798 BUILT_SOURCES += many_sections_define.h
799 MOSTLYCLEANFILES += many_sections_define.h
800 many_sections_define.h:
801         (for i in `seq 1 70000`; do \
802            echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
803          done) > $@.tmp
804         mv -f $@.tmp $@
806 BUILT_SOURCES += many_sections_check.h
807 MOSTLYCLEANFILES += many_sections_check.h
808 many_sections_check.h:
809         (for i in `seq 1 1000 70000`; do \
810            echo "assert(var_$$i == $$i);"; \
811          done) > $@.tmp
812         mv -f $@.tmp $@
814 check_PROGRAMS += many_sections_r_test
815 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
816         gcctestdir/ld -r -o $@ many_sections_test.o
817 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
818         $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
820 if CONSTRUCTOR_PRIORITY
822 check_PROGRAMS += initpri1
823 initpri1_SOURCES = initpri1.c
824 initpri1_DEPENDENCIES = gcctestdir/ld
825 initpri1_LDFLAGS = -Bgcctestdir/
826 initpri1_LDADD =
828 endif
831 # Test --detect-odr-violations
832 check_SCRIPTS += debug_msg.sh
834 # Create the data files that debug_msg.sh analyzes.
835 check_DATA += debug_msg.err
836 MOSTLYCLEANFILES += debug_msg.err
837 debug_msg.o: debug_msg.cc
838         $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
839 odr_violation1.o: odr_violation1.cc
840         $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
841 odr_violation2.o: odr_violation2.cc
842         $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
843 debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
844         @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
845         @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
846         then \
847           echo 1>&2 "Link of debug_msg should have failed"; \
848           rm -f $@; \
849           exit 1; \
850         fi
852 # See if we can also detect problems when we're linking .so's, not .o's.
853 check_DATA += debug_msg_so.err
854 MOSTLYCLEANFILES += debug_msg_so.err
855 debug_msg.so: debug_msg.cc gcctestdir/ld
856         $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
857 odr_violation1.so: odr_violation1.cc gcctestdir/ld
858         $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
859 odr_violation2.so: odr_violation2.cc gcctestdir/ld
860         $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
861 debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
862         @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
863         @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
864         then \
865           echo 1>&2 "Link of debug_msg_so should have failed"; \
866           rm -f $@; \
867           exit 1; \
868         fi
870 # We also want to make sure we do something reasonable when there's no
871 # debug info available.  For the best test, we use .so's.
872 check_DATA += debug_msg_ndebug.err
873 MOSTLYCLEANFILES += debug_msg_ndebug.err
874 debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
875         $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
876 odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
877         $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
878 odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
879         $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
880 debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
881         @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
882         @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
883         then \
884           echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
885           rm -f $@; \
886           exit 1; \
887         fi
890 # Similar to --detect-odr-violations: check for undefined symbols in .so's
891 check_SCRIPTS += undef_symbol.sh
892 check_DATA += undef_symbol.err
893 MOSTLYCLEANFILES += undef_symbol.err
894 undef_symbol.o: undef_symbol.cc
895         $(CXXCOMPILE) -O0 -g -c -fPIC $<
896 undef_symbol.so: undef_symbol.o gcctestdir/ld
897         $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
898 undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
899         @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
900         @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
901         then \
902           echo 1>&2 "Link of undef_symbol_test should have failed"; \
903           rm -f $@; \
904           exit 1; \
905         fi
908 # Test -o when emitting to a special file (such as something in /dev).
909 check_PROGRAMS += flagstest_o_specialfile
910 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
911         $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
912         chmod a+x $@
913         test -s $@
915 if HAVE_ZLIB
917 # Test --compress-debug-sections.  FIXME: check we actually compress.
918 check_PROGRAMS += flagstest_compress_debug_sections
919 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
920         $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
921         test -s $@
924 # The specialfile output has a tricky case when we also compress debug
925 # sections, because it requires output-file resizing.
926 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
927 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
928                 gcctestdir/ld
929         $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
930         chmod a+x $@
931         test -s $@
933 endif HAVE_ZLIB
935 # Test symbol versioning.
936 check_PROGRAMS += ver_test
937 ver_test_SOURCES = ver_test_main.cc
938 ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
939 ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
940 ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
941 ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
942         $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
943 ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
944         $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so
945 ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
946         $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
947 ver_test_1.o: ver_test_1.cc
948         $(CXXCOMPILE) -c -fpic -o $@ $<
949 ver_test_2.o: ver_test_2.cc
950         $(CXXCOMPILE) -c -fpic -o $@ $<
951 ver_test_3.o: ver_test_3.cc
952         $(CXXCOMPILE) -c -fpic -o $@ $<
953 ver_test_4.o: ver_test_4.cc
954         $(CXXCOMPILE) -c -fpic -o $@ $<
956 check_SCRIPTS += ver_test_1.sh
957 check_DATA += ver_test_1.syms
958 ver_test_1.syms: ver_test_1.so
959         $(TEST_READELF) -s $< >$@ 2>/dev/null
961 check_PROGRAMS += ver_test_2
962 ver_test_2_SOURCES = ver_test_main_2.cc
963 ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
964 ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
965 ver_test_2_LDADD = ver_test_4.so ver_test_2.so
967 check_SCRIPTS += ver_test_2.sh
968 check_DATA += ver_test_2.syms
969 ver_test_2.syms: ver_test_2
970         $(TEST_READELF) -s $< >$@ 2>/dev/null
972 check_SCRIPTS += ver_test_4.sh
973 check_DATA += ver_test_4.syms
974 ver_test_4.syms: ver_test_4.so
975         $(TEST_READELF) -s $< >$@ 2>/dev/null
977 ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
978         $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
979 ver_test_5.o: ver_test_5.cc
980         $(CXXCOMPILE) -c -fpic -o $@ $<
981 check_SCRIPTS += ver_test_5.sh
982 check_DATA += ver_test_5.syms
983 ver_test_5.syms: ver_test_5.so
984         $(TEST_READELF) -s $< >$@ 2>/dev/null
986 check_PROGRAMS += ver_test_6
987 ver_test_6_SOURCES = ver_test_6.c
988 ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
989 ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
990 ver_test_6_LDADD = ver_test_2.so
992 ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
993         $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
994 ver_test_7.o: ver_test_7.cc
995         $(CXXCOMPILE) -c -fpic -o $@ $<
996 check_SCRIPTS += ver_test_7.sh
997 check_DATA += ver_test_7.syms
998 ver_test_7.syms: ver_test_7.so
999         $(TEST_READELF) -s $< >$@ 2>/dev/null
1001 check_PROGRAMS += ver_test_8
1002 ver_test_8_SOURCES = two_file_test_main.cc
1003 ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
1004 ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1005 ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
1006 ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
1007         $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
1008 ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
1009         $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
1011 check_PROGRAMS += ver_test_9
1012 ver_test_9_SOURCES = ver_test_main.cc
1013 ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
1014 ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1015 ver_test_9_LDADD = ver_test_9.so
1016 ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
1017         $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so
1018 ver_test_9.o: ver_test_9.cc
1019         $(CXXCOMPILE) -c -fpic -o $@ $<
1021 check_SCRIPTS += ver_test_10.sh
1022 check_DATA += ver_test_10.syms
1023 ver_test_10.syms: ver_test_10.so
1024         $(TEST_READELF) -s $< >$@ 2>/dev/null
1025 ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
1026         $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
1028 check_PROGRAMS += ver_test_11
1029 MOSTLYCLEANFILES += ver_test_11.a
1030 ver_test_11_SOURCES = ver_test_main_2.cc
1031 ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
1032 ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1033 ver_test_11_LDADD = ver_test_11.a
1034 ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
1035         $(TEST_AR) rc $@ $^
1037 check_PROGRAMS += protected_1
1038 protected_1_SOURCES = \
1039         protected_main_1.cc protected_main_2.cc protected_main_3.cc
1040 protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
1041 protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1042 protected_1_LDADD = protected_1.so
1044 protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
1045         $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
1046 protected_1_pic.o: protected_1.cc
1047         $(CXXCOMPILE) -c -fpic -o $@ $<
1048 protected_2_pic.o: protected_2.cc
1049         $(CXXCOMPILE) -c -fpic -o $@ $<
1050 protected_3_pic.o: protected_3.cc
1051         $(CXXCOMPILE) -c -fpic -o $@ $<
1053 check_PROGRAMS += protected_2
1054 protected_2_SOURCES = protected_main_1.cc protected_3.cc
1055 protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
1056 protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1057 protected_2_LDADD = protected_1.so
1059 check_DATA += protected_3.err
1060 MOSTLYCLEANFILES += protected_3.err
1061 protected_4_pic.o: protected_4.cc
1062         $(CXXCOMPILE) -c -fpic -o $@ $<
1063 protected_3.err: protected_4_pic.o gcctestdir/ld
1064         @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@"
1065         @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \
1066           echo 1>&2 "Link of protected_4.so should have failed"; \
1067           rm -f $@; \
1068           exit 1; \
1069         fi
1071 check_PROGRAMS += relro_test
1072 relro_test_SOURCES = relro_test_main.cc
1073 relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
1074 relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1075 relro_test_LDADD = relro_test.so
1076 relro_test.so: gcctestdir/ld relro_test_pic.o
1077         $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
1078 relro_test_pic.o: relro_test.cc
1079         $(CXXCOMPILE) -c -fpic -o $@ $<
1081 check_PROGRAMS += relro_strip_test
1082 relro_strip_test_SOURCES = relro_test_main.cc
1083 relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
1084 relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1085 relro_strip_test_LDADD = relro_strip_test.so
1086 relro_strip_test.so: relro_test.so
1087         $(TEST_STRIP) -o $@ $<
1089 check_PROGRAMS += relro_script_test
1090 relro_script_test_SOURCES = relro_test_main.cc
1091 relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
1092 relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1093 relro_script_test_LDADD = relro_script_test.so
1094 relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
1095         $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o
1097 check_PROGRAMS += script_test_1
1098 script_test_1_SOURCES = script_test_1.cc
1099 script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
1100 script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
1101 script_test_1_LDADD =
1103 check_PROGRAMS += script_test_2
1104 script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
1105 script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
1106 script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
1107 script_test_2_LDADD =
1109 check_PROGRAMS += justsyms
1110 justsyms_SOURCES = justsyms_1.cc
1111 justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
1112 justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
1113 justsyms_LDADD =
1114 justsyms_2.o: justsyms_2.cc
1115         $(CXXCOMPILE) -c -o $@ $<
1116 justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
1117         gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
1119 check_PROGRAMS += binary_test
1120 MOSTLYCLEANFILES += binary.txt
1121 binary_test_SOURCES = binary_test.cc
1122 binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
1123 binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
1124 binary_test_LDADD =
1125 # Copy the file to the build directory to avoid worrying about the
1126 # full pathname in the generated symbols.
1127 binary.txt: $(srcdir)/binary.in
1128         rm -f $@
1129         $(LN_S) $< $@
1131 check_SCRIPTS += ver_matching_test.sh
1132 check_DATA += ver_matching_test.stdout
1133 MOSTLYCLEANFILES += ver_matching_test.stdout
1134 ver_matching_def.so: ver_matching_def.cc $(srcdir)/version_script.map gcctestdir/ld
1135         $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
1136 ver_matching_test.stdout: ver_matching_def.so
1137         $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1139 check_PROGRAMS += script_test_3
1140 check_SCRIPTS += script_test_3.sh
1141 check_DATA += script_test_3.stdout
1142 MOSTLYCLEANFILES += script_test_3.stdout
1143 script_test_3: basic_test.o gcctestdir/ld script_test_3.t
1144         $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
1145 script_test_3.stdout: script_test_3
1146         $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
1148 check_PROGRAMS += tls_phdrs_script_test
1149 tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
1150 tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
1151 tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t
1152 tls_phdrs_script_test_LDADD = $(tls_test_LDADD)
1154 check_SCRIPTS += script_test_4.sh
1155 check_DATA += script_test_4.stdout
1156 MOSTLYCLEANFILES += script_test_4
1157 script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
1158         $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
1159 script_test_4.stdout: script_test_4
1160         $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
1162 check_PROGRAMS += tls_script_test
1163 tls_script_test_SOURCES = $(tls_test_SOURCES)
1164 tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t
1165 tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t
1166 tls_script_test_LDADD = $(tls_test_LDADD)
1168 check_SCRIPTS += script_test_5.sh
1169 check_DATA += script_test_5.stdout
1170 MOSTLYCLEANFILES += script_test_5
1171 script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
1172         $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t
1173 script_test_5.stdout: script_test_5
1174         $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
1176 check_SCRIPTS += script_test_6.sh
1177 check_DATA += script_test_6.stdout
1178 MOSTLYCLEANFILES += script_test_6
1179 script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t
1180         $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \
1181         -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000
1182 script_test_6.stdout: script_test_6
1183         $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout
1185 check_SCRIPTS += script_test_7.sh
1186 check_DATA += script_test_7.stdout
1187 MOSTLYCLEANFILES += script_test_7
1188 script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1189         $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t
1190 script_test_7.stdout: script_test_7
1191         $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout
1193 check_SCRIPTS += script_test_8.sh
1194 check_DATA += script_test_8.stdout
1195 MOSTLYCLEANFILES += script_test_8
1196 script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1197         $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \
1198         -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000
1199 script_test_8.stdout: script_test_8
1200         $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout
1203 check_SCRIPTS += script_test_9.sh
1204 check_DATA += script_test_9.stdout
1205 script_test_9.o: script_test_9.cc
1206         $(CXXCOMPILE) -O0 -c -o $@ $<
1207 script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
1208         $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t
1209 script_test_9.stdout: script_test_9
1210         $(TEST_READELF) -lW script_test_9 > script_test_9.stdout
1213 # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
1214 # and --dynamic-list-cpp-typeinfo
1216 check_SCRIPTS += dynamic_list.sh
1217 check_DATA += dynamic_list.stdout
1218 MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout
1219 dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
1220         $(CXXLINK) -Bgcctestdir/ basic_test.o \
1221           -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
1222           -Wl,--dynamic-list-data \
1223           -Wl,--dynamic-list-cpp-new \
1224           -Wl,--dynamic-list-cpp-typeinfo
1225 dynamic_list.stdout: dynamic_list
1226         $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout
1228 check_PROGRAMS += thin_archive_test_1
1229 MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
1230         alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
1231         alt/libthin2.a alt/libthin4.a
1232 thin_archive_test_1_SOURCES = thin_archive_main.cc
1233 thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
1234 thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
1235 thin_archive_test_1_LDADD = libthin1.a -lthin2
1237 check_PROGRAMS += thin_archive_test_2
1238 thin_archive_test_2_SOURCES = thin_archive_main.cc
1239 thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
1240 thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
1241 thin_archive_test_2_LDADD = -lthinall
1243 libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
1244         rm -f $@
1245         $(TEST_AR) crT $@ $^
1246 alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
1247         rm -f $@
1248         $(TEST_AR) crT $@ $^
1249 libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
1250         rm -f $@
1251         $(TEST_AR) crT $@ $^
1252 alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
1253         rm -f $@
1254         $(TEST_AR) crT $@ $^
1255 libthinall.a: libthin3.a alt/libthin4.a
1256         rm -f $@
1257         $(TEST_AR) crT $@ $^
1258 alt/thin_archive_test_2.o: thin_archive_test_2.cc
1259         test -d alt || mkdir -p alt
1260         $(CXXCOMPILE) -c -o $@ $<
1261 alt/thin_archive_test_4.o: thin_archive_test_4.cc
1262         test -d alt || mkdir -p alt
1263         $(CXXCOMPILE) -c -o $@ $<
1265 if PLUGINS
1267 check_PROGRAMS += plugin_test_1
1268 check_SCRIPTS += plugin_test_1.sh
1269 check_DATA += plugin_test_1.err
1270 MOSTLYCLEANFILES += plugin_test_1.err
1271 plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so
1272         $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err
1273 plugin_test_1.err: plugin_test_1
1274         @touch plugin_test_1.err
1276 check_PROGRAMS += plugin_test_2
1277 check_SCRIPTS += plugin_test_2.sh
1278 check_DATA += plugin_test_2.err
1279 MOSTLYCLEANFILES += plugin_test_2.err
1280 plugin_test_2: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so gcctestdir/ld plugin_test.so
1281         $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so 2>plugin_test_2.err
1282 plugin_test_2.err: plugin_test_2
1283         @touch plugin_test_2.err
1285 check_PROGRAMS += plugin_test_3
1286 check_SCRIPTS += plugin_test_3.sh
1287 check_DATA += plugin_test_3.err
1288 MOSTLYCLEANFILES += plugin_test_3.err
1289 plugin_test_3: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so
1290         $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_3.err
1291 plugin_test_3.err: plugin_test_3
1292         @touch plugin_test_3.err
1294 check_PROGRAMS += plugin_test_4
1295 check_SCRIPTS += plugin_test_4.sh
1296 check_DATA += plugin_test_4.err
1297 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
1298 plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
1299         $(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
1300 plugin_test_4.err: plugin_test_4
1301         @touch plugin_test_4.err
1303 plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
1304         $(TEST_AR) cr $@ $^
1306 check_PROGRAMS += plugin_test_5
1307 plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so
1308         $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms
1310 check_PROGRAMS += plugin_test_6
1311 check_SCRIPTS += plugin_test_6.sh
1312 check_DATA += plugin_test_6.err
1313 MOSTLYCLEANFILES += plugin_test_6.err
1314 plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so
1315         $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err
1316 plugin_test_6.err: plugin_test_6
1317         @touch plugin_test_6.err
1319 check_PROGRAMS += plugin_test_7
1320 check_SCRIPTS += plugin_test_7.sh
1321 check_DATA += plugin_test_7.err plugin_test_7.syms
1322 MOSTLYCLEANFILES += plugin_test_7.err
1323 plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
1324         $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.syms plugin_test_7_2.o 2>plugin_test_7.err
1325 plugin_test_7.syms: plugin_test_7
1326         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1327 plugin_test_7_1.o: plugin_test_7_1.c
1328         $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1329 plugin_test_7_1_orig.o: plugin_test_7_1.c
1330         $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1331 plugin_test_7_1.syms: plugin_test_7_1_orig.o
1332         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1333 plugin_test_7_2.o: plugin_test_7_2.c
1334         $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1335 plugin_test_7.err: plugin_test_7
1337 # Test plugins with -r.
1338 check_PROGRAMS += plugin_test_8
1339 plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so
1340         ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o
1341 plugin_test_8: plugin_test_8.o gcctestdir/ld
1342         $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o
1344 # Test that symbols known in the IR file but not in the replacement file
1345 # produce an unresolved symbol error.
1346 check_DATA += plugin_test_9.err
1347 MOSTLYCLEANFILES += plugin_test_9.err
1348 plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so
1349         @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms "2>$@"
1350         @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms 2>$@; then \
1351           echo 1>&2 "Link of plugin_test_9 should have failed"; \
1352           rm -f $@; \
1353           exit 1; \
1354         fi
1355 # Make a .syms file that claims to define the symbol _Z4t16av.
1356 two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o
1357         cp two_file_test_1.syms $@.tmp
1358         grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp
1359         mv -f $@.tmp $@
1360 # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
1361 MOSTLYCLEANFILES += two_file_test_1c.o
1362 two_file_test_1c.o: two_file_test_1.o
1363         cp two_file_test_1.o $@
1365 plugin_test.so: plugin_test.o
1366         $(LINK) -Bgcctestdir/ -shared plugin_test.o
1367 plugin_test.o: plugin_test.c
1368         $(COMPILE) -O0 -c -fpic -o $@ $<
1370 two_file_test_main.syms: two_file_test_main.o
1371         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1372 two_file_test_1.syms: two_file_test_1.o
1373         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1374 two_file_test_1b.syms: two_file_test_1b.o
1375         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1376 two_file_test_2.syms: two_file_test_2.o
1377         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1378 plugin_common_test_1.syms: plugin_common_test_1.o
1379         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1380 plugin_common_test_2.syms: plugin_common_test_2.o
1381         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1383 empty.syms:
1384         @echo "" >$@
1385         @echo "Symbol table" >>$@
1387 MOSTLYCLEANFILES += unused.c
1388 unused.syms: unused.o
1389         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1390         @echo "     1: 00000000     4 FUNC    GLOBAL DEFAULT    1 UNUSED" >>$@
1391 unused.o: unused.c
1392         $(COMPILE) -c -o $@ $<
1393 unused.c:
1394         @cp /dev/null $@
1396 endif PLUGINS
1398 check_PROGRAMS += exclude_libs_test
1399 check_SCRIPTS += exclude_libs_test.sh
1400 check_DATA += exclude_libs_test.syms
1401 MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
1402         libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1403 exclude_libs_test_SOURCES = exclude_libs_test.c
1404 exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
1405         libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1406 exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
1407         -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
1408         -Wl,--exclude-libs,libexclude_libs_test_3
1409 exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
1410         alt/libexclude_libs_test_3.a
1411 exclude_libs_test.syms: exclude_libs_test
1412         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1413 libexclude_libs_test_1.a: exclude_libs_test_1.o
1414         $(TEST_AR) rc $@ $^
1415 libexclude_libs_test_2.a: exclude_libs_test_2.o
1416         $(TEST_AR) rc $@ $^
1417 alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
1418         test -d alt || mkdir -p alt
1419         $(TEST_AR) rc $@ $^
1421 check_PROGRAMS += local_labels_test
1422 local_labels_test.o: ver_test_6.c
1423         $(COMPILE) -g -c -Wa,-L -o $@ $<
1424 local_labels_test: local_labels_test.o
1425         $(LINK) -Bgcctestdir/ local_labels_test.o
1427 check_PROGRAMS += discard_locals_test
1428 check_SCRIPTS += discard_locals_test.sh
1429 check_DATA += discard_locals_test.syms \
1430         discard_locals_relocatable_test1.syms \
1431         discard_locals_relocatable_test2.syms
1432 MOSTLYCLEANFILES += discard_locals_test.syms \
1433         discard_locals_relocatable_test1.syms \
1434         discard_locals_relocatable_test2.syms \
1435         discard_locals_relocatable_test1.out \
1436         discard_locals_relocatable_test2.out
1437 discard_locals_test_SOURCES = discard_locals_test.c
1438 discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
1439 discard_locals_test.syms: discard_locals_test
1440         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1441 # '-Wa,-L' is required to preserve the local label used for testing.
1442 discard_locals_test.o: discard_locals_test.c
1443         $(COMPILE) -c -Wa,-L -o $@ $<
1445 discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out
1446         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1447 discard_locals_relocatable_test.o: discard_locals_relocatable_test.c
1448         $(COMPILE) -c -Wa,-L -fPIC -o $@ $<
1449 discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new
1450         ../ld-new --discard-locals -relocatable -o $@ $<
1452 discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out
1453         $(TEST_READELF) -sW $< >$@ 2>/dev/null
1454 discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new
1455         ../ld-new --discard-all -relocatable -o $@ $<
1457 if MCMODEL_MEDIUM
1458 check_PROGRAMS += large
1459 large_SOURCES = large.c
1460 large_CFLAGS = -mcmodel=medium
1461 large_DEPENDENCIES = gcctestdir/ld
1462 large_LDFLAGS = -Bgcctestdir/
1463 large_LDADD =
1464 endif MCMODEL_MEDIUM
1466 # Test that hidden and internal symbols in the main program cannot be
1467 # referenced by a shared library.
1468 check_SCRIPTS += hidden_test.sh
1469 check_DATA += hidden_test.err
1470 MOSTLYCLEANFILES += hidden_test hidden_test.err
1471 libhidden.so: hidden_test_1.c gcctestdir/ld
1472         $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
1473 hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
1474         $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
1475 hidden_test.err: hidden_test
1476         @touch hidden_test.err
1478 # Test -retain-symbols-file.
1479 check_SCRIPTS += retain_symbols_file_test.sh
1480 check_DATA += retain_symbols_file_test.stdout
1481 MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
1482                     retain_symbols_file_test.stdout
1483 retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld
1484         echo 'main' > retain_symbols_file_test.in
1485         echo 't1' >> retain_symbols_file_test.in
1486         echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in
1487         echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
1488         echo '_Z3t18v' >> retain_symbols_file_test.in
1489         echo '__tcf_0' >> retain_symbols_file_test.in   
1490         $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
1491 retain_symbols_file_test.stdout: retain_symbols_file_test.so
1492         $(TEST_NM) -C retain_symbols_file_test.so > $@
1495 # Test that if the output file already exists and is empty,
1496 # it will get execute permission.
1497 check_PROGRAMS += permission_test
1498 permission_test: basic_test.o gcctestdir/ld
1499         umask 022; \
1500         rm -f $@; \
1501         touch $@; \
1502         chmod 600 $@; \
1503         $(CXXLINK) -Bgcctestdir/ basic_test.o
1505 # Check -l:foo.a
1506 check_PROGRAMS += searched_file_test
1507 MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
1508                     alt/searched_file_test_lib.a
1509 searched_file_test_SOURCES = searched_file_test.cc
1510 searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
1511 searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
1512 searched_file_test_LDADD = -l:searched_file_test_lib.a
1513 searched_file_test_lib.o: searched_file_test_lib.cc
1514         $(CXXCOMPILE) -c -o $@ $<
1515 alt/searched_file_test_lib.a: searched_file_test_lib.o
1516         test -d alt || mkdir -p alt
1517         $(TEST_AR) rc $@ $^
1519 # Test that no .gnu.version sections are created when 
1520 # symbol versioning is not used.
1521 check_SCRIPTS += no_version_test.sh
1522 check_DATA += no_version_test.stdout
1523 MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
1524 # We invoke the linker directly since gcc may include additional objects that
1525 # uses symbol versioning.
1526 libno_version_test.so: no_version_test.o gcctestdir/ld
1527         gcctestdir/ld -shared -o $@ no_version_test.o
1528 no_version_test.o: no_version_test.c
1529         $(COMPILE) -o $@ -c -fPIC $<
1530 no_version_test.stdout: libno_version_test.so
1531         $(TEST_OBJDUMP) -h $< > $@
1533 # Test STT_GNU_IFUNC symbols.
1534 if IFUNC
1536 ifuncmod1.o: ifuncmod1.c
1537         $(COMPILE) -c -fpic -o $@ $<
1538 ifuncmod1.so: ifuncmod1.o gcctestdir/ld
1539         $(LINK) -Bgcctestdir/ -shared ifuncmod1.o
1541 ifuncdep1.o: ifuncmod1.c
1542         $(COMPILE) -c -o $@ $<
1544 ifuncmain1pic.o: ifuncmain1.c
1545         $(COMPILE) -c -fpic -o $@ $<
1546 ifuncmain1pie.o: ifuncmain1.c
1547         $(COMPILE) -c -fpie -o $@ $<
1549 check_PROGRAMS += ifuncmain1static
1550 ifuncmain1static_SOURCES = ifuncmain1.c
1551 ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
1552 ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
1553 ifuncmain1static_LDADD = ifuncdep1.o
1555 check_PROGRAMS += ifuncmain1picstatic
1556 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
1557         $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
1559 check_PROGRAMS += ifuncmain1
1560 ifuncmain1_SOURCES = ifuncmain1.c
1561 ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
1562 ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1563 ifuncmain1_LDADD = ifuncmod1.so
1565 check_PROGRAMS += ifuncmain1pic
1566 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
1567         $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
1569 check_PROGRAMS += ifuncmain1vis
1570 ifuncmain1vis_SOURCES = ifuncmain1vis.c
1571 ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
1572 ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1573 ifuncmain1vis_LDADD = ifuncmod1.so
1575 check_PROGRAMS += ifuncmain1vispic
1576 ifuncmain1vispic.o: ifuncmain1vis.c
1577         $(COMPILE) -c -fpic -o $@ $<
1578 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
1579         $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
1581 check_PROGRAMS += ifuncmain1staticpic
1582 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
1583         $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
1585 check_PROGRAMS += ifuncmain1pie
1586 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
1587         $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
1589 check_PROGRAMS += ifuncmain1vispie
1590 ifuncmain1vispie.o: ifuncmain1vis.c
1591         $(COMPILE) -c -fpie -o $@ $<
1592 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
1593         $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
1595 check_PROGRAMS += ifuncmain1staticpie
1596 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
1597         $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
1599 ifuncmain2pic.o: ifuncmain2.c
1600         $(COMPILE) -c -fpic -o $@ $<
1602 ifuncdep2pic.o: ifuncdep2.c
1603         $(COMPILE) -c -fpic -o $@ $<
1605 check_PROGRAMS += ifuncmain2static
1606 ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
1607 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
1608 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
1610 check_PROGRAMS += ifuncmain2picstatic
1611 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
1612         $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
1614 check_PROGRAMS += ifuncmain2
1615 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
1616 ifuncmain2_DEPENDENCIES = gcctestdir/ld
1617 ifuncmain2_LDFLAGS = -Bgcctestdir/
1619 check_PROGRAMS += ifuncmain2pic
1620 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
1621         $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
1623 ifuncmod3.o: ifuncmod3.c
1624         $(COMPILE) -c -fpic -o $@ $<
1625 ifuncmod3.so: ifuncmod3.o gcctestdir/ld
1626         $(LINK) -Bgcctestdir/ -shared ifuncmod3.o
1628 check_PROGRAMS += ifuncmain3
1629 ifuncmain3_SOURCES = ifuncmain3.c
1630 ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
1631 ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
1632 ifuncmain3_LDADD = -ldl
1634 ifuncmain4pic.o: ifuncmain4.c
1635         $(COMPILE) -c -fpic -o $@ $<
1637 check_PROGRAMS += ifuncmain4static
1638 ifuncmain4static_SOURCES = ifuncmain4.c
1639 ifuncmain4static_DEPENDENCIES = gcctestdir/ld
1640 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
1642 check_PROGRAMS += ifuncmain4picstatic
1643 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
1644         $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
1646 check_PROGRAMS += ifuncmain4
1647 ifuncmain4_SOURCES = ifuncmain4.c
1648 ifuncmain4_DEPENDENCIES = gcctestdir/ld
1649 ifuncmain4_LDFLAGS = -Bgcctestdir/
1651 ifuncmain5pic.o: ifuncmain5.c
1652         $(COMPILE) -c -fpic -o $@ $<
1654 ifuncmain5pie.o: ifuncmain5.c
1655         $(COMPILE) -c -fpie -o $@ $<
1657 ifuncmod5.o: ifuncmod5.c
1658         $(COMPILE) -c -fpic -o $@ $<
1659 ifuncmod5.so: ifuncmod5.o gcctestdir/ld
1660         $(LINK) -Bgcctestdir/ -shared ifuncmod5.o
1662 ifuncdep5.o: ifuncmod5.c
1663         $(COMPILE) -c -o $@ $<
1665 check_PROGRAMS += ifuncmain5static
1666 ifuncmain5static_SOURCES = ifuncmain5.c
1667 ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
1668 ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
1669 ifuncmain5static_LDADD = ifuncdep5.o
1671 check_PROGRAMS += ifuncmain5picstatic
1672 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
1673         $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
1675 check_PROGRAMS += ifuncmain5
1676 ifuncmain5_SOURCES = ifuncmain5.c
1677 ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
1678 ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1679 ifuncmain5_LDADD = ifuncmod5.so
1681 check_PROGRAMS += ifuncmain5pic
1682 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
1683         $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
1685 check_PROGRAMS += ifuncmain5staticpic
1686 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
1687         $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
1689 check_PROGRAMS += ifuncmain5pie
1690 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
1691         $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
1693 ifuncmain6pie.o: ifuncmain6pie.c
1694         $(COMPILE) -c -fpie -o $@ $<
1696 ifuncmod6.o: ifuncmod6.c
1697         $(COMPILE) -c -fpic -o $@ $<
1698 ifuncmod6.so: ifuncmod6.o gcctestdir/ld
1699         $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
1701 check_PROGRAMS += ifuncmain6pie
1702 ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
1703         $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
1705 ifuncmain7pic.o: ifuncmain7.c
1706         $(COMPILE) -c -fpic -o $@ $<
1708 ifuncmain7pie.o: ifuncmain7.c
1709         $(COMPILE) -c -fpie -o $@ $<
1711 check_PROGRAMS += ifuncmain7static
1712 ifuncmain7static_SOURCES = ifuncmain7.c
1713 ifuncmain7static_DEPENDENCIES = gcctestdir/ld
1714 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
1716 check_PROGRAMS += ifuncmain7picstatic
1717 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
1718         $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
1720 check_PROGRAMS += ifuncmain7
1721 ifuncmain7_SOURCES = ifuncmain7.c
1722 ifuncmain7_DEPENDENCIES = gcctestdir/ld
1723 ifuncmain7_LDFLAGS = -Bgcctestdir/
1725 check_PROGRAMS += ifuncmain7pic
1726 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
1727         $(LINK) -Bgcctestdir/ ifuncmain7pic.o
1729 check_PROGRAMS += ifuncmain7pie
1730 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
1731         $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
1733 endif IFUNC
1735 # Test that strong reference to a weak symbol in a DSO remains strong.
1736 check_SCRIPTS += strong_ref_weak_def.sh
1737 check_DATA += strong_ref_weak_def.stdout
1738 MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
1739         strong_ref_weak_def.stdout
1740 strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
1741         $(COMPILE) -o $@ -c -fPIC $<
1742 strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
1743         gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
1744 strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
1745         $(COMPILE) -o $@ -c -fPIC $<
1746 strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
1747         gcctestdir/ld
1748         gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
1749                 strong_ref_weak_def_2.so
1750 strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
1751         $(TEST_READELF) -sWD $< > $@
1753 # Test that a strong weak reference remains strong if there is another
1754 # weak reference in a DSO.
1755 check_SCRIPTS += dyn_weak_ref.sh
1756 check_DATA += dyn_weak_ref.stdout
1757 MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
1758         dyn_weak_ref.stdout
1759 dyn_weak_ref_2.o: dyn_weak_ref_2.c
1760         $(COMPILE) -o $@ -c -fPIC $<
1761 dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
1762         gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
1763 dyn_weak_ref_1.o: dyn_weak_ref_1.c
1764         $(COMPILE) -o $@ -c -fPIC $<
1765 # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
1766 # so that the weak ref there goes to gold's symbol table first.
1767 dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
1768         gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
1769 dyn_weak_ref.stdout: dyn_weak_ref_1.so
1770         $(TEST_READELF) -sWD $< > $@
1773 # Test that --start-lib and --end-lib function correctly.
1774 check_PROGRAMS += start_lib_test
1775 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
1776         gcctestdir/ld
1777         $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
1778                 -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib
1779 libstart_lib_test.a: start_lib_test_1.o
1780         $(TEST_AR) rc $@ $^
1782 # Test that MEMORY region support works.
1783 check_SCRIPTS += memory_test.sh
1784 check_DATA += memory_test.stdout
1785 MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o
1786 memory_test: memory_test.s
1787         $(COMPILE) -c $< -o memory_test.o
1788         $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o
1789 memory_test.stdout: memory_test
1790         $(TEST_READELF) -lWS  $< > $@
1792 endif GCC
1793 endif NATIVE_LINKER
1795 # These tests work with cross linkers.
1797 if DEFAULT_TARGET_I386
1799 check_SCRIPTS += split_i386.sh
1800 check_DATA += split_i386_1.stdout split_i386_2.stdout \
1801         split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
1802 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
1803 split_i386_1.o: split_i386_1.s
1804         $(TEST_AS) -o $@ $<
1805 split_i386_2.o: split_i386_2.s
1806         $(TEST_AS) -o $@ $<
1807 split_i386_3.o: split_i386_3.s
1808         $(TEST_AS) -o $@ $<
1809 split_i386_4.o: split_i386_4.s
1810         $(TEST_AS) -o $@ $<
1811 split_i386_n.o: split_i386_n.s
1812         $(TEST_AS) -o $@ $<
1813 split_i386_1: split_i386_1.o split_i386_n.o ../ld-new
1814         ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o
1815 split_i386_1.stdout: split_i386_1
1816         $(TEST_OBJDUMP) -d $< > $@
1817 split_i386_2: split_i386_2.o split_i386_n.o ../ld-new
1818         ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o
1819 split_i386_2.stdout: split_i386_2
1820         $(TEST_OBJDUMP) -d $< > $@
1821 split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new
1822         ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0
1823 split_i386_4: split_i386_4.o split_i386_n.o ../ld-new
1824         ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o
1825 split_i386_4.stdout: split_i386_4
1826         $(TEST_OBJDUMP) -d $< > $@
1827 split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new
1828         ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0
1829 MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \
1830         split_i386_4 split_i386_r
1832 endif DEFAULT_TARGET_I386
1834 if DEFAULT_TARGET_X86_64
1836 check_SCRIPTS += split_x86_64.sh
1837 check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \
1838         split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
1839 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
1840 split_x86_64_1.o: split_x86_64_1.s
1841         $(TEST_AS) -o $@ $<
1842 split_x86_64_2.o: split_x86_64_2.s
1843         $(TEST_AS) -o $@ $<
1844 split_x86_64_3.o: split_x86_64_3.s
1845         $(TEST_AS) -o $@ $<
1846 split_x86_64_4.o: split_x86_64_4.s
1847         $(TEST_AS) -o $@ $<
1848 split_x86_64_n.o: split_x86_64_n.s
1849         $(TEST_AS) -o $@ $<
1850 split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new
1851         ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o
1852 split_x86_64_1.stdout: split_x86_64_1
1853         $(TEST_OBJDUMP) -d $< > $@
1854 split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new
1855         ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o
1856 split_x86_64_2.stdout: split_x86_64_2
1857         $(TEST_OBJDUMP) -d $< > $@
1858 split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new
1859         ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0
1860 split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new
1861         ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o
1862 split_x86_64_4.stdout: split_x86_64_4
1863         $(TEST_OBJDUMP) -d $< > $@
1864 split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
1865         ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0
1866 MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
1867         split_x86_64_4 split_x86_64_r
1869 endif DEFAULT_TARGET_X86_64
1871 if DEFAULT_TARGET_ARM
1873 check_SCRIPTS += arm_abs_global.sh
1874 check_DATA += arm_abs_global.stdout
1875 arm_abs_lib.o: arm_abs_lib.s
1876         $(TEST_AS) -march=armv7-a -o $@ $<
1877 libarm_abs.so: arm_abs_lib.o ../ld-new
1878         ../ld-new -shared -o $@ arm_abs_lib.o
1879 arm_abs_global.o: arm_abs_global.s
1880         $(TEST_AS) -march=armv7-a -o $@ $<
1881 arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new
1882         ../ld-new -o $@ arm_abs_global.o -L. -larm_abs
1883 arm_abs_global.stdout: arm_abs_global
1884         $(TEST_READELF) -r $< > $@
1886 MOSTLYCLEANFILES += arm_abs_global
1888 check_SCRIPTS += arm_branch_in_range.sh
1889 check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \
1890         thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \
1891         thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \
1892         thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \
1893         thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout
1895 arm_bl_in_range.stdout: arm_bl_in_range
1896         $(TEST_OBJDUMP) -D $< > $@
1898 arm_bl_in_range: arm_bl_in_range.o ../ld-new
1899         ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
1901 arm_bl_in_range.o: arm_bl_in_range.s
1902         $(TEST_AS) -o $@ $<
1904 arm_bl_out_of_range.stdout: arm_bl_out_of_range
1905         $(TEST_OBJDUMP) -S $< > $@
1907 arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new
1908         ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
1910 arm_bl_out_of_range.o: arm_bl_out_of_range.s
1911         $(TEST_AS) -o $@ $<
1913 thumb_bl_in_range.stdout: thumb_bl_in_range
1914         $(TEST_OBJDUMP) -D $< > $@
1916 thumb_bl_in_range: thumb_bl_in_range.o ../ld-new
1917         ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1919 thumb_bl_in_range.o: thumb_bl_in_range.s
1920         $(TEST_AS) -o $@ -march=armv5te $<
1922 thumb_bl_out_of_range.stdout: thumb_bl_out_of_range
1923         $(TEST_OBJDUMP) -D $< > $@
1925 thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new
1926         ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1928 thumb_bl_out_of_range.o: thumb_bl_out_of_range.s
1929         $(TEST_AS) -o $@ -march=armv5te $<
1931 thumb2_bl_in_range.stdout: thumb2_bl_in_range
1932         $(TEST_OBJDUMP) -D $< > $@
1934 thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new
1935         ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
1937 thumb2_bl_in_range.o: thumb_bl_in_range.s
1938         $(TEST_AS) -o $@ -march=armv7-a $<
1940 thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range
1941         $(TEST_OBJDUMP) -D $< > $@
1943 thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new
1944         ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
1946 thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s
1947         $(TEST_AS) -o $@ -march=armv7-a $<
1949 thumb_blx_in_range.stdout: thumb_blx_in_range
1950         $(TEST_OBJDUMP) -D $< > $@
1952 thumb_blx_in_range: thumb_blx_in_range.o ../ld-new
1953         ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1955 thumb_blx_in_range.o: thumb_blx_in_range.s
1956         $(TEST_AS) -o $@ -march=armv5te $<
1958 thumb_blx_out_of_range.stdout: thumb_blx_out_of_range
1959         $(TEST_OBJDUMP) -D $< > $@
1961 thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new
1962         ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1964 thumb_blx_out_of_range.o: thumb_blx_out_of_range.s
1965         $(TEST_AS) -o $@ -march=armv5te $<
1967 thumb2_blx_in_range.stdout: thumb2_blx_in_range
1968         $(TEST_OBJDUMP) -D $< > $@
1970 thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new
1971         ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
1973 thumb2_blx_in_range.o: thumb_blx_in_range.s
1974         $(TEST_AS) -o $@ -march=armv7-a $<
1976 thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range
1977         $(TEST_OBJDUMP) -D $< > $@
1979 thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new
1980         ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
1982 thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s
1983         $(TEST_AS) -o $@ -march=armv7-a $<
1985 MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \
1986         thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \
1987         thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \
1988         thumb2_blx_out_of_range
1990 check_SCRIPTS += arm_fix_v4bx.sh
1991 check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \
1992         arm_no_fix_v4bx.stdout
1994 arm_fix_v4bx.stdout: arm_fix_v4bx
1995         $(TEST_OBJDUMP) -D -j.text $< > $@
1997 arm_fix_v4bx: arm_fix_v4bx.o ../ld-new
1998         ../ld-new --fix-v4bx -o $@ $<
2000 arm_fix_v4bx.o: arm_fix_v4bx.s
2001         $(TEST_AS) -o $@ $<
2003 arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking
2004         $(TEST_OBJDUMP) -D -j.text $< > $@
2006 arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new
2007         ../ld-new --fix-v4bx-interworking -o $@ $<
2009 arm_no_fix_v4bx.stdout: arm_no_fix_v4bx
2010         $(TEST_OBJDUMP) -D -j.text $< > $@
2012 arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new
2013         ../ld-new -o $@ $<
2015 MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx
2017 check_SCRIPTS += arm_attr_merge.sh
2018 check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
2019         arm_attr_merge_7.stdout
2021 arm_attr_merge_6.stdout: arm_attr_merge_6
2022         $(TEST_READELF) -A $< > $@
2024 arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o
2025         ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
2027 arm_attr_merge_6a.o: arm_attr_merge_6a.s
2028         $(TEST_AS) -o $@ $<
2030 arm_attr_merge_6b.o: arm_attr_merge_6b.s
2031         $(TEST_AS) -o $@ $<
2033 arm_attr_merge_6r.stdout: arm_attr_merge_6r
2034         $(TEST_READELF) -A $< > $@
2036 arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o
2037         ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
2039 arm_attr_merge_7.stdout: arm_attr_merge_7
2040         $(TEST_READELF) -A $< > $@
2042 arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o
2043         ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
2045 arm_attr_merge_7a.o: arm_attr_merge_7a.s
2046         $(TEST_AS) -o $@ $<
2048 arm_attr_merge_7b.o: arm_attr_merge_7b.s
2049         $(TEST_AS) -o $@ $<
2051 MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7
2053 endif DEFAULT_TARGET_ARM