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
13 AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants
14 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants
17 -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
18 -I$(srcdir)/../../elfcpp -I.. \
19 -DLOCALEDIR="\"$(datadir)/locale\"" \
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
35 THREADSLIB = -lpthread
39 TLS_TEST_C_CFLAGS = -fopenmp
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.
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
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 if NATIVE_OR_CROSS_LINKER
76 # Infrastucture needed for the unittests: a directory where the linker
77 # is named 'ld'. This is because the -B flag appends 'ld' to its arg.
78 gcctestdir/ld: ../ld-new
79 test -d gcctestdir || mkdir -p gcctestdir
81 (cd gcctestdir && $(LN_S) ../../ld-new ld)
85 check_PROGRAMS += object_unittest
86 object_unittest_SOURCES = object_unittest.cc
88 check_PROGRAMS += binary_unittest
89 binary_unittest_SOURCES = binary_unittest.cc
91 endif NATIVE_OR_CROSS_LINKER
93 # ---------------------------------------------------------------------
94 # These tests test the output of gold (end-to-end tests). In
95 # particular, they make sure that gold can link "difficult" object
96 # files, and the resulting object files run correctly. These can only
97 # run if we've built ld-new for the native architecture (that is,
98 # we're not cross-compiling it), since we run ld-new as part of these
99 # tests. We use the gcc-specific flag '-B' to use our linker instead
100 # of the default linker, which is why we only run our tests under gcc.
105 # Each of these .o's is a useful, small complete program. They're
106 # particularly useful for making sure ld-new's flags do what they're
107 # supposed to (hence their names), but are used for many tests that
108 # don't actually involve analyzing input data.
109 flagstest_debug.o: constructor_test.cc
110 $(CXXCOMPILE) -O0 -g -c -o $@ $<
111 flagstest_ndebug.o: constructor_test.cc
112 $(CXXCOMPILE) -O0 -c -o $@ $<
114 check_SCRIPTS += incremental_test.sh
115 check_DATA += incremental_test.stdout
116 MOSTLYCLEANFILES += incremental_test
117 incremental_test_1.o: incremental_test_1.c
118 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
119 incremental_test_2.o: incremental_test_2.c
120 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
121 incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
122 $(LINK) -Bgcctestdir/ -Wl,--incremental-full incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
123 incremental_test.stdout: incremental_test ../incremental-dump
124 ../incremental-dump incremental_test > $@
126 check_SCRIPTS += gc_comdat_test.sh
127 check_DATA += gc_comdat_test.stdout
128 MOSTLYCLEANFILES += gc_comdat_test
129 gc_comdat_test_1.o: gc_comdat_test_1.cc
130 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
131 gc_comdat_test_2.o: gc_comdat_test_2.cc
132 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
133 gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
134 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
135 gc_comdat_test.stdout: gc_comdat_test
136 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
138 check_SCRIPTS += gc_tls_test.sh
139 check_DATA += gc_tls_test.stdout
140 MOSTLYCLEANFILES += gc_tls_test
141 gc_tls_test.o: gc_tls_test.cc
142 $(CXXCOMPILE) -O0 -c -g -o $@ $<
143 gc_tls_test:gc_tls_test.o gcctestdir/ld
144 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
145 gc_tls_test.stdout: gc_tls_test
146 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
148 check_SCRIPTS += gc_orphan_section_test.sh
149 check_DATA += gc_orphan_section_test.stdout
150 MOSTLYCLEANFILES += gc_orphan_section_test
151 gc_orphan_section_test.o: gc_orphan_section_test.cc
152 $(CXXCOMPILE) -O0 -c -g -o $@ $<
153 gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
154 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o
155 gc_orphan_section_test.stdout: gc_orphan_section_test
156 $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout
158 check_SCRIPTS += icf_test.sh
159 check_DATA += icf_test.stdout
160 MOSTLYCLEANFILES += icf_test
161 icf_test.o: icf_test.cc
162 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
163 icf_test: icf_test.o gcctestdir/ld
164 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_test.o
165 icf_test.stdout: icf_test
166 $(TEST_NM) -C icf_test > icf_test.stdout
168 check_SCRIPTS += icf_keep_unique_test.sh
169 check_DATA += icf_keep_unique_test.stdout
170 MOSTLYCLEANFILES += icf_keep_unique_test
171 icf_keep_unique_test.o: icf_keep_unique_test.cc
172 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
173 icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
174 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
175 icf_keep_unique_test.stdout: icf_keep_unique_test
176 $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout
178 check_SCRIPTS += icf_safe_test.sh
179 check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout
180 MOSTLYCLEANFILES += icf_safe_test
181 icf_safe_test.o: icf_safe_test.cc
182 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
183 icf_safe_test: icf_safe_test.o gcctestdir/ld
184 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_test.o
185 icf_safe_test_1.stdout: icf_safe_test
186 $(TEST_NM) icf_safe_test > icf_safe_test_1.stdout
187 icf_safe_test_2.stdout: icf_safe_test
188 $(TEST_READELF) -h icf_safe_test > icf_safe_test_2.stdout
190 check_SCRIPTS += icf_safe_so_test.sh
191 check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout
192 MOSTLYCLEANFILES += icf_safe_so_test
193 icf_safe_so_test.o: icf_safe_so_test.cc
194 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
195 icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
196 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_so_test.o -fPIC -shared
197 icf_safe_so_test_1.stdout: icf_safe_so_test
198 $(TEST_NM) icf_safe_so_test > icf_safe_so_test_1.stdout
199 icf_safe_so_test_2.stdout: icf_safe_so_test
200 $(TEST_READELF) -h icf_safe_so_test > icf_safe_so_test_2.stdout
202 check_SCRIPTS += final_layout.sh
203 check_DATA += final_layout.stdout
204 MOSTLYCLEANFILES += final_layout
205 final_layout.o: final_layout.cc
206 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
207 final_layout_sequence.txt:
208 (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
209 final_layout: final_layout.o final_layout_sequence.txt gcctestdir/ld
210 $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt final_layout.o
211 final_layout.stdout: final_layout
212 $(TEST_NM) final_layout > final_layout.stdout
214 check_PROGRAMS += icf_virtual_function_folding_test
215 MOSTLYCLEANFILES += icf_virtual_function_folding_test
216 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
217 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
218 icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld
219 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie
221 check_SCRIPTS += icf_preemptible_functions_test.sh
222 check_DATA += icf_preemptible_functions_test.stdout
223 MOSTLYCLEANFILES += icf_preemptible_functions_test
224 icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
225 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
226 icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
227 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared
228 icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
229 $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout
231 check_SCRIPTS += icf_string_merge_test.sh
232 check_DATA += icf_string_merge_test.stdout
233 MOSTLYCLEANFILES += icf_string_merge_test
234 icf_string_merge_test.o: icf_string_merge_test.cc
235 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
236 icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
237 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o
238 icf_string_merge_test.stdout: icf_string_merge_test
239 $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
241 check_SCRIPTS += icf_sht_rel_addend_test.sh
242 check_DATA += icf_sht_rel_addend_test.stdout
243 MOSTLYCLEANFILES += icf_sht_rel_addend_test
244 icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
245 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
246 icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
247 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
248 icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
249 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
250 icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
251 $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
253 check_PROGRAMS += basic_test
254 check_PROGRAMS += basic_static_test
255 check_PROGRAMS += basic_pic_test
256 check_PROGRAMS += basic_static_pic_test
257 basic_test.o: basic_test.cc
258 $(CXXCOMPILE) -O0 -c -o $@ $<
259 basic_test: basic_test.o gcctestdir/ld
260 $(CXXLINK) -Bgcctestdir/ basic_test.o
261 basic_static_test: basic_test.o gcctestdir/ld
262 $(CXXLINK) -Bgcctestdir/ -static basic_test.o
264 basic_pic_test.o: basic_test.cc
265 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
266 basic_pic_test: basic_pic_test.o gcctestdir/ld
267 $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
268 basic_static_pic_test: basic_pic_test.o gcctestdir/ld
269 $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
271 check_PROGRAMS += basic_pie_test
272 basic_pie_test.o: basic_test.cc
273 $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
274 basic_pie_test: basic_pie_test.o gcctestdir/ld
275 $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o
277 check_PROGRAMS += constructor_test
278 check_PROGRAMS += constructor_static_test
279 constructor_test_SOURCES = constructor_test.cc
280 constructor_test_DEPENDENCIES = gcctestdir/ld
281 constructor_test_LDFLAGS = -Bgcctestdir/
282 constructor_test_LDADD =
284 constructor_static_test_SOURCES = $(constructor_test_SOURCES)
285 constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
286 constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
287 constructor_static_test_LDADD = $(constructor_test_LDADD)
290 check_PROGRAMS += two_file_test
291 check_PROGRAMS += two_file_static_test
292 check_PROGRAMS += two_file_pic_test
293 two_file_test_SOURCES = \
295 two_file_test_1b.cc \
297 two_file_test_main.cc \
299 two_file_test_DEPENDENCIES = gcctestdir/ld
300 two_file_test_LDFLAGS = -Bgcctestdir/
301 two_file_test_LDADD =
303 two_file_static_test_SOURCES = $(two_file_test_SOURCES)
304 two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
305 two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
306 two_file_static_test_LDADD = $(two_file_test_LDADD)
308 two_file_pic_test_SOURCES = two_file_test_main.cc
309 two_file_pic_test_DEPENDENCIES = \
310 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
311 two_file_pic_test_LDFLAGS = -Bgcctestdir/
312 two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
315 check_PROGRAMS += two_file_shared_1_test
316 check_PROGRAMS += two_file_shared_2_test
317 check_PROGRAMS += two_file_shared_1_pic_2_test
318 check_PROGRAMS += two_file_shared_2_pic_1_test
319 check_PROGRAMS += two_file_same_shared_test
320 check_PROGRAMS += two_file_separate_shared_12_test
321 check_PROGRAMS += two_file_separate_shared_21_test
322 two_file_test_1_pic.o: two_file_test_1.cc
323 $(CXXCOMPILE) -c -fpic -o $@ $<
324 two_file_test_1b_pic.o: two_file_test_1b.cc
325 $(CXXCOMPILE) -c -fpic -o $@ $<
326 two_file_test_2_pic.o: two_file_test_2.cc
327 $(CXXCOMPILE) -c -fpic -o $@ $<
328 two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
329 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
330 two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
331 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
332 two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
333 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
335 two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
336 two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
337 two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
338 two_file_shared_1_test_LDADD = two_file_shared_1.so
340 two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
341 two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
342 two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
343 two_file_shared_2_test_LDADD = two_file_shared_2.so
345 two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
346 two_file_shared_1_pic_2_test_DEPENDENCIES = \
347 gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o
348 two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
349 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
351 two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
352 two_file_shared_2_pic_1_test_DEPENDENCIES = \
353 gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
354 two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
355 two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
357 two_file_same_shared_test_SOURCES = two_file_test_main.cc
358 two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
359 two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
360 two_file_same_shared_test_LDADD = two_file_shared.so
362 two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
363 two_file_separate_shared_12_test_DEPENDENCIES = \
364 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
365 two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
366 two_file_separate_shared_12_test_LDADD = \
367 two_file_shared_1.so two_file_shared_2.so
369 two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
370 two_file_separate_shared_21_test_DEPENDENCIES = \
371 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
372 two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
373 two_file_separate_shared_21_test_LDADD = \
374 two_file_shared_2.so two_file_shared_1.so
376 check_PROGRAMS += two_file_relocatable_test
377 two_file_relocatable_test_SOURCES = two_file_test_main.cc
378 two_file_relocatable_test_DEPENDENCIES = \
379 gcctestdir/ld two_file_relocatable.o
380 two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
381 two_file_relocatable_test_LDADD = two_file_relocatable.o
382 two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
383 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
385 check_PROGRAMS += two_file_pie_test
386 two_file_test_1_pie.o: two_file_test_1.cc
387 $(CXXCOMPILE) -c -fpie -o $@ $<
388 two_file_test_1b_pie.o: two_file_test_1b.cc
389 $(CXXCOMPILE) -c -fpie -o $@ $<
390 two_file_test_2_pie.o: two_file_test_2.cc
391 $(CXXCOMPILE) -c -fpie -o $@ $<
392 two_file_test_main_pie.o: two_file_test_main.cc
393 $(CXXCOMPILE) -c -fpie -o $@ $<
394 two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
395 two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
396 $(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
398 check_SCRIPTS += two_file_shared.sh
399 check_DATA += two_file_shared.dbg
400 MOSTLYCLEANFILES += two_file_shared.dbg
401 two_file_shared.dbg: two_file_shared.so
402 $(TEST_READELF) -w $< >$@ 2>/dev/null
404 # The nonpic tests will fail on platforms which can not put non-PIC
405 # code into shared libraries, so we just don't run them in that case.
406 if FN_PTRS_IN_SO_WITHOUT_PIC
408 check_PROGRAMS += two_file_shared_1_nonpic_test
409 check_PROGRAMS += two_file_shared_2_nonpic_test
410 check_PROGRAMS += two_file_same_shared_nonpic_test
411 check_PROGRAMS += two_file_separate_shared_12_nonpic_test
412 check_PROGRAMS += two_file_separate_shared_21_nonpic_test
413 check_PROGRAMS += two_file_mixed_shared_test
414 check_PROGRAMS += two_file_mixed_2_shared_test
415 two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
416 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
417 two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
418 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
419 two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
420 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
421 two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
422 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
423 two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
424 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so
426 two_file_shared_1_nonpic_test_SOURCES = \
427 two_file_test_2.cc two_file_test_main.cc
428 two_file_shared_1_nonpic_test_DEPENDENCIES = \
429 gcctestdir/ld two_file_shared_1_nonpic.so
430 two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
431 two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
433 two_file_shared_2_nonpic_test_SOURCES = \
434 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
435 two_file_shared_2_nonpic_test_DEPENDENCIES = \
436 gcctestdir/ld two_file_shared_2_nonpic.so
437 two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
438 two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
440 two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
441 two_file_same_shared_nonpic_test_DEPENDENCIES = \
442 gcctestdir/ld two_file_shared_nonpic.so
443 two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
444 two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
446 two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
447 two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
448 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
449 two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
450 two_file_separate_shared_12_nonpic_test_LDADD = \
451 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
453 two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
454 two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
455 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
456 two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
457 two_file_separate_shared_21_nonpic_test_LDADD = \
458 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
460 two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
461 two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
462 two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
463 two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
465 two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
466 two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
467 two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
468 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
470 check_PROGRAMS += two_file_mixed_pie_test
471 two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
472 two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
473 $(CXXLINK) -Bgcctestdir/ -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so
475 endif FN_PTRS_IN_SO_WITHOUT_PIC
477 check_PROGRAMS += two_file_strip_test
478 two_file_strip_test: two_file_test
479 $(TEST_STRIP) -o two_file_strip_test two_file_test
481 check_PROGRAMS += two_file_same_shared_strip_test
482 two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
483 two_file_same_shared_strip_test_DEPENDENCIES = \
484 gcctestdir/ld two_file_shared_strip.so
485 two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
486 two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
487 two_file_shared_strip.so: two_file_shared.so
488 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
490 check_PROGRAMS += common_test_1
491 common_test_1_SOURCES = common_test_1.c
492 common_test_1_DEPENDENCIES = gcctestdir/ld
493 common_test_1_LDFLAGS = -Bgcctestdir/
494 common_test_1_LDADD =
496 check_PROGRAMS += common_test_2
497 common_test_2_SOURCES = common_test_1.c
498 common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
499 common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
500 common_test_2_LDADD = common_test_2.so common_test_3.so
501 common_test_2_pic.o: common_test_2.c
502 $(COMPILE) -c -fpic -o $@ $<
503 common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld
504 $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so
505 common_test_3_pic.o: common_test_3.c
506 $(COMPILE) -c -fpic -o $@ $<
507 common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld
508 $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script
510 check_PROGRAMS += exception_test
511 check_PROGRAMS += exception_static_test
512 check_PROGRAMS += exception_shared_1_test
513 check_PROGRAMS += exception_shared_2_test
514 check_PROGRAMS += exception_same_shared_test
515 check_PROGRAMS += exception_separate_shared_12_test
516 check_PROGRAMS += exception_separate_shared_21_test
517 exception_test_1_pic.o: exception_test_1.cc
518 $(CXXCOMPILE) -c -fpic -o $@ $<
519 exception_test_2_pic.o: exception_test_2.cc
520 $(CXXCOMPILE) -c -fpic -o $@ $<
521 exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
522 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
523 exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
524 $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
525 exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
526 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
528 exception_test_SOURCES = \
529 exception_test_main.cc \
530 exception_test_1.cc \
531 exception_test_2.cc \
533 exception_test_DEPENDENCIES = gcctestdir/ld
534 exception_test_LDFLAGS = -Bgcctestdir/
535 exception_test_LDADD =
537 exception_static_test_SOURCES = $(exception_test_SOURCES)
538 exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
539 exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
540 exception_static_test_LDADD = $(exception_test_LDADD)
542 exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
543 exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
544 exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
545 exception_shared_1_test_LDADD = exception_shared_1.so
547 exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
548 exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
549 exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
550 exception_shared_2_test_LDADD = exception_shared_2.so
552 exception_same_shared_test_SOURCES = exception_test_main.cc
553 exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
554 exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
555 exception_same_shared_test_LDADD = exception_shared.so
557 exception_separate_shared_12_test_SOURCES = exception_test_main.cc
558 exception_separate_shared_12_test_DEPENDENCIES = \
559 gcctestdir/ld exception_shared_1.so exception_shared_2.so
560 exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
561 exception_separate_shared_12_test_LDADD = \
562 exception_shared_1.so exception_shared_2.so
564 exception_separate_shared_21_test_SOURCES = exception_test_main.cc
565 exception_separate_shared_21_test_DEPENDENCIES = \
566 gcctestdir/ld exception_shared_1.so exception_shared_2.so
567 exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
568 exception_separate_shared_21_test_LDADD = \
569 exception_shared_2.so exception_shared_1.so
572 check_PROGRAMS += weak_test
573 weak_test_SOURCES = weak_test.cc
574 weak_test_DEPENDENCIES = gcctestdir/ld
575 weak_test_LDFLAGS = -Bgcctestdir/
578 check_PROGRAMS += weak_undef_test
579 MOSTLYCLEANFILES += alt/weak_undef_lib.so
580 weak_undef_test_SOURCES = weak_undef_test.cc
581 weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
582 weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
583 weak_undef_test_LDADD = -L . weak_undef_lib.so
584 weak_undef_file1.o: weak_undef_file1.cc
585 $(CXXCOMPILE) -c -fpic -o $@ $<
586 weak_undef_file2.o: weak_undef_file2.cc
587 $(CXXCOMPILE) -c -fpic -o $@ $<
588 weak_undef_lib.so: weak_undef_file1.o
589 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
590 alt/weak_undef_lib.so: weak_undef_file2.o
591 test -d alt || mkdir -p alt
592 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
594 if FN_PTRS_IN_SO_WITHOUT_PIC
595 check_PROGRAMS += weak_undef_nonpic_test
596 MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so
597 weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
598 weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
599 weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
600 weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
601 weak_undef_file1_nonpic.o: weak_undef_file1.cc
602 $(CXXCOMPILE) -c -o $@ $<
603 weak_undef_file2_nonpic.o: weak_undef_file2.cc
604 $(CXXCOMPILE) -c -o $@ $<
605 weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
606 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
607 alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
608 test -d alt || mkdir -p alt
609 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
610 endif FN_PTRS_IN_SO_WITHOUT_PIC
613 check_PROGRAMS += weak_alias_test
614 weak_alias_test_SOURCES = weak_alias_test_main.cc
615 weak_alias_test_DEPENDENCIES = \
616 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
617 weak_alias_test_3.o weak_alias_test_4.so
618 weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
619 weak_alias_test_LDADD = \
620 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
622 weak_alias_test_1_pic.o: weak_alias_test_1.cc
623 $(CXXCOMPILE) -c -fpic -o $@ $<
624 weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
625 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
626 weak_alias_test_2_pic.o: weak_alias_test_2.cc
627 $(CXXCOMPILE) -c -fpic -o $@ $<
628 weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
629 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
630 weak_alias_test_3.o: weak_alias_test_3.cc
631 $(CXXCOMPILE) -c -o $@ $<
632 weak_alias_test_4_pic.o: weak_alias_test_4.cc
633 $(CXXCOMPILE) -c -fpic -o $@ $<
634 weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
635 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
637 check_SCRIPTS += weak_plt.sh
638 check_PROGRAMS += weak_plt
639 check_DATA += weak_plt_shared.so
640 weak_plt_main_pic.o: weak_plt_main.cc
641 $(CXXCOMPILE) -c -fpic -o $@ $<
642 weak_plt: weak_plt_main_pic.o gcctestdir/ld
643 $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
644 weak_plt_shared_pic.o: weak_plt_shared.cc
645 $(CXXCOMPILE) -c -fpic -o $@ $<
646 weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
647 $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
649 check_PROGRAMS += copy_test
650 copy_test_SOURCES = copy_test.cc
651 copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
652 copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
653 copy_test_LDADD = copy_test_1.so copy_test_2.so
654 copy_test_1_pic.o: copy_test_1.cc
655 $(CXXCOMPILE) -c -fpic -o $@ $<
656 copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
657 $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
658 copy_test_2_pic.o: copy_test_2.cc
659 $(CXXCOMPILE) -c -fpic -o $@ $<
660 copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
661 $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
665 check_PROGRAMS += tls_test
666 check_PROGRAMS += tls_pic_test
667 check_PROGRAMS += tls_pie_test
668 check_PROGRAMS += tls_pie_pic_test
669 check_PROGRAMS += tls_shared_test
670 check_PROGRAMS += tls_shared_ie_test
671 check_PROGRAMS += tls_shared_gd_to_ie_test
672 tls_test_pic.o: tls_test.cc
673 $(CXXCOMPILE) -c -fpic -o $@ $<
674 tls_test_file2_pic.o: tls_test_file2.cc
675 $(CXXCOMPILE) -c -fpic -o $@ $<
676 tls_test_c_pic.o: tls_test_c.c
677 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
678 tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
679 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
680 tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
681 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
683 tls_test_pic_ie.o: tls_test.cc
684 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
685 tls_test_file2_pic_ie.o: tls_test_file2.cc
686 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
687 tls_test_c_pic_ie.o: tls_test_c.c
688 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
689 tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
690 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
692 tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
693 tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
694 tls_test_LDFLAGS = -Bgcctestdir/
695 tls_test_LDADD = tls_test_c.o -lpthread
696 tls_test_c.o: tls_test_c.c
697 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
699 tls_pic_test_SOURCES = tls_test_main.cc
700 tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
702 tls_pic_test_LDFLAGS = -Bgcctestdir/
703 tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
706 tls_test_main_pie.o: tls_test_main.cc tls_test.h
707 $(CXXCOMPILE) -c -fpie -o $@ $<
708 tls_test_pie.o: tls_test.cc tls_test.h
709 $(CXXCOMPILE) -c -fpie -o $@ $<
710 tls_test_file2_pie.o: tls_test_file2.cc tls_test.h
711 $(CXXCOMPILE) -c -fpie -o $@ $<
712 tls_test_c_pie.o: tls_test_c.c
713 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
714 tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \
715 tls_test_c_pie.o gcctestdir/ld
716 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread
718 tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \
719 tls_test_c_pic.o gcctestdir/ld
720 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread
722 tls_shared_test_SOURCES = tls_test_main.cc
723 tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
724 tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
725 tls_shared_test_LDADD = tls_test_shared.so -lpthread
727 tls_shared_ie_test_SOURCES = tls_test_main.cc
728 tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
729 tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
730 tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
732 tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
733 tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
734 tls_test_c_pic.o tls_test_shared2.so
735 tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
736 tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
737 tls_test_shared2.so -lpthread
741 check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
743 tls_test_gnu2.o: tls_test.cc
744 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
745 tls_test_file2_gnu2.o: tls_test_file2.cc
746 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
747 tls_test_c_gnu2.o: tls_test_c.c
748 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
749 tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
750 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
752 tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
753 tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
754 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
755 tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
756 tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
757 tls_test_gnu2_shared2.so -lpthread
761 check_PROGRAMS += tls_shared_gnu2_test
763 tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
764 $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
766 tls_shared_gnu2_test_SOURCES = tls_test_main.cc
767 tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
768 tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
769 tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
771 endif TLS_DESCRIPTORS
773 endif TLS_GNU2_DIALECT
776 check_PROGRAMS += tls_static_test
777 check_PROGRAMS += tls_static_pic_test
779 tls_static_test_SOURCES = $(tls_test_SOURCES)
780 tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
781 tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
782 tls_static_test_LDADD = $(tls_test_LDADD)
784 tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
785 tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
786 tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
787 tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
790 if FN_PTRS_IN_SO_WITHOUT_PIC
791 check_PROGRAMS += tls_shared_nonpic_test
792 tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
793 $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
795 tls_shared_nonpic_test_SOURCES = tls_test_main.cc
796 tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
797 tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
798 tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
799 endif FN_PTRS_IN_SO_WITHOUT_PIC
803 check_PROGRAMS += many_sections_test
804 many_sections_test_SOURCES = many_sections_test.cc
805 many_sections_test_DEPENDENCIES = gcctestdir/ld
806 many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
807 many_sections_test_LDADD =
809 BUILT_SOURCES += many_sections_define.h
810 MOSTLYCLEANFILES += many_sections_define.h
811 many_sections_define.h:
812 (for i in `seq 1 70000`; do \
813 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
817 BUILT_SOURCES += many_sections_check.h
818 MOSTLYCLEANFILES += many_sections_check.h
819 many_sections_check.h:
820 (for i in `seq 1 1000 70000`; do \
821 echo "assert(var_$$i == $$i);"; \
825 check_PROGRAMS += many_sections_r_test
826 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
827 gcctestdir/ld -r -o $@ many_sections_test.o
828 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
829 $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
831 if CONSTRUCTOR_PRIORITY
833 check_PROGRAMS += initpri1
834 initpri1_SOURCES = initpri1.c
835 initpri1_DEPENDENCIES = gcctestdir/ld
836 initpri1_LDFLAGS = -Bgcctestdir/
842 # Test --detect-odr-violations
843 check_SCRIPTS += debug_msg.sh
845 # Create the data files that debug_msg.sh analyzes.
846 check_DATA += debug_msg.err
847 MOSTLYCLEANFILES += debug_msg.err
848 debug_msg.o: debug_msg.cc
849 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
850 odr_violation1.o: odr_violation1.cc
851 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
852 odr_violation2.o: odr_violation2.cc
853 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
854 debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
855 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
856 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
858 echo 1>&2 "Link of debug_msg should have failed"; \
863 # See if we can also detect problems when we're linking .so's, not .o's.
864 check_DATA += debug_msg_so.err
865 MOSTLYCLEANFILES += debug_msg_so.err
866 debug_msg.so: debug_msg.cc gcctestdir/ld
867 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
868 odr_violation1.so: odr_violation1.cc gcctestdir/ld
869 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
870 odr_violation2.so: odr_violation2.cc gcctestdir/ld
871 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
872 debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
873 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
874 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
876 echo 1>&2 "Link of debug_msg_so should have failed"; \
881 # We also want to make sure we do something reasonable when there's no
882 # debug info available. For the best test, we use .so's.
883 check_DATA += debug_msg_ndebug.err
884 MOSTLYCLEANFILES += debug_msg_ndebug.err
885 debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
886 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
887 odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
888 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
889 odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
890 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
891 debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
892 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
893 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
895 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
901 # Similar to --detect-odr-violations: check for undefined symbols in .so's
902 check_SCRIPTS += undef_symbol.sh
903 check_DATA += undef_symbol.err
904 MOSTLYCLEANFILES += undef_symbol.err
905 undef_symbol.o: undef_symbol.cc
906 $(CXXCOMPILE) -O0 -g -c -fPIC $<
907 undef_symbol.so: undef_symbol.o gcctestdir/ld
908 $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
909 undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
910 @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
911 @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
913 echo 1>&2 "Link of undef_symbol_test should have failed"; \
919 # Test -o when emitting to a special file (such as something in /dev).
920 check_PROGRAMS += flagstest_o_specialfile
921 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
922 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
928 # Test --compress-debug-sections. FIXME: check we actually compress.
929 check_PROGRAMS += flagstest_compress_debug_sections
930 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
931 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
935 # The specialfile output has a tricky case when we also compress debug
936 # sections, because it requires output-file resizing.
937 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
938 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
940 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
946 # Test symbol versioning.
947 check_PROGRAMS += ver_test
948 ver_test_SOURCES = ver_test_main.cc
949 ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
950 ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
951 ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
952 ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
953 $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
954 ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
955 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so
956 ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
957 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
958 ver_test_1.o: ver_test_1.cc
959 $(CXXCOMPILE) -c -fpic -o $@ $<
960 ver_test_2.o: ver_test_2.cc
961 $(CXXCOMPILE) -c -fpic -o $@ $<
962 ver_test_3.o: ver_test_3.cc
963 $(CXXCOMPILE) -c -fpic -o $@ $<
964 ver_test_4.o: ver_test_4.cc
965 $(CXXCOMPILE) -c -fpic -o $@ $<
967 check_SCRIPTS += ver_test_1.sh
968 check_DATA += ver_test_1.syms
969 ver_test_1.syms: ver_test_1.so
970 $(TEST_READELF) -s $< >$@ 2>/dev/null
972 check_PROGRAMS += ver_test_2
973 ver_test_2_SOURCES = ver_test_main_2.cc
974 ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
975 ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
976 ver_test_2_LDADD = ver_test_4.so ver_test_2.so
978 check_SCRIPTS += ver_test_2.sh
979 check_DATA += ver_test_2.syms
980 ver_test_2.syms: ver_test_2
981 $(TEST_READELF) -s $< >$@ 2>/dev/null
983 check_SCRIPTS += ver_test_4.sh
984 check_DATA += ver_test_4.syms
985 ver_test_4.syms: ver_test_4.so
986 $(TEST_READELF) -s $< >$@ 2>/dev/null
988 ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
989 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
990 ver_test_5.o: ver_test_5.cc
991 $(CXXCOMPILE) -c -fpic -o $@ $<
992 check_SCRIPTS += ver_test_5.sh
993 check_DATA += ver_test_5.syms
994 ver_test_5.syms: ver_test_5.so
995 $(TEST_READELF) -s $< >$@ 2>/dev/null
997 check_PROGRAMS += ver_test_6
998 ver_test_6_SOURCES = ver_test_6.c
999 ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
1000 ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1001 ver_test_6_LDADD = ver_test_2.so
1003 ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
1004 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
1005 ver_test_7.o: ver_test_7.cc
1006 $(CXXCOMPILE) -c -fpic -o $@ $<
1007 check_SCRIPTS += ver_test_7.sh
1008 check_DATA += ver_test_7.syms
1009 ver_test_7.syms: ver_test_7.so
1010 $(TEST_READELF) -s $< >$@ 2>/dev/null
1012 check_PROGRAMS += ver_test_8
1013 ver_test_8_SOURCES = two_file_test_main.cc
1014 ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
1015 ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1016 ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
1017 ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
1018 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
1019 ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
1020 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
1022 check_PROGRAMS += ver_test_9
1023 ver_test_9_SOURCES = ver_test_main.cc
1024 ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
1025 ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1026 ver_test_9_LDADD = ver_test_9.so
1027 ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
1028 $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so
1029 ver_test_9.o: ver_test_9.cc
1030 $(CXXCOMPILE) -c -fpic -o $@ $<
1032 check_SCRIPTS += ver_test_10.sh
1033 check_DATA += ver_test_10.syms
1034 ver_test_10.syms: ver_test_10.so
1035 $(TEST_READELF) -s $< >$@ 2>/dev/null
1036 ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
1037 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
1039 check_PROGRAMS += ver_test_11
1040 MOSTLYCLEANFILES += ver_test_11.a
1041 ver_test_11_SOURCES = ver_test_main_2.cc
1042 ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
1043 ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1044 ver_test_11_LDADD = ver_test_11.a
1045 ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
1048 check_PROGRAMS += protected_1
1049 protected_1_SOURCES = \
1050 protected_main_1.cc protected_main_2.cc protected_main_3.cc
1051 protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
1052 protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1053 protected_1_LDADD = protected_1.so
1055 protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
1056 $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
1057 protected_1_pic.o: protected_1.cc
1058 $(CXXCOMPILE) -c -fpic -o $@ $<
1059 protected_2_pic.o: protected_2.cc
1060 $(CXXCOMPILE) -c -fpic -o $@ $<
1061 protected_3_pic.o: protected_3.cc
1062 $(CXXCOMPILE) -c -fpic -o $@ $<
1064 check_PROGRAMS += protected_2
1065 protected_2_SOURCES = protected_main_1.cc protected_3.cc
1066 protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
1067 protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1068 protected_2_LDADD = protected_1.so
1070 check_DATA += protected_3.err
1071 MOSTLYCLEANFILES += protected_3.err
1072 protected_4_pic.o: protected_4.cc
1073 $(CXXCOMPILE) -c -fpic -o $@ $<
1074 protected_3.err: protected_4_pic.o gcctestdir/ld
1075 @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@"
1076 @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \
1077 echo 1>&2 "Link of protected_4.so should have failed"; \
1082 check_PROGRAMS += relro_test
1083 check_SCRIPTS += relro_test.sh
1084 check_DATA += relro_test.stdout
1085 relro_test_SOURCES = relro_test_main.cc
1086 relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
1087 relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1088 relro_test_LDADD = relro_test.so
1089 relro_test.so: gcctestdir/ld relro_test_pic.o
1090 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
1091 relro_test_pic.o: relro_test.cc
1092 $(CXXCOMPILE) -c -fpic -o $@ $<
1093 relro_test.stdout: relro_test.so
1094 $(TEST_READELF) -SlW relro_test.so > relro_test.stdout
1096 check_PROGRAMS += relro_strip_test
1097 relro_strip_test_SOURCES = relro_test_main.cc
1098 relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
1099 relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1100 relro_strip_test_LDADD = relro_strip_test.so
1101 relro_strip_test.so: relro_test.so
1102 $(TEST_STRIP) -o $@ $<
1104 check_PROGRAMS += relro_script_test
1105 relro_script_test_SOURCES = relro_test_main.cc
1106 relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
1107 relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1108 relro_script_test_LDADD = relro_script_test.so
1109 relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
1110 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o
1112 check_PROGRAMS += script_test_1
1113 script_test_1_SOURCES = script_test_1.cc
1114 script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
1115 script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
1116 script_test_1_LDADD =
1118 check_PROGRAMS += script_test_2
1119 script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
1120 script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
1121 script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
1122 script_test_2_LDADD =
1124 check_PROGRAMS += justsyms
1125 justsyms_SOURCES = justsyms_1.cc
1126 justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
1127 justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
1129 justsyms_2.o: justsyms_2.cc
1130 $(CXXCOMPILE) -c -o $@ $<
1131 justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
1132 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
1134 check_PROGRAMS += binary_test
1135 MOSTLYCLEANFILES += binary.txt
1136 binary_test_SOURCES = binary_test.cc
1137 binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
1138 binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
1140 # Copy the file to the build directory to avoid worrying about the
1141 # full pathname in the generated symbols.
1142 binary.txt: $(srcdir)/binary.in
1146 check_SCRIPTS += ver_matching_test.sh
1147 check_DATA += ver_matching_test.stdout
1148 MOSTLYCLEANFILES += ver_matching_test.stdout
1149 ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld
1150 $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map
1151 ver_matching_def_pic.o: ver_matching_def.cc
1152 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
1153 ver_matching_test.stdout: ver_matching_def.so
1154 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1156 check_PROGRAMS += script_test_3
1157 check_SCRIPTS += script_test_3.sh
1158 check_DATA += script_test_3.stdout
1159 MOSTLYCLEANFILES += script_test_3.stdout
1160 script_test_3: basic_test.o gcctestdir/ld script_test_3.t
1161 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
1162 script_test_3.stdout: script_test_3
1163 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
1165 check_PROGRAMS += tls_phdrs_script_test
1166 tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
1167 tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
1168 tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t
1169 tls_phdrs_script_test_LDADD = $(tls_test_LDADD)
1171 check_SCRIPTS += script_test_4.sh
1172 check_DATA += script_test_4.stdout
1173 MOSTLYCLEANFILES += script_test_4
1174 script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
1175 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
1176 script_test_4.stdout: script_test_4
1177 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
1179 check_PROGRAMS += tls_script_test
1180 tls_script_test_SOURCES = $(tls_test_SOURCES)
1181 tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t
1182 tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t
1183 tls_script_test_LDADD = $(tls_test_LDADD)
1185 check_SCRIPTS += script_test_5.sh
1186 check_DATA += script_test_5.stdout
1187 MOSTLYCLEANFILES += script_test_5
1188 script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
1189 $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t
1190 script_test_5.stdout: script_test_5
1191 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
1193 check_SCRIPTS += script_test_6.sh
1194 check_DATA += script_test_6.stdout
1195 MOSTLYCLEANFILES += script_test_6
1196 script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t
1197 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \
1198 -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000
1199 script_test_6.stdout: script_test_6
1200 $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout
1202 check_SCRIPTS += script_test_7.sh
1203 check_DATA += script_test_7.stdout
1204 MOSTLYCLEANFILES += script_test_7
1205 script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1206 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t
1207 script_test_7.stdout: script_test_7
1208 $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout
1210 check_SCRIPTS += script_test_8.sh
1211 check_DATA += script_test_8.stdout
1212 MOSTLYCLEANFILES += script_test_8
1213 script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1214 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \
1215 -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000
1216 script_test_8.stdout: script_test_8
1217 $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout
1220 check_SCRIPTS += script_test_9.sh
1221 check_DATA += script_test_9.stdout
1222 script_test_9.o: script_test_9.cc
1223 $(CXXCOMPILE) -O0 -c -o $@ $<
1224 script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
1225 $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t
1226 script_test_9.stdout: script_test_9
1227 $(TEST_READELF) -lW script_test_9 > script_test_9.stdout
1230 # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
1231 # and --dynamic-list-cpp-typeinfo
1233 check_SCRIPTS += dynamic_list.sh
1234 check_DATA += dynamic_list.stdout
1235 MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout
1236 dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
1237 $(CXXLINK) -Bgcctestdir/ basic_test.o \
1238 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
1239 -Wl,--dynamic-list-data \
1240 -Wl,--dynamic-list-cpp-new \
1241 -Wl,--dynamic-list-cpp-typeinfo
1242 dynamic_list.stdout: dynamic_list
1243 $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout
1245 check_PROGRAMS += thin_archive_test_1
1246 MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
1247 alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
1248 alt/libthin2.a alt/libthin4.a
1249 thin_archive_test_1_SOURCES = thin_archive_main.cc
1250 thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
1251 thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
1252 thin_archive_test_1_LDADD = libthin1.a -lthin2
1254 check_PROGRAMS += thin_archive_test_2
1255 thin_archive_test_2_SOURCES = thin_archive_main.cc
1256 thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
1257 thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
1258 thin_archive_test_2_LDADD = -lthinall
1260 libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
1262 $(TEST_AR) crT $@ $^
1263 alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
1265 $(TEST_AR) crT $@ $^
1266 libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
1268 $(TEST_AR) crT $@ $^
1269 alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
1271 $(TEST_AR) crT $@ $^
1272 libthinall.a: libthin3.a alt/libthin4.a
1274 $(TEST_AR) crT $@ $^
1275 alt/thin_archive_test_2.o: thin_archive_test_2.cc
1276 test -d alt || mkdir -p alt
1277 $(CXXCOMPILE) -c -o $@ $<
1278 alt/thin_archive_test_4.o: thin_archive_test_4.cc
1279 test -d alt || mkdir -p alt
1280 $(CXXCOMPILE) -c -o $@ $<
1284 check_PROGRAMS += plugin_test_1
1285 check_SCRIPTS += plugin_test_1.sh
1286 check_DATA += plugin_test_1.err
1287 MOSTLYCLEANFILES += plugin_test_1.err
1288 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
1289 $(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
1290 plugin_test_1.err: plugin_test_1
1291 @touch plugin_test_1.err
1293 check_PROGRAMS += plugin_test_2
1294 check_SCRIPTS += plugin_test_2.sh
1295 check_DATA += plugin_test_2.err
1296 MOSTLYCLEANFILES += plugin_test_2.err
1297 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
1298 $(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
1299 plugin_test_2.err: plugin_test_2
1300 @touch plugin_test_2.err
1302 check_PROGRAMS += plugin_test_3
1303 check_SCRIPTS += plugin_test_3.sh
1304 check_DATA += plugin_test_3.err
1305 MOSTLYCLEANFILES += plugin_test_3.err
1306 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
1307 $(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
1308 plugin_test_3.err: plugin_test_3
1309 @touch plugin_test_3.err
1311 check_PROGRAMS += plugin_test_4
1312 check_SCRIPTS += plugin_test_4.sh
1313 check_DATA += plugin_test_4.err
1314 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
1315 plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
1316 $(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
1317 plugin_test_4.err: plugin_test_4
1318 @touch plugin_test_4.err
1320 plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
1323 check_PROGRAMS += plugin_test_5
1324 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
1325 $(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
1327 check_PROGRAMS += plugin_test_6
1328 check_SCRIPTS += plugin_test_6.sh
1329 check_DATA += plugin_test_6.err
1330 MOSTLYCLEANFILES += plugin_test_6.err
1331 plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so
1332 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err
1333 plugin_test_6.err: plugin_test_6
1334 @touch plugin_test_6.err
1336 check_PROGRAMS += plugin_test_7
1337 check_SCRIPTS += plugin_test_7.sh
1338 check_DATA += plugin_test_7.err plugin_test_7.syms
1339 MOSTLYCLEANFILES += plugin_test_7.err
1340 plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
1341 $(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
1342 plugin_test_7.syms: plugin_test_7
1343 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1344 plugin_test_7_1.o: plugin_test_7_1.c
1345 $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1346 plugin_test_7_1_orig.o: plugin_test_7_1.c
1347 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1348 plugin_test_7_1.syms: plugin_test_7_1_orig.o
1349 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1350 plugin_test_7_2.o: plugin_test_7_2.c
1351 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1352 plugin_test_7.err: plugin_test_7
1354 # Test plugins with -r.
1355 check_PROGRAMS += plugin_test_8
1356 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
1357 ../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
1358 plugin_test_8: plugin_test_8.o gcctestdir/ld
1359 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o
1361 # Test that symbols known in the IR file but not in the replacement file
1362 # produce an unresolved symbol error.
1363 check_DATA += plugin_test_9.err
1364 MOSTLYCLEANFILES += plugin_test_9.err
1365 plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so
1366 @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>$@"
1367 @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 \
1368 echo 1>&2 "Link of plugin_test_9 should have failed"; \
1372 # Make a .syms file that claims to define the symbol _Z4t16av.
1373 two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o
1374 cp two_file_test_1.syms $@.tmp
1375 grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp
1377 # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
1378 MOSTLYCLEANFILES += two_file_test_1c.o
1379 two_file_test_1c.o: two_file_test_1.o
1380 cp two_file_test_1.o $@
1382 plugin_test.so: plugin_test.o
1383 $(LINK) -Bgcctestdir/ -shared plugin_test.o
1384 plugin_test.o: plugin_test.c
1385 $(COMPILE) -O0 -c -fpic -o $@ $<
1387 two_file_test_main.syms: two_file_test_main.o
1388 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1389 two_file_test_1.syms: two_file_test_1.o
1390 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1391 two_file_test_1b.syms: two_file_test_1b.o
1392 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1393 two_file_test_2.syms: two_file_test_2.o
1394 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1395 plugin_common_test_1.syms: plugin_common_test_1.o
1396 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1397 plugin_common_test_2.syms: plugin_common_test_2.o
1398 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1402 @echo "Symbol table" >>$@
1404 MOSTLYCLEANFILES += unused.c
1405 unused.syms: unused.o
1406 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1407 @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@
1409 $(COMPILE) -c -o $@ $<
1415 check_PROGRAMS += exclude_libs_test
1416 check_SCRIPTS += exclude_libs_test.sh
1417 check_DATA += exclude_libs_test.syms
1418 MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
1419 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1420 exclude_libs_test_SOURCES = exclude_libs_test.c
1421 exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
1422 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1423 exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
1424 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
1425 -Wl,--exclude-libs,libexclude_libs_test_3
1426 exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
1427 alt/libexclude_libs_test_3.a
1428 exclude_libs_test.syms: exclude_libs_test
1429 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1430 libexclude_libs_test_1.a: exclude_libs_test_1.o
1432 libexclude_libs_test_2.a: exclude_libs_test_2.o
1434 alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
1435 test -d alt || mkdir -p alt
1438 check_PROGRAMS += local_labels_test
1439 local_labels_test.o: ver_test_6.c
1440 $(COMPILE) -g -c -Wa,-L -o $@ $<
1441 local_labels_test: local_labels_test.o
1442 $(LINK) -Bgcctestdir/ local_labels_test.o
1444 check_PROGRAMS += discard_locals_test
1445 check_SCRIPTS += discard_locals_test.sh
1446 check_DATA += discard_locals_test.syms \
1447 discard_locals_relocatable_test1.syms \
1448 discard_locals_relocatable_test2.syms
1449 MOSTLYCLEANFILES += discard_locals_test.syms \
1450 discard_locals_relocatable_test1.syms \
1451 discard_locals_relocatable_test2.syms \
1452 discard_locals_relocatable_test1.out \
1453 discard_locals_relocatable_test2.out
1454 discard_locals_test_SOURCES = discard_locals_test.c
1455 discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
1456 discard_locals_test.syms: discard_locals_test
1457 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1458 # '-Wa,-L' is required to preserve the local label used for testing.
1459 discard_locals_test.o: discard_locals_test.c
1460 $(COMPILE) -c -Wa,-L -o $@ $<
1462 discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out
1463 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1464 discard_locals_relocatable_test.o: discard_locals_relocatable_test.c
1465 $(COMPILE) -c -Wa,-L -fPIC -o $@ $<
1466 discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new
1467 ../ld-new --discard-locals -relocatable -o $@ $<
1469 discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out
1470 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1471 discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new
1472 ../ld-new --discard-all -relocatable -o $@ $<
1475 check_PROGRAMS += large
1476 large_SOURCES = large.c
1477 large_CFLAGS = -mcmodel=medium
1478 large_DEPENDENCIES = gcctestdir/ld
1479 large_LDFLAGS = -Bgcctestdir/
1481 endif MCMODEL_MEDIUM
1483 # Test that hidden and internal symbols in the main program cannot be
1484 # referenced by a shared library.
1485 check_SCRIPTS += hidden_test.sh
1486 check_DATA += hidden_test.err
1487 MOSTLYCLEANFILES += hidden_test hidden_test.err
1488 libhidden.so: hidden_test_1.c gcctestdir/ld
1489 $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
1490 hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
1491 $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
1492 hidden_test.err: hidden_test
1493 @touch hidden_test.err
1495 # Test -retain-symbols-file.
1496 check_SCRIPTS += retain_symbols_file_test.sh
1497 check_DATA += retain_symbols_file_test.stdout
1498 MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
1499 retain_symbols_file_test.stdout
1500 retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld
1501 echo 'main' > retain_symbols_file_test.in
1502 echo 't1' >> retain_symbols_file_test.in
1503 echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in
1504 echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
1505 echo '_Z3t18v' >> retain_symbols_file_test.in
1506 echo '__tcf_0' >> retain_symbols_file_test.in
1507 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
1508 retain_symbols_file_test.stdout: retain_symbols_file_test.so
1509 $(TEST_NM) -C retain_symbols_file_test.so > $@
1512 # Test that if the output file already exists and is empty,
1513 # it will get execute permission.
1514 check_PROGRAMS += permission_test
1515 permission_test: basic_test.o gcctestdir/ld
1520 $(CXXLINK) -Bgcctestdir/ basic_test.o
1523 check_PROGRAMS += searched_file_test
1524 MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
1525 alt/searched_file_test_lib.a
1526 searched_file_test_SOURCES = searched_file_test.cc
1527 searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
1528 searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
1529 searched_file_test_LDADD = -l:searched_file_test_lib.a
1530 searched_file_test_lib.o: searched_file_test_lib.cc
1531 $(CXXCOMPILE) -c -o $@ $<
1532 alt/searched_file_test_lib.a: searched_file_test_lib.o
1533 test -d alt || mkdir -p alt
1536 # Test that no .gnu.version sections are created when
1537 # symbol versioning is not used.
1538 check_SCRIPTS += no_version_test.sh
1539 check_DATA += no_version_test.stdout
1540 MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
1541 # We invoke the linker directly since gcc may include additional objects that
1542 # uses symbol versioning.
1543 libno_version_test.so: no_version_test.o gcctestdir/ld
1544 gcctestdir/ld -shared -o $@ no_version_test.o
1545 no_version_test.o: no_version_test.c
1546 $(COMPILE) -o $@ -c -fPIC $<
1547 no_version_test.stdout: libno_version_test.so
1548 $(TEST_OBJDUMP) -h $< > $@
1550 # Test STT_GNU_IFUNC symbols.
1553 ifuncmod1.o: ifuncmod1.c
1554 $(COMPILE) -c -fpic -o $@ $<
1555 ifuncmod1.so: ifuncmod1.o gcctestdir/ld
1556 $(LINK) -Bgcctestdir/ -shared ifuncmod1.o
1558 ifuncdep1.o: ifuncmod1.c
1559 $(COMPILE) -c -o $@ $<
1561 ifuncmain1pic.o: ifuncmain1.c
1562 $(COMPILE) -c -fpic -o $@ $<
1563 ifuncmain1pie.o: ifuncmain1.c
1564 $(COMPILE) -c -fpie -o $@ $<
1566 check_PROGRAMS += ifuncmain1static
1567 ifuncmain1static_SOURCES = ifuncmain1.c
1568 ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
1569 ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
1570 ifuncmain1static_LDADD = ifuncdep1.o
1572 check_PROGRAMS += ifuncmain1picstatic
1573 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
1574 $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
1576 check_PROGRAMS += ifuncmain1
1577 ifuncmain1_SOURCES = ifuncmain1.c
1578 ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
1579 ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1580 ifuncmain1_LDADD = ifuncmod1.so
1582 check_PROGRAMS += ifuncmain1pic
1583 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
1584 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
1586 check_PROGRAMS += ifuncmain1vis
1587 ifuncmain1vis_SOURCES = ifuncmain1vis.c
1588 ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
1589 ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1590 ifuncmain1vis_LDADD = ifuncmod1.so
1592 check_PROGRAMS += ifuncmain1vispic
1593 ifuncmain1vispic.o: ifuncmain1vis.c
1594 $(COMPILE) -c -fpic -o $@ $<
1595 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
1596 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
1598 check_PROGRAMS += ifuncmain1staticpic
1599 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
1600 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
1602 check_PROGRAMS += ifuncmain1pie
1603 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
1604 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
1606 check_PROGRAMS += ifuncmain1vispie
1607 ifuncmain1vispie.o: ifuncmain1vis.c
1608 $(COMPILE) -c -fpie -o $@ $<
1609 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
1610 $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
1612 check_PROGRAMS += ifuncmain1staticpie
1613 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
1614 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
1616 ifuncmain2pic.o: ifuncmain2.c
1617 $(COMPILE) -c -fpic -o $@ $<
1619 ifuncdep2pic.o: ifuncdep2.c
1620 $(COMPILE) -c -fpic -o $@ $<
1622 check_PROGRAMS += ifuncmain2static
1623 ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
1624 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
1625 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
1626 ifuncmain2static_LDADD =
1628 check_PROGRAMS += ifuncmain2picstatic
1629 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
1630 $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
1632 check_PROGRAMS += ifuncmain2
1633 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
1634 ifuncmain2_DEPENDENCIES = gcctestdir/ld
1635 ifuncmain2_LDFLAGS = -Bgcctestdir/
1638 check_PROGRAMS += ifuncmain2pic
1639 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
1640 $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
1642 ifuncmod3.o: ifuncmod3.c
1643 $(COMPILE) -c -fpic -o $@ $<
1644 ifuncmod3.so: ifuncmod3.o gcctestdir/ld
1645 $(LINK) -Bgcctestdir/ -shared ifuncmod3.o
1647 check_PROGRAMS += ifuncmain3
1648 ifuncmain3_SOURCES = ifuncmain3.c
1649 ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
1650 ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
1651 ifuncmain3_LDADD = -ldl
1653 ifuncmain4pic.o: ifuncmain4.c
1654 $(COMPILE) -c -fpic -o $@ $<
1656 check_PROGRAMS += ifuncmain4static
1657 ifuncmain4static_SOURCES = ifuncmain4.c
1658 ifuncmain4static_DEPENDENCIES = gcctestdir/ld
1659 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
1660 ifuncmain4static_LDADD =
1662 check_PROGRAMS += ifuncmain4picstatic
1663 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
1664 $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
1666 check_PROGRAMS += ifuncmain4
1667 ifuncmain4_SOURCES = ifuncmain4.c
1668 ifuncmain4_DEPENDENCIES = gcctestdir/ld
1669 ifuncmain4_LDFLAGS = -Bgcctestdir/
1672 ifuncmain5pic.o: ifuncmain5.c
1673 $(COMPILE) -c -fpic -o $@ $<
1675 ifuncmain5pie.o: ifuncmain5.c
1676 $(COMPILE) -c -fpie -o $@ $<
1678 ifuncmod5.o: ifuncmod5.c
1679 $(COMPILE) -c -fpic -o $@ $<
1680 ifuncmod5.so: ifuncmod5.o gcctestdir/ld
1681 $(LINK) -Bgcctestdir/ -shared ifuncmod5.o
1683 ifuncdep5.o: ifuncmod5.c
1684 $(COMPILE) -c -o $@ $<
1686 check_PROGRAMS += ifuncmain5static
1687 ifuncmain5static_SOURCES = ifuncmain5.c
1688 ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
1689 ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
1690 ifuncmain5static_LDADD = ifuncdep5.o
1692 check_PROGRAMS += ifuncmain5picstatic
1693 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
1694 $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
1696 check_PROGRAMS += ifuncmain5
1697 ifuncmain5_SOURCES = ifuncmain5.c
1698 ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
1699 ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1700 ifuncmain5_LDADD = ifuncmod5.so
1702 check_PROGRAMS += ifuncmain5pic
1703 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
1704 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
1706 check_PROGRAMS += ifuncmain5staticpic
1707 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
1708 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
1710 check_PROGRAMS += ifuncmain5pie
1711 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
1712 $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
1714 ifuncmain6pie.o: ifuncmain6pie.c
1715 $(COMPILE) -c -fpie -o $@ $<
1717 ifuncmod6.o: ifuncmod6.c
1718 $(COMPILE) -c -fpic -o $@ $<
1719 ifuncmod6.so: ifuncmod6.o gcctestdir/ld
1720 $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
1722 check_PROGRAMS += ifuncmain6pie
1723 ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
1724 $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
1726 ifuncmain7pic.o: ifuncmain7.c
1727 $(COMPILE) -c -fpic -o $@ $<
1729 ifuncmain7pie.o: ifuncmain7.c
1730 $(COMPILE) -c -fpie -o $@ $<
1732 check_PROGRAMS += ifuncmain7static
1733 ifuncmain7static_SOURCES = ifuncmain7.c
1734 ifuncmain7static_DEPENDENCIES = gcctestdir/ld
1735 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
1736 ifuncmain7static_LDADD =
1738 check_PROGRAMS += ifuncmain7picstatic
1739 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
1740 $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
1742 check_PROGRAMS += ifuncmain7
1743 ifuncmain7_SOURCES = ifuncmain7.c
1744 ifuncmain7_DEPENDENCIES = gcctestdir/ld
1745 ifuncmain7_LDFLAGS = -Bgcctestdir/
1748 check_PROGRAMS += ifuncmain7pic
1749 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
1750 $(LINK) -Bgcctestdir/ ifuncmain7pic.o
1752 check_PROGRAMS += ifuncmain7pie
1753 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
1754 $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
1758 # Test that strong reference to a weak symbol in a DSO remains strong.
1759 check_SCRIPTS += strong_ref_weak_def.sh
1760 check_DATA += strong_ref_weak_def.stdout
1761 MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
1762 strong_ref_weak_def.stdout
1763 strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
1764 $(COMPILE) -o $@ -c -fPIC $<
1765 strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
1766 gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
1767 strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
1768 $(COMPILE) -o $@ -c -fPIC $<
1769 strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
1771 gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
1772 strong_ref_weak_def_2.so
1773 strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
1774 $(TEST_READELF) -sWD $< > $@
1776 # Test that a strong weak reference remains strong if there is another
1777 # weak reference in a DSO.
1778 check_SCRIPTS += dyn_weak_ref.sh
1779 check_DATA += dyn_weak_ref.stdout
1780 MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
1782 dyn_weak_ref_2.o: dyn_weak_ref_2.c
1783 $(COMPILE) -o $@ -c -fPIC $<
1784 dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
1785 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
1786 dyn_weak_ref_1.o: dyn_weak_ref_1.c
1787 $(COMPILE) -o $@ -c -fPIC $<
1788 # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
1789 # so that the weak ref there goes to gold's symbol table first.
1790 dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
1791 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
1792 dyn_weak_ref.stdout: dyn_weak_ref_1.so
1793 $(TEST_READELF) -sWD $< > $@
1796 # Test that --start-lib and --end-lib function correctly.
1797 check_PROGRAMS += start_lib_test
1798 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
1800 $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
1801 -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib
1802 libstart_lib_test.a: start_lib_test_1.o
1805 # Test that MEMORY region support works.
1806 check_SCRIPTS += memory_test.sh
1807 check_DATA += memory_test.stdout
1808 MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o
1809 memory_test.o: memory_test.s
1810 $(COMPILE) -o $@ -c $<
1811 memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t
1812 $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o
1813 memory_test.stdout: memory_test
1814 $(TEST_READELF) -lWS $< > $@
1819 # These tests work with native and cross linkers.
1821 if NATIVE_OR_CROSS_LINKER
1823 # Test script section order.
1824 check_SCRIPTS += script_test_10.sh
1825 check_DATA += script_test_10.stdout
1826 script_test_10.o: script_test_10.s
1828 script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
1829 gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t
1830 script_test_10.stdout: script_test_10
1831 $(TEST_READELF) -SW script_test_10 > $@
1833 # These tests work with cross linkers only.
1835 if DEFAULT_TARGET_I386
1837 check_SCRIPTS += split_i386.sh
1838 check_DATA += split_i386_1.stdout split_i386_2.stdout \
1839 split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
1840 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
1841 split_i386_1.o: split_i386_1.s
1843 split_i386_2.o: split_i386_2.s
1845 split_i386_3.o: split_i386_3.s
1847 split_i386_4.o: split_i386_4.s
1849 split_i386_n.o: split_i386_n.s
1851 split_i386_1: split_i386_1.o split_i386_n.o ../ld-new
1852 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o
1853 split_i386_1.stdout: split_i386_1
1854 $(TEST_OBJDUMP) -d $< > $@
1855 split_i386_2: split_i386_2.o split_i386_n.o ../ld-new
1856 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o
1857 split_i386_2.stdout: split_i386_2
1858 $(TEST_OBJDUMP) -d $< > $@
1859 split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new
1860 ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0
1861 split_i386_4: split_i386_4.o split_i386_n.o ../ld-new
1862 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o
1863 split_i386_4.stdout: split_i386_4
1864 $(TEST_OBJDUMP) -d $< > $@
1865 split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new
1866 ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0
1867 MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \
1868 split_i386_4 split_i386_r
1870 endif DEFAULT_TARGET_I386
1872 if DEFAULT_TARGET_X86_64
1874 check_SCRIPTS += split_x86_64.sh
1875 check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \
1876 split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
1877 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
1878 split_x86_64_1.o: split_x86_64_1.s
1880 split_x86_64_2.o: split_x86_64_2.s
1882 split_x86_64_3.o: split_x86_64_3.s
1884 split_x86_64_4.o: split_x86_64_4.s
1886 split_x86_64_n.o: split_x86_64_n.s
1888 split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new
1889 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o
1890 split_x86_64_1.stdout: split_x86_64_1
1891 $(TEST_OBJDUMP) -d $< > $@
1892 split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new
1893 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o
1894 split_x86_64_2.stdout: split_x86_64_2
1895 $(TEST_OBJDUMP) -d $< > $@
1896 split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new
1897 ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0
1898 split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new
1899 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o
1900 split_x86_64_4.stdout: split_x86_64_4
1901 $(TEST_OBJDUMP) -d $< > $@
1902 split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
1903 ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0
1904 MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
1905 split_x86_64_4 split_x86_64_r
1907 endif DEFAULT_TARGET_X86_64
1909 if DEFAULT_TARGET_ARM
1911 check_SCRIPTS += arm_abs_global.sh
1912 check_DATA += arm_abs_global.stdout
1913 arm_abs_lib.o: arm_abs_lib.s
1914 $(TEST_AS) -march=armv7-a -o $@ $<
1915 libarm_abs.so: arm_abs_lib.o ../ld-new
1916 ../ld-new -shared -o $@ arm_abs_lib.o
1917 arm_abs_global.o: arm_abs_global.s
1918 $(TEST_AS) -march=armv7-a -o $@ $<
1919 arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new
1920 ../ld-new -o $@ arm_abs_global.o -L. -larm_abs
1921 arm_abs_global.stdout: arm_abs_global
1922 $(TEST_READELF) -r $< > $@
1924 MOSTLYCLEANFILES += arm_abs_global
1926 check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh
1927 check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \
1928 thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \
1929 thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \
1930 thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \
1931 thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \
1932 thumb_bl_out_of_range_local.stdout
1934 arm_bl_in_range.stdout: arm_bl_in_range
1935 $(TEST_OBJDUMP) -D $< > $@
1937 arm_bl_in_range: arm_bl_in_range.o ../ld-new
1938 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
1940 arm_bl_in_range.o: arm_bl_in_range.s
1943 arm_bl_out_of_range.stdout: arm_bl_out_of_range
1944 $(TEST_OBJDUMP) -S $< > $@
1946 arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new
1947 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
1949 arm_bl_out_of_range.o: arm_bl_out_of_range.s
1952 thumb_bl_in_range.stdout: thumb_bl_in_range
1953 $(TEST_OBJDUMP) -D $< > $@
1955 thumb_bl_in_range: thumb_bl_in_range.o ../ld-new
1956 ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1958 thumb_bl_in_range.o: thumb_bl_in_range.s
1959 $(TEST_AS) -o $@ -march=armv5te $<
1961 thumb_bl_out_of_range.stdout: thumb_bl_out_of_range
1962 $(TEST_OBJDUMP) -D $< > $@
1964 thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new
1965 ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1967 thumb_bl_out_of_range.o: thumb_bl_out_of_range.s
1968 $(TEST_AS) -o $@ -march=armv5te $<
1970 thumb2_bl_in_range.stdout: thumb2_bl_in_range
1971 $(TEST_OBJDUMP) -D $< > $@
1973 thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new
1974 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
1976 thumb2_bl_in_range.o: thumb_bl_in_range.s
1977 $(TEST_AS) -o $@ -march=armv7-a $<
1979 thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range
1980 $(TEST_OBJDUMP) -D $< > $@
1982 thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new
1983 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
1985 thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s
1986 $(TEST_AS) -o $@ -march=armv7-a $<
1988 thumb_blx_in_range.stdout: thumb_blx_in_range
1989 $(TEST_OBJDUMP) -D $< > $@
1991 thumb_blx_in_range: thumb_blx_in_range.o ../ld-new
1992 ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
1994 thumb_blx_in_range.o: thumb_blx_in_range.s
1995 $(TEST_AS) -o $@ -march=armv5te $<
1997 thumb_blx_out_of_range.stdout: thumb_blx_out_of_range
1998 $(TEST_OBJDUMP) -D $< > $@
2000 thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new
2001 ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
2003 thumb_blx_out_of_range.o: thumb_blx_out_of_range.s
2004 $(TEST_AS) -o $@ -march=armv5te $<
2006 thumb2_blx_in_range.stdout: thumb2_blx_in_range
2007 $(TEST_OBJDUMP) -D $< > $@
2009 thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new
2010 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2012 thumb2_blx_in_range.o: thumb_blx_in_range.s
2013 $(TEST_AS) -o $@ -march=armv7-a $<
2015 thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range
2016 $(TEST_OBJDUMP) -D $< > $@
2018 thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new
2019 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2021 thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s
2022 $(TEST_AS) -o $@ -march=armv7-a $<
2024 thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local
2025 $(TEST_OBJDUMP) -D $< > $@
2027 thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new
2028 ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $<
2030 thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s
2031 $(TEST_AS) -o $@ -march=armv5te $<
2033 MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \
2034 thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \
2035 thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \
2036 thumb2_blx_out_of_range thumb_bl_out_of_range_local
2038 check_SCRIPTS += arm_fix_v4bx.sh
2039 check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \
2040 arm_no_fix_v4bx.stdout
2042 arm_fix_v4bx.stdout: arm_fix_v4bx
2043 $(TEST_OBJDUMP) -D -j.text $< > $@
2045 arm_fix_v4bx: arm_fix_v4bx.o ../ld-new
2046 ../ld-new --fix-v4bx -o $@ $<
2048 arm_fix_v4bx.o: arm_fix_v4bx.s
2051 arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking
2052 $(TEST_OBJDUMP) -D -j.text $< > $@
2054 arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new
2055 ../ld-new --fix-v4bx-interworking -o $@ $<
2057 arm_no_fix_v4bx.stdout: arm_no_fix_v4bx
2058 $(TEST_OBJDUMP) -D -j.text $< > $@
2060 arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new
2063 MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx
2065 check_SCRIPTS += arm_attr_merge.sh
2066 check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
2067 arm_attr_merge_7.stdout
2069 arm_attr_merge_6.stdout: arm_attr_merge_6
2070 $(TEST_READELF) -A $< > $@
2072 arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o
2073 ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
2075 arm_attr_merge_6a.o: arm_attr_merge_6a.s
2078 arm_attr_merge_6b.o: arm_attr_merge_6b.s
2081 arm_attr_merge_6r.stdout: arm_attr_merge_6r
2082 $(TEST_READELF) -A $< > $@
2084 arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o
2085 ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
2087 arm_attr_merge_7.stdout: arm_attr_merge_7
2088 $(TEST_READELF) -A $< > $@
2090 arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o
2091 ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
2093 arm_attr_merge_7a.o: arm_attr_merge_7a.s
2096 arm_attr_merge_7b.o: arm_attr_merge_7b.s
2099 MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7
2101 # Cortex-A8 workaround test.
2103 check_SCRIPTS += arm_cortex_a8.sh
2104 check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \
2105 arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \
2106 arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout
2108 arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond
2109 $(TEST_OBJDUMP) -D -j.text $< > $@
2111 arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new
2114 arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s
2117 arm_cortex_a8_b.stdout: arm_cortex_a8_b
2118 $(TEST_OBJDUMP) -D -j.text $< > $@
2120 arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new
2121 ../ld-new --fix-cortex-a8 -o $@ $<
2123 arm_cortex_a8_b.o: arm_cortex_a8_b.s
2126 arm_cortex_a8_bl.stdout: arm_cortex_a8_bl
2127 $(TEST_OBJDUMP) -D -j.text $< > $@
2129 arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new
2132 arm_cortex_a8_bl.o: arm_cortex_a8_bl.s
2135 arm_cortex_a8_blx.stdout: arm_cortex_a8_blx
2136 $(TEST_OBJDUMP) -D -j.text $< > $@
2138 arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new
2141 arm_cortex_a8_blx.o: arm_cortex_a8_blx.s
2144 arm_cortex_a8_local.stdout: arm_cortex_a8_local
2145 $(TEST_OBJDUMP) -D -j.text $< > $@
2147 arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new
2150 arm_cortex_a8_local.o: arm_cortex_a8_local.s
2153 arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc
2154 $(TEST_OBJDUMP) -D -j.text $< > $@
2156 arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new
2159 arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s
2162 MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \
2163 arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc
2165 endif DEFAULT_TARGET_ARM
2167 endif NATIVE_OR_CROSS_LINKER