Add final_layout_sequence.txt to MOSTLYCLEANFILES
[deliverable/binutils-gdb.git] / gold / testsuite / Makefile.am
1 # Process this file with automake to generate Makefile.in
2
3 # As far as I can tell automake testing support assumes that the build
4 # system and the host system are the same. So these tests will not
5 # work when building with a cross-compiler.
6
7 # Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS
8 AUTOMAKE_OPTIONS = foreign -Wno-portability
9
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
15
16 AM_CPPFLAGS = \
17 -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
18 -I$(srcdir)/../../elfcpp -I.. \
19 -DLOCALEDIR="\"$(datadir)/locale\"" \
20 @INCINTL@
21
22 # COMPILE1, LINK1, CXXCOMPILE1, CXXLINK1 are renamed from COMPILE, LINK,
23 # CXXCOMPILE and CXXLINK generated by automake 1.11.1. FIXME: they should
24 # be updated if they are different from automake used by gold.
25 COMPILE1 = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
26 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
27 LINK1 = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
28 CXXCOMPILE1 = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
29 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
30 CXXLINK1 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
31 -o $@
32
33 # Strip out -Wp,-D_FORTIFY_SOURCE=, which is rrelevant for the gold
34 # testsuite and incompatible with -O0 used in gold tests, from
35 # COMPILE, LINK, CXXCOMPILE and CXXLINK.
36 COMPILE = `echo $(COMPILE1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9[0-9]]*//'`
37 LINK = `echo $(LINK1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'`
38 CXXCOMPILE = `echo $(CXXCOMPILE1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'`
39 CXXLINK = `echo $(CXXLINK1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'`
40
41 TEST_READELF = $(top_builddir)/../binutils/readelf
42 TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
43 TEST_OBJCOPY = $(top_builddir)/../binutils/objcopy
44 TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
45 TEST_STRIP = $(top_builddir)/../binutils/strip-new
46 TEST_AR = $(top_builddir)/../binutils/ar
47 TEST_NM = $(top_builddir)/../binutils/nm-new
48 TEST_AS = $(top_builddir)/../gas/as-new
49
50 if PLUGINS
51 LIBDL = -ldl
52 endif
53
54 if THREADS
55 THREADSLIB = -lpthread
56 endif
57
58 if OMP_SUPPORT
59 TLS_TEST_C_CFLAGS = -fopenmp
60 endif
61
62 # 'make clean' is good about deleting some intermediate files (such as
63 # .o's), but not all of them (such as .so's and .err files). We
64 # improve on that here. automake-1.9 info docs say "mostlyclean" is
65 # the right choice for files 'make' builds that people rebuild.
66 MOSTLYCLEANFILES = *.so *.syms *.stdout
67
68
69 # We will add to these later, for each individual test. Note
70 # that we add each test under check_SCRIPTS or check_PROGRAMS;
71 # the TESTS variable is automatically populated from these.
72 check_SCRIPTS =
73 check_DATA =
74 check_PROGRAMS =
75 BUILT_SOURCES =
76
77 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
78
79 # ---------------------------------------------------------------------
80 # These tests test the internals of gold (unittests).
81
82 # Infrastucture needed for the unittests
83 check_LIBRARIES = libgoldtest.a
84 libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
85
86 DEPENDENCIES = \
87 libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
88 LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
89 $(THREADSLIB) $(LIBDL)
90
91
92 # The unittests themselves
93 if NATIVE_OR_CROSS_LINKER
94 if GCC
95
96 # Infrastucture needed for the unittests: a directory where the linker
97 # is named 'ld'. This is because the -B flag appends 'ld' to its arg.
98 gcctestdir/ld: ../ld-new
99 test -d gcctestdir || mkdir -p gcctestdir
100 rm -f gcctestdir/ld
101 (cd gcctestdir && $(LN_S) ../../ld-new ld)
102
103 # Some tests require the latest features of an in-tree assembler.
104 gcctestdir/as: $(TEST_AS)
105 test -d gcctestdir || mkdir -p gcctestdir
106 rm -f gcctestdir/as
107 (cd gcctestdir && $(LN_S) $(abs_top_builddir)/../gas/as-new as)
108
109 endif GCC
110
111 check_PROGRAMS += object_unittest
112 object_unittest_SOURCES = object_unittest.cc
113
114 check_PROGRAMS += binary_unittest
115 binary_unittest_SOURCES = binary_unittest.cc
116
117 check_PROGRAMS += leb128_unittest
118 leb128_unittest_SOURCES = leb128_unittest.cc
119
120 endif NATIVE_OR_CROSS_LINKER
121
122 # ---------------------------------------------------------------------
123 # These tests test the output of gold (end-to-end tests). In
124 # particular, they make sure that gold can link "difficult" object
125 # files, and the resulting object files run correctly. These can only
126 # run if we've built ld-new for the native architecture (that is,
127 # we're not cross-compiling it), since we run ld-new as part of these
128 # tests. We use the gcc-specific flag '-B' to use our linker instead
129 # of the default linker, which is why we only run our tests under gcc.
130
131 if NATIVE_LINKER
132 if GCC
133
134 # Each of these .o's is a useful, small complete program. They're
135 # particularly useful for making sure ld-new's flags do what they're
136 # supposed to (hence their names), but are used for many tests that
137 # don't actually involve analyzing input data.
138 flagstest_debug.o: constructor_test.cc
139 $(CXXCOMPILE) -O0 -g -c -o $@ $<
140 flagstest_ndebug.o: constructor_test.cc
141 $(CXXCOMPILE) -O0 -c -o $@ $<
142
143 check_SCRIPTS += incremental_test.sh
144 check_DATA += incremental_test.stdout
145 MOSTLYCLEANFILES += incremental_test
146 incremental_test_1.o: incremental_test_1.c
147 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
148 incremental_test_2.o: incremental_test_2.c
149 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
150 incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
151 $(LINK) -Bgcctestdir/ -Wl,--incremental-full incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
152 incremental_test.stdout: incremental_test ../incremental-dump
153 ../incremental-dump incremental_test > $@
154
155 check_SCRIPTS += gc_comdat_test.sh
156 check_DATA += gc_comdat_test.stdout
157 MOSTLYCLEANFILES += gc_comdat_test
158 gc_comdat_test_1.o: gc_comdat_test_1.cc
159 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
160 gc_comdat_test_2.o: gc_comdat_test_2.cc
161 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
162 gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
163 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
164 gc_comdat_test.stdout: gc_comdat_test
165 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
166
167 check_SCRIPTS += gc_tls_test.sh
168 check_DATA += gc_tls_test.stdout
169 MOSTLYCLEANFILES += gc_tls_test
170 gc_tls_test.o: gc_tls_test.cc
171 $(CXXCOMPILE) -O0 -c -g -o $@ $<
172 gc_tls_test:gc_tls_test.o gcctestdir/ld
173 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
174 gc_tls_test.stdout: gc_tls_test
175 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
176
177 check_SCRIPTS += gc_orphan_section_test.sh
178 check_DATA += gc_orphan_section_test.stdout
179 MOSTLYCLEANFILES += gc_orphan_section_test
180 gc_orphan_section_test.o: gc_orphan_section_test.cc
181 $(CXXCOMPILE) -O0 -c -g -o $@ $<
182 gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
183 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o
184 gc_orphan_section_test.stdout: gc_orphan_section_test
185 $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout
186
187 check_SCRIPTS += pr14265.sh
188 check_DATA += pr14265.stdout
189 MOSTLYCLEANFILES += pr14265
190 pr14265.o: pr14265.c
191 $(COMPILE) -O0 -c -o $@ $<
192 pr14265: pr14265.o
193 $(LINK) -Bgcctestdir/ -Wl,--gc-sections -T $(srcdir)/pr14265.t -o $@ $<
194 pr14265.stdout: pr14265
195 $(TEST_NM) --format=bsd --numeric-sort $< > $@
196
197 check_SCRIPTS += icf_test.sh
198 check_DATA += icf_test.stdout
199 MOSTLYCLEANFILES += icf_test
200 icf_test.o: icf_test.cc
201 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
202 icf_test: icf_test.o gcctestdir/ld
203 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_test.o
204 icf_test.stdout: icf_test
205 $(TEST_NM) -C icf_test > icf_test.stdout
206
207 check_SCRIPTS += icf_keep_unique_test.sh
208 check_DATA += icf_keep_unique_test.stdout
209 MOSTLYCLEANFILES += icf_keep_unique_test
210 icf_keep_unique_test.o: icf_keep_unique_test.cc
211 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
212 icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
213 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
214 icf_keep_unique_test.stdout: icf_keep_unique_test
215 $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout
216
217 check_SCRIPTS += icf_safe_test.sh
218 check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout
219 MOSTLYCLEANFILES += icf_safe_test
220 icf_safe_test.o: icf_safe_test.cc
221 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
222 icf_safe_test: icf_safe_test.o gcctestdir/ld
223 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_test.o
224 icf_safe_test_1.stdout: icf_safe_test
225 $(TEST_NM) icf_safe_test > icf_safe_test_1.stdout
226 icf_safe_test_2.stdout: icf_safe_test
227 $(TEST_READELF) -h icf_safe_test > icf_safe_test_2.stdout
228
229 check_SCRIPTS += icf_safe_so_test.sh
230 check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout
231 MOSTLYCLEANFILES += icf_safe_so_test
232 icf_safe_so_test.o: icf_safe_so_test.cc
233 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
234 icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
235 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_so_test.o -fPIC -shared
236 icf_safe_so_test_1.stdout: icf_safe_so_test
237 $(TEST_NM) icf_safe_so_test > icf_safe_so_test_1.stdout
238 icf_safe_so_test_2.stdout: icf_safe_so_test
239 $(TEST_READELF) -h icf_safe_so_test > icf_safe_so_test_2.stdout
240
241 check_SCRIPTS += final_layout.sh
242 check_DATA += final_layout.stdout
243 MOSTLYCLEANFILES += final_layout final_layout_sequence.txt
244 final_layout.o: final_layout.cc
245 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
246 final_layout_sequence.txt:
247 (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
248 final_layout: final_layout.o final_layout_sequence.txt gcctestdir/ld
249 $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt final_layout.o
250 final_layout.stdout: final_layout
251 $(TEST_NM) -n --synthetic final_layout > final_layout.stdout
252
253 check_PROGRAMS += icf_virtual_function_folding_test
254 MOSTLYCLEANFILES += icf_virtual_function_folding_test
255 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
256 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
257 icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld
258 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie
259
260 check_SCRIPTS += icf_preemptible_functions_test.sh
261 check_DATA += icf_preemptible_functions_test.stdout
262 MOSTLYCLEANFILES += icf_preemptible_functions_test
263 icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
264 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
265 icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
266 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared
267 icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
268 $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout
269
270 check_SCRIPTS += icf_string_merge_test.sh
271 check_DATA += icf_string_merge_test.stdout
272 MOSTLYCLEANFILES += icf_string_merge_test
273 icf_string_merge_test.o: icf_string_merge_test.cc
274 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
275 icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
276 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o
277 icf_string_merge_test.stdout: icf_string_merge_test
278 $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
279
280 check_SCRIPTS += icf_sht_rel_addend_test.sh
281 check_DATA += icf_sht_rel_addend_test.stdout
282 MOSTLYCLEANFILES += icf_sht_rel_addend_test
283 icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
284 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
285 icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
286 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
287 icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
288 $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
289 icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
290 $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
291
292 check_PROGRAMS += basic_test
293 check_PROGRAMS += basic_pic_test
294 basic_test.o: basic_test.cc
295 $(CXXCOMPILE) -O0 -c -o $@ $<
296 basic_test: basic_test.o gcctestdir/ld
297 $(CXXLINK) -Bgcctestdir/ basic_test.o
298
299 if HAVE_STATIC
300 check_PROGRAMS += basic_static_test
301 basic_static_test: basic_test.o gcctestdir/ld
302 $(CXXLINK) -Bgcctestdir/ -static basic_test.o
303 endif
304
305 basic_pic_test.o: basic_test.cc
306 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
307 basic_pic_test: basic_pic_test.o gcctestdir/ld
308 $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
309
310 if HAVE_STATIC
311 check_PROGRAMS += basic_static_pic_test
312 basic_static_pic_test: basic_pic_test.o gcctestdir/ld
313 $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
314 endif
315
316 check_PROGRAMS += basic_pie_test
317 basic_pie_test.o: basic_test.cc
318 $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
319 basic_pie_test: basic_pie_test.o gcctestdir/ld
320 $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o
321
322 check_PROGRAMS += constructor_test
323 constructor_test_SOURCES = constructor_test.cc
324 constructor_test_DEPENDENCIES = gcctestdir/ld
325 constructor_test_LDFLAGS = -Bgcctestdir/
326 constructor_test_LDADD =
327
328 if HAVE_STATIC
329 check_PROGRAMS += constructor_static_test
330 constructor_static_test_SOURCES = $(constructor_test_SOURCES)
331 constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
332 constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
333 constructor_static_test_LDADD = $(constructor_test_LDADD)
334 endif
335
336 check_PROGRAMS += two_file_test
337 check_PROGRAMS += two_file_pic_test
338 two_file_test_SOURCES = \
339 two_file_test_1.cc \
340 two_file_test_1b.cc \
341 two_file_test_2.cc \
342 two_file_test_main.cc \
343 two_file_test.h
344 two_file_test_DEPENDENCIES = gcctestdir/ld
345 two_file_test_LDFLAGS = -Bgcctestdir/
346 two_file_test_LDADD =
347
348 if HAVE_STATIC
349 check_PROGRAMS += two_file_static_test
350 two_file_static_test_SOURCES = $(two_file_test_SOURCES)
351 two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
352 two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
353 two_file_static_test_LDADD = $(two_file_test_LDADD)
354 endif
355
356 two_file_pic_test_SOURCES = two_file_test_main.cc
357 two_file_pic_test_DEPENDENCIES = \
358 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
359 two_file_pic_test_LDFLAGS = -Bgcctestdir/
360 two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
361
362
363 check_PROGRAMS += two_file_shared_1_test
364 check_PROGRAMS += two_file_shared_2_test
365 check_PROGRAMS += two_file_shared_1_pic_2_test
366 check_PROGRAMS += two_file_shared_2_pic_1_test
367 check_PROGRAMS += two_file_same_shared_test
368 check_PROGRAMS += two_file_separate_shared_12_test
369 check_PROGRAMS += two_file_separate_shared_21_test
370 two_file_test_1_pic.o: two_file_test_1.cc
371 $(CXXCOMPILE) -c -fpic -o $@ $<
372 two_file_test_1b_pic.o: two_file_test_1b.cc
373 $(CXXCOMPILE) -c -fpic -o $@ $<
374 two_file_test_2_pic.o: two_file_test_2.cc
375 $(CXXCOMPILE) -c -fpic -o $@ $<
376 two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
377 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
378 two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
379 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
380 two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
381 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
382
383 two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
384 two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
385 two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
386 two_file_shared_1_test_LDADD = two_file_shared_1.so
387
388 two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
389 two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
390 two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
391 two_file_shared_2_test_LDADD = two_file_shared_2.so
392
393 two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
394 two_file_shared_1_pic_2_test_DEPENDENCIES = \
395 gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o
396 two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
397 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
398
399 two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
400 two_file_shared_2_pic_1_test_DEPENDENCIES = \
401 gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
402 two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
403 two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
404
405 two_file_same_shared_test_SOURCES = two_file_test_main.cc
406 two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
407 two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
408 two_file_same_shared_test_LDADD = two_file_shared.so
409
410 two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
411 two_file_separate_shared_12_test_DEPENDENCIES = \
412 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
413 two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
414 two_file_separate_shared_12_test_LDADD = \
415 two_file_shared_1.so two_file_shared_2.so
416
417 two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
418 two_file_separate_shared_21_test_DEPENDENCIES = \
419 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
420 two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
421 two_file_separate_shared_21_test_LDADD = \
422 two_file_shared_2.so two_file_shared_1.so
423
424 check_PROGRAMS += two_file_relocatable_test
425 two_file_relocatable_test_SOURCES = two_file_test_main.cc
426 two_file_relocatable_test_DEPENDENCIES = \
427 gcctestdir/ld two_file_relocatable.o
428 two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
429 two_file_relocatable_test_LDADD = two_file_relocatable.o
430 two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
431 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
432
433 check_PROGRAMS += two_file_pie_test
434 two_file_test_1_pie.o: two_file_test_1.cc
435 $(CXXCOMPILE) -c -fpie -o $@ $<
436 two_file_test_1b_pie.o: two_file_test_1b.cc
437 $(CXXCOMPILE) -c -fpie -o $@ $<
438 two_file_test_2_pie.o: two_file_test_2.cc
439 $(CXXCOMPILE) -c -fpie -o $@ $<
440 two_file_test_main_pie.o: two_file_test_main.cc
441 $(CXXCOMPILE) -c -fpie -o $@ $<
442 two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
443 two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
444 $(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
445
446 check_SCRIPTS += two_file_shared.sh
447 check_DATA += two_file_shared.dbg
448 MOSTLYCLEANFILES += two_file_shared.dbg
449 two_file_shared.dbg: two_file_shared.so
450 $(TEST_READELF) -w $< >$@ 2>/dev/null
451
452 # The nonpic tests will fail on platforms which can not put non-PIC
453 # code into shared libraries, so we just don't run them in that case.
454 if FN_PTRS_IN_SO_WITHOUT_PIC
455
456 check_PROGRAMS += two_file_shared_1_nonpic_test
457 check_PROGRAMS += two_file_shared_2_nonpic_test
458 check_PROGRAMS += two_file_same_shared_nonpic_test
459 check_PROGRAMS += two_file_separate_shared_12_nonpic_test
460 check_PROGRAMS += two_file_separate_shared_21_nonpic_test
461 check_PROGRAMS += two_file_mixed_shared_test
462 check_PROGRAMS += two_file_mixed_2_shared_test
463 two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
464 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext
465 two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
466 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
467 two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
468 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext
469 two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
470 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext
471 two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
472 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext
473
474 two_file_shared_1_nonpic_test_SOURCES = \
475 two_file_test_2.cc two_file_test_main.cc
476 two_file_shared_1_nonpic_test_DEPENDENCIES = \
477 gcctestdir/ld two_file_shared_1_nonpic.so
478 two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
479 two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
480
481 two_file_shared_2_nonpic_test_SOURCES = \
482 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
483 two_file_shared_2_nonpic_test_DEPENDENCIES = \
484 gcctestdir/ld two_file_shared_2_nonpic.so
485 two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
486 two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
487
488 two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
489 two_file_same_shared_nonpic_test_DEPENDENCIES = \
490 gcctestdir/ld two_file_shared_nonpic.so
491 two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
492 two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
493
494 two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
495 two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
496 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
497 two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
498 two_file_separate_shared_12_nonpic_test_LDADD = \
499 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
500
501 two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
502 two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
503 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
504 two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
505 two_file_separate_shared_21_nonpic_test_LDADD = \
506 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
507
508 two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
509 two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
510 two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
511 two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
512
513 two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
514 two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
515 two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
516 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
517
518 check_PROGRAMS += two_file_mixed_pie_test
519 two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
520 two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
521 $(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
522
523 endif FN_PTRS_IN_SO_WITHOUT_PIC
524
525 check_PROGRAMS += two_file_strip_test
526 two_file_strip_test: two_file_test
527 $(TEST_STRIP) -o two_file_strip_test two_file_test
528
529 check_PROGRAMS += two_file_same_shared_strip_test
530 two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
531 two_file_same_shared_strip_test_DEPENDENCIES = \
532 gcctestdir/ld two_file_shared_strip.so
533 two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
534 two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
535 two_file_shared_strip.so: two_file_shared.so
536 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
537
538 check_PROGRAMS += common_test_1
539 common_test_1_SOURCES = common_test_1.c
540 common_test_1_DEPENDENCIES = gcctestdir/ld
541 common_test_1_LDFLAGS = -Bgcctestdir/
542 common_test_1_LDADD =
543
544 check_PROGRAMS += common_test_2
545 common_test_2_SOURCES = common_test_1.c
546 common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
547 common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
548 common_test_2_LDADD = common_test_2.so common_test_3.so
549 common_test_2_pic.o: common_test_2.c
550 $(COMPILE) -c -fpic -o $@ $<
551 common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld
552 $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so
553 common_test_3_pic.o: common_test_3.c
554 $(COMPILE) -c -fpic -o $@ $<
555 common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld
556 $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script
557
558 check_PROGRAMS += exception_test
559 check_PROGRAMS += exception_shared_1_test
560 check_PROGRAMS += exception_shared_2_test
561 check_PROGRAMS += exception_same_shared_test
562 check_PROGRAMS += exception_separate_shared_12_test
563 check_PROGRAMS += exception_separate_shared_21_test
564 exception_test_1_pic.o: exception_test_1.cc
565 $(CXXCOMPILE) -c -fpic -o $@ $<
566 exception_test_2_pic.o: exception_test_2.cc
567 $(CXXCOMPILE) -c -fpic -o $@ $<
568 exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
569 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
570 exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
571 $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
572 exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
573 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
574
575 exception_test_SOURCES = \
576 exception_test_main.cc \
577 exception_test_1.cc \
578 exception_test_2.cc \
579 exception_test.h
580 exception_test_DEPENDENCIES = gcctestdir/ld
581 exception_test_LDFLAGS = -Bgcctestdir/
582 exception_test_LDADD =
583
584 if HAVE_STATIC
585 check_PROGRAMS += exception_static_test
586 exception_static_test_SOURCES = $(exception_test_SOURCES)
587 exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
588 exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
589 exception_static_test_LDADD = $(exception_test_LDADD)
590 endif
591
592 exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
593 exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
594 exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
595 exception_shared_1_test_LDADD = exception_shared_1.so
596
597 exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
598 exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
599 exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
600 exception_shared_2_test_LDADD = exception_shared_2.so
601
602 exception_same_shared_test_SOURCES = exception_test_main.cc
603 exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
604 exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
605 exception_same_shared_test_LDADD = exception_shared.so
606
607 exception_separate_shared_12_test_SOURCES = exception_test_main.cc
608 exception_separate_shared_12_test_DEPENDENCIES = \
609 gcctestdir/ld exception_shared_1.so exception_shared_2.so
610 exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
611 exception_separate_shared_12_test_LDADD = \
612 exception_shared_1.so exception_shared_2.so
613
614 exception_separate_shared_21_test_SOURCES = exception_test_main.cc
615 exception_separate_shared_21_test_DEPENDENCIES = \
616 gcctestdir/ld exception_shared_1.so exception_shared_2.so
617 exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
618 exception_separate_shared_21_test_LDADD = \
619 exception_shared_2.so exception_shared_1.so
620
621
622 check_PROGRAMS += weak_test
623 weak_test_SOURCES = weak_test.cc
624 weak_test_DEPENDENCIES = gcctestdir/ld
625 weak_test_LDFLAGS = -Bgcctestdir/
626 weak_test_LDADD =
627
628 check_PROGRAMS += weak_undef_test
629 MOSTLYCLEANFILES += alt/weak_undef_lib.so
630 weak_undef_test_SOURCES = weak_undef_test.cc
631 weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
632 weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
633 weak_undef_test_LDADD = -L . weak_undef_lib.so
634 weak_undef_file1.o: weak_undef_file1.cc
635 $(CXXCOMPILE) -c -fpic -o $@ $<
636 weak_undef_file2.o: weak_undef_file2.cc
637 $(CXXCOMPILE) -c -fpic -o $@ $<
638 weak_undef_lib.so: weak_undef_file1.o
639 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
640 alt/weak_undef_lib.so: weak_undef_file2.o
641 test -d alt || mkdir -p alt
642 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
643
644 if FN_PTRS_IN_SO_WITHOUT_PIC
645 check_PROGRAMS += weak_undef_nonpic_test
646 MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so
647 weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
648 weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
649 weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
650 weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
651 weak_undef_file1_nonpic.o: weak_undef_file1.cc
652 $(CXXCOMPILE) -c -o $@ $<
653 weak_undef_file2_nonpic.o: weak_undef_file2.cc
654 $(CXXCOMPILE) -c -o $@ $<
655 weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
656 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext
657 alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
658 test -d alt || mkdir -p alt
659 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext
660 endif FN_PTRS_IN_SO_WITHOUT_PIC
661
662
663 check_PROGRAMS += weak_alias_test
664 weak_alias_test_SOURCES = weak_alias_test_main.cc
665 weak_alias_test_DEPENDENCIES = \
666 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
667 weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so
668 weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
669 weak_alias_test_LDADD = \
670 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
671 weak_alias_test_4.so weak_alias_test_5.so
672 weak_alias_test_1_pic.o: weak_alias_test_1.cc
673 $(CXXCOMPILE) -c -fpic -o $@ $<
674 weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
675 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
676 weak_alias_test_2_pic.o: weak_alias_test_2.cc
677 $(CXXCOMPILE) -c -fpic -o $@ $<
678 weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
679 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
680 weak_alias_test_3.o: weak_alias_test_3.cc
681 $(CXXCOMPILE) -c -o $@ $<
682 weak_alias_test_4_pic.o: weak_alias_test_4.cc
683 $(CXXCOMPILE) -c -fpic -o $@ $<
684 weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
685 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
686 weak_alias_test_5_pic.o: weak_alias_test_5.cc
687 $(CXXCOMPILE) -c -fpic -o $@ $<
688 weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld
689 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \
690 -Wl,--version-script,$(srcdir)/weak_alias_test.script
691
692 check_SCRIPTS += weak_plt.sh
693 check_PROGRAMS += weak_plt
694 check_DATA += weak_plt_shared.so
695 weak_plt_main_pic.o: weak_plt_main.cc
696 $(CXXCOMPILE) -c -fpic -o $@ $<
697 weak_plt: weak_plt_main_pic.o gcctestdir/ld
698 $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
699 weak_plt_shared_pic.o: weak_plt_shared.cc
700 $(CXXCOMPILE) -c -fpic -o $@ $<
701 weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
702 $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
703
704 check_PROGRAMS += copy_test
705 copy_test_SOURCES = copy_test.cc
706 copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
707 copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
708 copy_test_LDADD = copy_test_1.so copy_test_2.so
709 copy_test_1_pic.o: copy_test_1.cc
710 $(CXXCOMPILE) -c -fpic -o $@ $<
711 copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
712 $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
713 copy_test_2_pic.o: copy_test_2.cc
714 $(CXXCOMPILE) -c -fpic -o $@ $<
715 copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
716 $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
717
718 if TLS
719
720 check_PROGRAMS += tls_test
721 check_PROGRAMS += tls_pic_test
722 check_PROGRAMS += tls_pie_test
723 check_PROGRAMS += tls_pie_pic_test
724 check_PROGRAMS += tls_shared_test
725 check_PROGRAMS += tls_shared_ie_test
726 check_PROGRAMS += tls_shared_gd_to_ie_test
727 tls_test_pic.o: tls_test.cc
728 $(CXXCOMPILE) -c -fpic -o $@ $<
729 tls_test_file2_pic.o: tls_test_file2.cc
730 $(CXXCOMPILE) -c -fpic -o $@ $<
731 tls_test_c_pic.o: tls_test_c.c
732 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
733 tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
734 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
735 tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
736 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
737
738 tls_test_pic_ie.o: tls_test.cc
739 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
740 tls_test_file2_pic_ie.o: tls_test_file2.cc
741 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
742 tls_test_c_pic_ie.o: tls_test_c.c
743 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
744 tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
745 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
746
747 tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
748 tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
749 tls_test_LDFLAGS = -Bgcctestdir/
750 tls_test_LDADD = tls_test_c.o -lpthread
751 tls_test_c.o: tls_test_c.c
752 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
753
754 tls_pic_test_SOURCES = tls_test_main.cc
755 tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
756 tls_test_c_pic.o
757 tls_pic_test_LDFLAGS = -Bgcctestdir/
758 tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
759 -lpthread
760
761 tls_test_main_pie.o: tls_test_main.cc tls_test.h
762 $(CXXCOMPILE) -c -fpie -o $@ $<
763 tls_test_pie.o: tls_test.cc tls_test.h
764 $(CXXCOMPILE) -c -fpie -o $@ $<
765 tls_test_file2_pie.o: tls_test_file2.cc tls_test.h
766 $(CXXCOMPILE) -c -fpie -o $@ $<
767 tls_test_c_pie.o: tls_test_c.c
768 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
769 tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \
770 tls_test_c_pie.o gcctestdir/ld
771 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread
772
773 tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \
774 tls_test_c_pic.o gcctestdir/ld
775 $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread
776
777 tls_shared_test_SOURCES = tls_test_main.cc
778 tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
779 tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
780 tls_shared_test_LDADD = tls_test_shared.so -lpthread
781
782 tls_shared_ie_test_SOURCES = tls_test_main.cc
783 tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
784 tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
785 tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
786
787 tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
788 tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
789 tls_test_c_pic.o tls_test_shared2.so
790 tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
791 tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
792 tls_test_shared2.so -lpthread
793
794 if TLS_GNU2_DIALECT
795
796 check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
797
798 tls_test_gnu2.o: tls_test.cc
799 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
800 tls_test_file2_gnu2.o: tls_test_file2.cc
801 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
802 tls_test_c_gnu2.o: tls_test_c.c
803 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
804 tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
805 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
806
807 tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
808 tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
809 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
810 tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
811 tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
812 tls_test_gnu2_shared2.so -lpthread
813
814 if TLS_DESCRIPTORS
815
816 check_PROGRAMS += tls_shared_gnu2_test
817
818 tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
819 $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
820
821 tls_shared_gnu2_test_SOURCES = tls_test_main.cc
822 tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
823 tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
824 tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
825
826 endif TLS_DESCRIPTORS
827
828 endif TLS_GNU2_DIALECT
829
830 if HAVE_STATIC
831 if STATIC_TLS
832 check_PROGRAMS += tls_static_test
833 check_PROGRAMS += tls_static_pic_test
834
835 tls_static_test_SOURCES = $(tls_test_SOURCES)
836 tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
837 tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
838 tls_static_test_LDADD = $(tls_test_LDADD)
839
840 tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
841 tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
842 tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
843 tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
844 endif
845 endif
846
847 if FN_PTRS_IN_SO_WITHOUT_PIC
848 check_PROGRAMS += tls_shared_nonpic_test
849 tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
850 $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext
851
852 tls_shared_nonpic_test_SOURCES = tls_test_main.cc
853 tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
854 tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
855 tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
856 endif FN_PTRS_IN_SO_WITHOUT_PIC
857
858 endif TLS
859
860 check_PROGRAMS += many_sections_test
861 many_sections_test_SOURCES = many_sections_test.cc
862 many_sections_test_DEPENDENCIES = gcctestdir/ld
863 many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
864 many_sections_test_LDADD =
865
866 BUILT_SOURCES += many_sections_define.h
867 MOSTLYCLEANFILES += many_sections_define.h
868 many_sections_define.h:
869 (for i in `seq 1 70000`; do \
870 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
871 done) > $@.tmp
872 mv -f $@.tmp $@
873
874 BUILT_SOURCES += many_sections_check.h
875 MOSTLYCLEANFILES += many_sections_check.h
876 many_sections_check.h:
877 (for i in `seq 1 1000 70000`; do \
878 echo "assert(var_$$i == $$i);"; \
879 done) > $@.tmp
880 mv -f $@.tmp $@
881
882 check_PROGRAMS += many_sections_r_test
883 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
884 gcctestdir/ld -r -o $@ many_sections_test.o
885 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
886 $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
887
888 check_PROGRAMS += initpri1
889 initpri1_SOURCES = initpri1.c
890 initpri1_DEPENDENCIES = gcctestdir/ld
891 initpri1_LDFLAGS = -Bgcctestdir/
892 initpri1_LDADD =
893
894 check_PROGRAMS += initpri2
895 initpri2_SOURCES = initpri2.c
896 initpri2_DEPENDENCIES = gcctestdir/ld
897 initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array
898 initpri2_LDADD =
899
900 check_PROGRAMS += initpri3a
901 initpri3a_SOURCES = initpri3.c
902 initpri3a_DEPENDENCIES = gcctestdir/ld
903 initpri3a_LDFLAGS = -Bgcctestdir/
904 initpri3a_LDADD =
905
906 # This test fails on targets not using .ctors and .dtors sections (e.g. ARM
907 # EABI). Given that gcc is moving towards using .init_array in all cases,
908 # this test is commented out. A better fix would be checking whether gcc
909 # uses .ctors or .init_array sections in configure.
910
911 # check_PROGRAMS += initpri3b
912 # initpri3b_SOURCES = initpri3.c
913 # initpri3b_DEPENDENCIES = gcctestdir/ld
914 # initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
915 # initpri3b_LDADD =
916
917 # Test --detect-odr-violations
918 check_SCRIPTS += debug_msg.sh
919
920 # Create the data files that debug_msg.sh analyzes.
921 check_DATA += debug_msg.err
922 MOSTLYCLEANFILES += debug_msg.err
923 debug_msg.o: debug_msg.cc
924 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
925 odr_violation1.o: odr_violation1.cc
926 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
927 # Compile with different optimization flags to check that rearranged
928 # instructions don't cause a false positive.
929 odr_violation2.o: odr_violation2.cc
930 $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
931 debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
932 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
933 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
934 then \
935 echo 1>&2 "Link of debug_msg should have failed"; \
936 rm -f $@; \
937 exit 1; \
938 fi
939
940
941 if HAVE_ZLIB
942
943 # Check that --detect-odr-violations works with compressed debug sections.
944 check_DATA += debug_msg_cdebug.err
945 MOSTLYCLEANFILES += debug_msg_cdebug.err
946 debug_msg_cdebug.o: debug_msg.cc gcctestdir/as
947 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc
948 odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as
949 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc
950 odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as
951 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc
952 debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld
953 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@"
954 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \
955 then \
956 echo 1>&2 "Link of debug_msg_cdebug should have failed"; \
957 rm -f $@; \
958 exit 1; \
959 fi
960
961 endif HAVE_ZLIB
962
963 # See if we can also detect problems when we're linking .so's, not .o's.
964 check_DATA += debug_msg_so.err
965 MOSTLYCLEANFILES += debug_msg_so.err
966 debug_msg.so: debug_msg.cc gcctestdir/ld
967 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
968 odr_violation1.so: odr_violation1.cc gcctestdir/ld
969 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
970 odr_violation2.so: odr_violation2.cc gcctestdir/ld
971 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
972 debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
973 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
974 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
975 then \
976 echo 1>&2 "Link of debug_msg_so should have failed"; \
977 rm -f $@; \
978 exit 1; \
979 fi
980
981 # We also want to make sure we do something reasonable when there's no
982 # debug info available. For the best test, we use .so's.
983 check_DATA += debug_msg_ndebug.err
984 MOSTLYCLEANFILES += debug_msg_ndebug.err
985 debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
986 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
987 odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
988 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
989 odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
990 $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
991 debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
992 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
993 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
994 then \
995 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
996 rm -f $@; \
997 exit 1; \
998 fi
999
1000
1001 # Similar to --detect-odr-violations: check for undefined symbols in .so's
1002 check_SCRIPTS += undef_symbol.sh
1003 check_DATA += undef_symbol.err
1004 MOSTLYCLEANFILES += undef_symbol.err
1005 undef_symbol.o: undef_symbol.cc
1006 $(CXXCOMPILE) -O0 -g -c -fPIC $<
1007 undef_symbol.so: undef_symbol.o gcctestdir/ld
1008 $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
1009 undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
1010 @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
1011 @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
1012 then \
1013 echo 1>&2 "Link of undef_symbol_test should have failed"; \
1014 rm -f $@; \
1015 exit 1; \
1016 fi
1017
1018
1019 # Test -o when emitting to a special file (such as something in /dev).
1020 check_PROGRAMS += flagstest_o_specialfile
1021 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
1022 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
1023 chmod a+x $@
1024 test -s $@
1025
1026 if HAVE_ZLIB
1027
1028 # Test --compress-debug-sections. FIXME: check we actually compress.
1029 check_PROGRAMS += flagstest_compress_debug_sections
1030 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
1031 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
1032 test -s $@
1033
1034
1035 # The specialfile output has a tricky case when we also compress debug
1036 # sections, because it requires output-file resizing.
1037 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
1038 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
1039 gcctestdir/ld
1040 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
1041 chmod a+x $@
1042 test -s $@
1043
1044 endif HAVE_ZLIB
1045
1046 # Test -TText and -Tdata.
1047 check_PROGRAMS += flagstest_o_ttext_1
1048 flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld
1049 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000
1050
1051 # This version won't be runnable, because there is no way to put the
1052 # PT_PHDR segment at file offset 0. We just make sure that we can
1053 # build it without error.
1054 check_DATA += flagstest_o_ttext_2
1055 flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld
1056 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010
1057
1058 # Test symbol versioning.
1059 check_PROGRAMS += ver_test
1060 ver_test_SOURCES = ver_test_main.cc
1061 ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
1062 ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1063 ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
1064 ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
1065 $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
1066 ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
1067 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so
1068 ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
1069 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
1070 ver_test_1.o: ver_test_1.cc
1071 $(CXXCOMPILE) -c -fpic -o $@ $<
1072 ver_test_2.o: ver_test_2.cc
1073 $(CXXCOMPILE) -c -fpic -o $@ $<
1074 ver_test_3.o: ver_test_3.cc
1075 $(CXXCOMPILE) -c -fpic -o $@ $<
1076 ver_test_4.o: ver_test_4.cc
1077 $(CXXCOMPILE) -c -fpic -o $@ $<
1078
1079 check_SCRIPTS += ver_test_1.sh
1080 check_DATA += ver_test_1.syms
1081 ver_test_1.syms: ver_test_1.so
1082 $(TEST_READELF) -s $< >$@ 2>/dev/null
1083
1084 check_PROGRAMS += ver_test_2
1085 ver_test_2_SOURCES = ver_test_main_2.cc
1086 ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
1087 ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1088 ver_test_2_LDADD = ver_test_4.so ver_test_2.so
1089
1090 check_SCRIPTS += ver_test_2.sh
1091 check_DATA += ver_test_2.syms
1092 ver_test_2.syms: ver_test_2
1093 $(TEST_READELF) -s $< >$@ 2>/dev/null
1094
1095 check_SCRIPTS += ver_test_4.sh
1096 check_DATA += ver_test_4.syms
1097 ver_test_4.syms: ver_test_4.so
1098 $(TEST_READELF) -s $< >$@ 2>/dev/null
1099
1100 ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
1101 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
1102 ver_test_5.o: ver_test_5.cc
1103 $(CXXCOMPILE) -c -fpic -o $@ $<
1104 check_SCRIPTS += ver_test_5.sh
1105 check_DATA += ver_test_5.syms
1106 ver_test_5.syms: ver_test_5.so
1107 $(TEST_READELF) -s $< >$@ 2>/dev/null
1108
1109 check_PROGRAMS += ver_test_6
1110 ver_test_6_SOURCES = ver_test_6.c
1111 ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
1112 ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1113 ver_test_6_LDADD = ver_test_2.so
1114
1115 ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
1116 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
1117 ver_test_7.o: ver_test_7.cc
1118 $(CXXCOMPILE) -c -fpic -o $@ $<
1119 check_SCRIPTS += ver_test_7.sh
1120 check_DATA += ver_test_7.syms
1121 ver_test_7.syms: ver_test_7.so
1122 $(TEST_READELF) -s $< >$@ 2>/dev/null
1123
1124 check_PROGRAMS += ver_test_8
1125 ver_test_8_SOURCES = two_file_test_main.cc
1126 ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
1127 ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1128 ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
1129 ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
1130 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
1131 ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
1132 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
1133
1134 check_PROGRAMS += ver_test_9
1135 ver_test_9_SOURCES = ver_test_main.cc
1136 ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
1137 ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1138 ver_test_9_LDADD = ver_test_9.so
1139 ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
1140 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so
1141 ver_test_9.o: ver_test_9.cc
1142 $(CXXCOMPILE) -c -fpic -o $@ $<
1143
1144 check_SCRIPTS += ver_test_10.sh
1145 check_DATA += ver_test_10.syms
1146 ver_test_10.syms: ver_test_10.so
1147 $(TEST_READELF) -s $< >$@ 2>/dev/null
1148 ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
1149 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
1150
1151 check_PROGRAMS += ver_test_11
1152 MOSTLYCLEANFILES += ver_test_11.a
1153 ver_test_11_SOURCES = ver_test_main_2.cc
1154 ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
1155 ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1156 ver_test_11_LDADD = ver_test_11.a
1157 ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
1158 $(TEST_AR) rc $@ $^
1159
1160 check_PROGRAMS += ver_test_12
1161 ver_test_12_SOURCES = ver_test_main_2.cc
1162 ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o
1163 ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1164 ver_test_12_LDADD = ver_test_12.o
1165 ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o
1166 gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o
1167
1168 check_PROGRAMS += protected_1
1169 protected_1_SOURCES = \
1170 protected_main_1.cc protected_main_2.cc protected_main_3.cc
1171 protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
1172 protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1173 protected_1_LDADD = protected_1.so
1174
1175 protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
1176 $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
1177 protected_1_pic.o: protected_1.cc
1178 $(CXXCOMPILE) -c -fpic -o $@ $<
1179 protected_2_pic.o: protected_2.cc
1180 $(CXXCOMPILE) -c -fpic -o $@ $<
1181 protected_3_pic.o: protected_3.cc
1182 $(CXXCOMPILE) -c -fpic -o $@ $<
1183
1184 check_PROGRAMS += protected_2
1185 protected_2_SOURCES = protected_main_1.cc protected_3.cc
1186 protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
1187 protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1188 protected_2_LDADD = protected_1.so
1189
1190 check_DATA += protected_3.err
1191 MOSTLYCLEANFILES += protected_3.err
1192 protected_4_pic.o: protected_4.cc
1193 $(CXXCOMPILE) -c -fpic -o $@ $<
1194 protected_3.err: protected_4_pic.o gcctestdir/ld
1195 @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@"
1196 @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \
1197 echo 1>&2 "Link of protected_4.so should have failed"; \
1198 rm -f $@; \
1199 exit 1; \
1200 fi
1201
1202 check_PROGRAMS += relro_test
1203 check_SCRIPTS += relro_test.sh
1204 check_DATA += relro_test.stdout
1205 relro_test_SOURCES = relro_test_main.cc
1206 relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
1207 relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1208 relro_test_LDADD = relro_test.so
1209 relro_test.so: gcctestdir/ld relro_test_pic.o
1210 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
1211 relro_test_pic.o: relro_test.cc
1212 $(CXXCOMPILE) -c -fpic -o $@ $<
1213 relro_test.stdout: relro_test.so
1214 $(TEST_READELF) -SlW relro_test.so > relro_test.stdout
1215
1216 check_PROGRAMS += relro_now_test
1217 relro_now_test_SOURCES = relro_test_main.cc
1218 relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so
1219 relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now
1220 relro_now_test_LDADD = relro_now_test.so
1221 relro_now_test.so: gcctestdir/ld relro_test_pic.o
1222 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o
1223
1224 check_PROGRAMS += relro_strip_test
1225 relro_strip_test_SOURCES = relro_test_main.cc
1226 relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
1227 relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1228 relro_strip_test_LDADD = relro_strip_test.so
1229 relro_strip_test.so: relro_test.so
1230 $(TEST_STRIP) -o $@ $<
1231
1232 check_PROGRAMS += relro_script_test
1233 relro_script_test_SOURCES = relro_test_main.cc
1234 relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
1235 relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1236 relro_script_test_LDADD = relro_script_test.so
1237 relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
1238 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o
1239
1240 check_PROGRAMS += script_test_1
1241 script_test_1_SOURCES = script_test_1.cc
1242 script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
1243 script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
1244 script_test_1_LDADD =
1245
1246 check_PROGRAMS += script_test_2
1247 script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
1248 script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
1249 script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
1250 script_test_2_LDADD =
1251
1252 check_PROGRAMS += justsyms
1253 justsyms_SOURCES = justsyms_1.cc
1254 justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
1255 justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
1256 justsyms_LDADD =
1257 justsyms_2.o: justsyms_2.cc
1258 $(CXXCOMPILE) -c -o $@ $<
1259 justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
1260 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
1261
1262 check_PROGRAMS += justsyms_exec
1263 justsyms_exec_SOURCES = justsyms_exec.c
1264 justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib
1265 justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib
1266 justsyms_exec_LDADD =
1267 justsyms_lib.o: justsyms_lib.c
1268 $(COMPILE) -c -o $@ $<
1269 justsyms_lib: justsyms_lib.o gcctestdir/ld
1270 gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o
1271
1272 check_PROGRAMS += binary_test
1273 MOSTLYCLEANFILES += binary.txt
1274 binary_test_SOURCES = binary_test.cc
1275 binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
1276 binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
1277 binary_test_LDADD =
1278 # Copy the file to the build directory to avoid worrying about the
1279 # full pathname in the generated symbols.
1280 binary.txt: $(srcdir)/binary.in
1281 rm -f $@
1282 $(LN_S) $< $@
1283
1284 check_SCRIPTS += ver_matching_test.sh
1285 check_DATA += ver_matching_test.stdout
1286 MOSTLYCLEANFILES += ver_matching_test.stdout
1287 ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld
1288 $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map
1289 ver_matching_def_pic.o: ver_matching_def.cc
1290 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
1291 ver_matching_test.stdout: ver_matching_def.so
1292 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1293
1294 check_PROGRAMS += script_test_3
1295 check_SCRIPTS += script_test_3.sh
1296 check_DATA += script_test_3.stdout
1297 MOSTLYCLEANFILES += script_test_3.stdout
1298 script_test_3: basic_test.o gcctestdir/ld script_test_3.t
1299 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
1300 script_test_3.stdout: script_test_3
1301 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
1302
1303 check_PROGRAMS += tls_phdrs_script_test
1304 tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
1305 tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
1306 tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t
1307 tls_phdrs_script_test_LDADD = $(tls_test_LDADD)
1308
1309 check_SCRIPTS += script_test_4.sh
1310 check_DATA += script_test_4.stdout
1311 MOSTLYCLEANFILES += script_test_4
1312 script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
1313 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
1314 script_test_4.stdout: script_test_4
1315 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
1316
1317 check_PROGRAMS += tls_script_test
1318 tls_script_test_SOURCES = $(tls_test_SOURCES)
1319 tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t
1320 tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t
1321 tls_script_test_LDADD = $(tls_test_LDADD)
1322
1323 check_SCRIPTS += script_test_5.sh
1324 check_DATA += script_test_5.stdout
1325 MOSTLYCLEANFILES += script_test_5
1326 script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
1327 $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t
1328 script_test_5.stdout: script_test_5
1329 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
1330
1331 check_SCRIPTS += script_test_6.sh
1332 check_DATA += script_test_6.stdout
1333 MOSTLYCLEANFILES += script_test_6
1334 script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t
1335 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \
1336 -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000
1337 script_test_6.stdout: script_test_6
1338 $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout
1339
1340 check_SCRIPTS += script_test_7.sh
1341 check_DATA += script_test_7.stdout
1342 MOSTLYCLEANFILES += script_test_7
1343 script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1344 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t
1345 script_test_7.stdout: script_test_7
1346 $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout
1347
1348 check_SCRIPTS += script_test_8.sh
1349 check_DATA += script_test_8.stdout
1350 MOSTLYCLEANFILES += script_test_8
1351 script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
1352 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \
1353 -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000
1354 script_test_8.stdout: script_test_8
1355 $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout
1356
1357
1358 check_SCRIPTS += script_test_9.sh
1359 check_DATA += script_test_9.stdout
1360 script_test_9.o: script_test_9.cc
1361 $(CXXCOMPILE) -O0 -c -o $@ $<
1362 script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
1363 $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t
1364 script_test_9.stdout: script_test_9
1365 $(TEST_READELF) -lW script_test_9 > script_test_9.stdout
1366
1367
1368 # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
1369 # and --dynamic-list-cpp-typeinfo
1370
1371 check_SCRIPTS += dynamic_list.sh
1372 check_DATA += dynamic_list.stdout
1373 MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout
1374 dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
1375 $(CXXLINK) -Bgcctestdir/ basic_test.o \
1376 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
1377 -Wl,--dynamic-list-data \
1378 -Wl,--dynamic-list-cpp-new \
1379 -Wl,--dynamic-list-cpp-typeinfo
1380 dynamic_list.stdout: dynamic_list
1381 $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout
1382
1383 check_PROGRAMS += thin_archive_test_1
1384 MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
1385 alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
1386 alt/libthin2.a alt/libthin4.a
1387 thin_archive_test_1_SOURCES = thin_archive_main.cc
1388 thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
1389 thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
1390 thin_archive_test_1_LDADD = libthin1.a -lthin2
1391
1392 check_PROGRAMS += thin_archive_test_2
1393 thin_archive_test_2_SOURCES = thin_archive_main.cc
1394 thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
1395 thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
1396 thin_archive_test_2_LDADD = -lthinall
1397
1398 libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
1399 rm -f $@
1400 $(TEST_AR) crT $@ $^
1401 alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
1402 rm -f $@
1403 $(TEST_AR) crT $@ $^
1404 libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
1405 rm -f $@
1406 $(TEST_AR) crT $@ $^
1407 alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
1408 rm -f $@
1409 $(TEST_AR) crT $@ $^
1410 libthinall.a: libthin3.a alt/libthin4.a
1411 rm -f $@
1412 $(TEST_AR) crT $@ $^
1413 alt/thin_archive_test_2.o: thin_archive_test_2.cc
1414 test -d alt || mkdir -p alt
1415 $(CXXCOMPILE) -c -o $@ $<
1416 alt/thin_archive_test_4.o: thin_archive_test_4.cc
1417 test -d alt || mkdir -p alt
1418 $(CXXCOMPILE) -c -o $@ $<
1419
1420 if PLUGINS
1421
1422 check_PROGRAMS += plugin_test_1
1423 check_SCRIPTS += plugin_test_1.sh
1424 check_DATA += plugin_test_1.err
1425 MOSTLYCLEANFILES += plugin_test_1.err
1426 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
1427 $(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
1428 plugin_test_1.err: plugin_test_1
1429 @touch plugin_test_1.err
1430
1431 check_PROGRAMS += plugin_test_2
1432 check_SCRIPTS += plugin_test_2.sh
1433 check_DATA += plugin_test_2.err
1434 MOSTLYCLEANFILES += plugin_test_2.err
1435 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
1436 $(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
1437 plugin_test_2.err: plugin_test_2
1438 @touch plugin_test_2.err
1439
1440 check_PROGRAMS += plugin_test_3
1441 check_SCRIPTS += plugin_test_3.sh
1442 check_DATA += plugin_test_3.err
1443 MOSTLYCLEANFILES += plugin_test_3.err
1444 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
1445 $(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
1446 plugin_test_3.err: plugin_test_3
1447 @touch plugin_test_3.err
1448
1449 check_PROGRAMS += plugin_test_4
1450 check_SCRIPTS += plugin_test_4.sh
1451 check_DATA += plugin_test_4.err
1452 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
1453 plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
1454 $(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
1455 plugin_test_4.err: plugin_test_4
1456 @touch plugin_test_4.err
1457
1458 plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
1459 $(TEST_AR) cr $@ $^
1460
1461 check_PROGRAMS += plugin_test_5
1462 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
1463 $(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
1464
1465 check_PROGRAMS += plugin_test_6
1466 check_SCRIPTS += plugin_test_6.sh
1467 check_DATA += plugin_test_6.err
1468 MOSTLYCLEANFILES += plugin_test_6.err
1469 plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so
1470 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err
1471 plugin_test_6.err: plugin_test_6
1472 @touch plugin_test_6.err
1473
1474 check_PROGRAMS += plugin_test_7
1475 check_SCRIPTS += plugin_test_7.sh
1476 check_DATA += plugin_test_7.err plugin_test_7.syms
1477 MOSTLYCLEANFILES += plugin_test_7.err
1478 plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
1479 $(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
1480 plugin_test_7.syms: plugin_test_7
1481 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1482 plugin_test_7_1.o: plugin_test_7_1.c
1483 $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1484 plugin_test_7_1_orig.o: plugin_test_7_1.c
1485 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1486 plugin_test_7_1.syms: plugin_test_7_1_orig.o
1487 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1488 plugin_test_7_2.o: plugin_test_7_2.c
1489 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
1490 plugin_test_7.err: plugin_test_7
1491
1492 # Test plugins with -r.
1493 check_PROGRAMS += plugin_test_8
1494 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
1495 ../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
1496 plugin_test_8: plugin_test_8.o gcctestdir/ld
1497 $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o
1498
1499 # Test that symbols known in the IR file but not in the replacement file
1500 # produce an unresolved symbol error.
1501 check_DATA += plugin_test_9.err
1502 MOSTLYCLEANFILES += plugin_test_9.err
1503 plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so
1504 @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>$@"
1505 @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 \
1506 echo 1>&2 "Link of plugin_test_9 should have failed"; \
1507 rm -f $@; \
1508 exit 1; \
1509 fi
1510 # Make a .syms file that claims to define the symbol _Z4t16av.
1511 two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o
1512 cp two_file_test_1.syms $@.tmp
1513 grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp
1514 mv -f $@.tmp $@
1515 # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
1516 MOSTLYCLEANFILES += two_file_test_1c.o
1517 two_file_test_1c.o: two_file_test_1.o
1518 cp two_file_test_1.o $@
1519
1520 plugin_test.so: plugin_test.o
1521 $(LINK) -Bgcctestdir/ -shared plugin_test.o
1522 plugin_test.o: plugin_test.c
1523 $(COMPILE) -O0 -c -fpic -o $@ $<
1524
1525 two_file_test_main.syms: two_file_test_main.o
1526 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1527 two_file_test_1.syms: two_file_test_1.o
1528 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1529 two_file_test_1b.syms: two_file_test_1b.o
1530 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1531 two_file_test_2.syms: two_file_test_2.o
1532 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1533 plugin_common_test_1.syms: plugin_common_test_1.o
1534 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1535 plugin_common_test_2.syms: plugin_common_test_2.o
1536 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1537
1538 empty.syms:
1539 @echo "" >$@
1540 @echo "Symbol table" >>$@
1541
1542 MOSTLYCLEANFILES += unused.c
1543 unused.syms: unused.o
1544 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1545 @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@
1546 unused.o: unused.c
1547 $(COMPILE) -c -o $@ $<
1548 unused.c:
1549 @cp /dev/null $@
1550
1551 check_SCRIPTS += plugin_final_layout.sh
1552 check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout
1553 plugin_final_layout.o: plugin_final_layout.cc
1554 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
1555 plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
1556 $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
1557 plugin_final_layout.stdout: plugin_final_layout
1558 $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout
1559 plugin_final_layout_readelf.stdout: plugin_final_layout
1560 $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout
1561
1562 plugin_section_order.so: plugin_section_order.o
1563 $(LINK) -Bgcctestdir/ -shared plugin_section_order.o
1564 plugin_section_order.o: plugin_section_order.c
1565 $(COMPILE) -O0 -c -fpic -o $@ $<
1566
1567 endif PLUGINS
1568
1569 check_PROGRAMS += exclude_libs_test
1570 check_SCRIPTS += exclude_libs_test.sh
1571 check_DATA += exclude_libs_test.syms
1572 MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
1573 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1574 exclude_libs_test_SOURCES = exclude_libs_test.c
1575 exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
1576 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1577 exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
1578 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
1579 -Wl,--exclude-libs,libexclude_libs_test_3
1580 exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
1581 alt/libexclude_libs_test_3.a
1582 exclude_libs_test.syms: exclude_libs_test
1583 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1584 libexclude_libs_test_1.a: exclude_libs_test_1.o
1585 $(TEST_AR) rc $@ $^
1586 libexclude_libs_test_2.a: exclude_libs_test_2.o
1587 $(TEST_AR) rc $@ $^
1588 alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
1589 test -d alt || mkdir -p alt
1590 $(TEST_AR) rc $@ $^
1591
1592 check_PROGRAMS += local_labels_test
1593 local_labels_test.o: ver_test_6.c
1594 $(COMPILE) -g -c -Wa,-L -o $@ $<
1595 local_labels_test: local_labels_test.o
1596 $(LINK) -Bgcctestdir/ local_labels_test.o
1597
1598 check_PROGRAMS += discard_locals_test
1599 check_SCRIPTS += discard_locals_test.sh
1600 check_DATA += discard_locals_test.syms \
1601 discard_locals_relocatable_test1.syms \
1602 discard_locals_relocatable_test2.syms
1603 MOSTLYCLEANFILES += discard_locals_test.syms \
1604 discard_locals_relocatable_test1.syms \
1605 discard_locals_relocatable_test2.syms \
1606 discard_locals_relocatable_test1.out \
1607 discard_locals_relocatable_test2.out
1608 discard_locals_test_SOURCES = discard_locals_test.c
1609 discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
1610 discard_locals_test.syms: discard_locals_test
1611 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1612 # '-Wa,-L' is required to preserve the local label used for testing.
1613 discard_locals_test.o: discard_locals_test.c
1614 $(COMPILE) -c -Wa,-L -o $@ $<
1615
1616 discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out
1617 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1618 discard_locals_relocatable_test.o: discard_locals_relocatable_test.c
1619 $(COMPILE) -c -Wa,-L -fPIC -o $@ $<
1620 discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new
1621 ../ld-new --discard-locals -relocatable -o $@ $<
1622
1623 discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out
1624 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1625 discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new
1626 ../ld-new --discard-all -relocatable -o $@ $<
1627
1628 if MCMODEL_MEDIUM
1629 check_PROGRAMS += large
1630 large_SOURCES = large.c
1631 large_CFLAGS = -mcmodel=medium
1632 large_DEPENDENCIES = gcctestdir/ld
1633 large_LDFLAGS = -Bgcctestdir/
1634 large_LDADD =
1635 endif MCMODEL_MEDIUM
1636
1637 # Test that hidden and internal symbols in the main program cannot be
1638 # referenced by a shared library.
1639 check_SCRIPTS += hidden_test.sh
1640 check_DATA += hidden_test.err
1641 MOSTLYCLEANFILES += hidden_test hidden_test.err
1642 libhidden.so: hidden_test_1.c gcctestdir/ld
1643 $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
1644 hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
1645 $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
1646 hidden_test.err: hidden_test
1647 @touch hidden_test.err
1648
1649 # Test -retain-symbols-file.
1650 check_SCRIPTS += retain_symbols_file_test.sh
1651 check_DATA += retain_symbols_file_test.stdout
1652 MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
1653 retain_symbols_file_test.stdout
1654 retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld
1655 echo 'main' > retain_symbols_file_test.in
1656 echo 't1' >> retain_symbols_file_test.in
1657 echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in
1658 echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
1659 echo '_Z3t18v' >> retain_symbols_file_test.in
1660 echo '__tcf_0' >> retain_symbols_file_test.in
1661 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
1662 retain_symbols_file_test.stdout: retain_symbols_file_test.so
1663 $(TEST_NM) -C retain_symbols_file_test.so > $@
1664
1665
1666 # Test that if the output file already exists and is empty,
1667 # it will get execute permission.
1668 check_PROGRAMS += permission_test
1669 permission_test: basic_test.o gcctestdir/ld
1670 umask 022; \
1671 rm -f $@; \
1672 touch $@; \
1673 chmod 600 $@; \
1674 $(CXXLINK) -Bgcctestdir/ basic_test.o
1675
1676 # Check -l:foo.a
1677 check_PROGRAMS += searched_file_test
1678 MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
1679 alt/searched_file_test_lib.a
1680 searched_file_test_SOURCES = searched_file_test.cc
1681 searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
1682 searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
1683 searched_file_test_LDADD = -l:searched_file_test_lib.a
1684 searched_file_test_lib.o: searched_file_test_lib.cc
1685 $(CXXCOMPILE) -c -o $@ $<
1686 alt/searched_file_test_lib.a: searched_file_test_lib.o
1687 test -d alt || mkdir -p alt
1688 $(TEST_AR) rc $@ $^
1689
1690 # Test that no .gnu.version sections are created when
1691 # symbol versioning is not used.
1692 check_SCRIPTS += no_version_test.sh
1693 check_DATA += no_version_test.stdout
1694 MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
1695 # We invoke the linker directly since gcc may include additional objects that
1696 # uses symbol versioning.
1697 libno_version_test.so: no_version_test.o gcctestdir/ld
1698 gcctestdir/ld -shared -o $@ no_version_test.o
1699 no_version_test.o: no_version_test.c
1700 $(COMPILE) -o $@ -c -fPIC $<
1701 no_version_test.stdout: libno_version_test.so
1702 $(TEST_OBJDUMP) -h $< > $@
1703
1704 # Test STT_GNU_IFUNC symbols.
1705 if IFUNC
1706
1707 ifuncmod1.o: ifuncmod1.c
1708 $(COMPILE) -c -fPIC -o $@ $<
1709 ifuncmod1.so: ifuncmod1.o gcctestdir/ld
1710 $(LINK) -Bgcctestdir/ -shared ifuncmod1.o
1711
1712 ifuncdep1.o: ifuncmod1.c
1713 $(COMPILE) -c -o $@ $<
1714
1715 ifuncmain1pic.o: ifuncmain1.c
1716 $(COMPILE) -c -fPIC -o $@ $<
1717 ifuncmain1pie.o: ifuncmain1.c
1718 $(COMPILE) -c -fPIE -o $@ $<
1719
1720 if HAVE_STATIC
1721 if IFUNC_STATIC
1722 check_PROGRAMS += ifuncmain1static
1723 ifuncmain1static_SOURCES = ifuncmain1.c
1724 ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
1725 ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
1726 ifuncmain1static_LDADD = ifuncdep1.o
1727
1728 check_PROGRAMS += ifuncmain1picstatic
1729 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
1730 $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
1731 endif
1732 endif
1733
1734 check_PROGRAMS += ifuncmain1
1735 ifuncmain1_SOURCES = ifuncmain1.c
1736 ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
1737 ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1738 ifuncmain1_LDADD = ifuncmod1.so
1739
1740 check_PROGRAMS += ifuncmain1pic
1741 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
1742 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
1743
1744 check_PROGRAMS += ifuncmain1vis
1745 ifuncmain1vis_SOURCES = ifuncmain1vis.c
1746 ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
1747 ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1748 ifuncmain1vis_LDADD = ifuncmod1.so
1749
1750 check_PROGRAMS += ifuncmain1vispic
1751 ifuncmain1vispic.o: ifuncmain1vis.c
1752 $(COMPILE) -c -fPIC -o $@ $<
1753 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
1754 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
1755
1756 check_PROGRAMS += ifuncmain1staticpic
1757 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
1758 $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
1759
1760 check_PROGRAMS += ifuncmain1pie
1761 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
1762 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
1763
1764 check_PROGRAMS += ifuncmain1vispie
1765 ifuncmain1vispie.o: ifuncmain1vis.c
1766 $(COMPILE) -c -fPIE -o $@ $<
1767 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
1768 $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
1769
1770 check_PROGRAMS += ifuncmain1staticpie
1771 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
1772 $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
1773
1774 ifuncmain2pic.o: ifuncmain2.c
1775 $(COMPILE) -c -fPIC -o $@ $<
1776
1777 ifuncdep2pic.o: ifuncdep2.c
1778 $(COMPILE) -c -fPIC -o $@ $<
1779
1780 if HAVE_STATIC
1781 if IFUNC_STATIC
1782 check_PROGRAMS += ifuncmain2static
1783 ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
1784 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
1785 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
1786 ifuncmain2static_LDADD =
1787
1788 check_PROGRAMS += ifuncmain2picstatic
1789 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
1790 $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
1791 endif
1792 endif
1793
1794 check_PROGRAMS += ifuncmain2
1795 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
1796 ifuncmain2_DEPENDENCIES = gcctestdir/ld
1797 ifuncmain2_LDFLAGS = -Bgcctestdir/
1798 ifuncmain2_LDADD =
1799
1800 check_PROGRAMS += ifuncmain2pic
1801 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
1802 $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
1803
1804 ifuncmod3.o: ifuncmod3.c
1805 $(COMPILE) -c -fPIC -o $@ $<
1806 ifuncmod3.so: ifuncmod3.o gcctestdir/ld
1807 $(LINK) -Bgcctestdir/ -shared ifuncmod3.o
1808
1809 check_PROGRAMS += ifuncmain3
1810 ifuncmain3_SOURCES = ifuncmain3.c
1811 ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
1812 ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
1813 ifuncmain3_LDADD = -ldl
1814
1815 ifuncmain4pic.o: ifuncmain4.c
1816 $(COMPILE) -c -fPIC -o $@ $<
1817
1818 if HAVE_STATIC
1819 if IFUNC_STATIC
1820 check_PROGRAMS += ifuncmain4static
1821 ifuncmain4static_SOURCES = ifuncmain4.c
1822 ifuncmain4static_DEPENDENCIES = gcctestdir/ld
1823 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
1824 ifuncmain4static_LDADD =
1825
1826 check_PROGRAMS += ifuncmain4picstatic
1827 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
1828 $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
1829 endif
1830 endif
1831
1832 check_PROGRAMS += ifuncmain4
1833 ifuncmain4_SOURCES = ifuncmain4.c
1834 ifuncmain4_DEPENDENCIES = gcctestdir/ld
1835 ifuncmain4_LDFLAGS = -Bgcctestdir/
1836 ifuncmain4_LDADD =
1837
1838 ifuncmain5pic.o: ifuncmain5.c
1839 $(COMPILE) -c -fPIC -o $@ $<
1840
1841 ifuncmain5pie.o: ifuncmain5.c
1842 $(COMPILE) -c -fPIE -o $@ $<
1843
1844 ifuncmod5.o: ifuncmod5.c
1845 $(COMPILE) -c -fPIC -o $@ $<
1846 ifuncmod5.so: ifuncmod5.o gcctestdir/ld
1847 $(LINK) -Bgcctestdir/ -shared ifuncmod5.o
1848
1849 ifuncdep5.o: ifuncmod5.c
1850 $(COMPILE) -c -o $@ $<
1851
1852 if HAVE_STATIC
1853 if IFUNC_STATIC
1854 check_PROGRAMS += ifuncmain5static
1855 ifuncmain5static_SOURCES = ifuncmain5.c
1856 ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
1857 ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
1858 ifuncmain5static_LDADD = ifuncdep5.o
1859
1860 check_PROGRAMS += ifuncmain5picstatic
1861 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
1862 $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
1863 endif
1864 endif
1865
1866 check_PROGRAMS += ifuncmain5
1867 ifuncmain5_SOURCES = ifuncmain5.c
1868 ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
1869 ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1870 ifuncmain5_LDADD = ifuncmod5.so
1871
1872 check_PROGRAMS += ifuncmain5pic
1873 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
1874 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
1875
1876 check_PROGRAMS += ifuncmain5staticpic
1877 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
1878 $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
1879
1880 check_PROGRAMS += ifuncmain5pie
1881 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
1882 $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
1883
1884 ifuncmain6pie.o: ifuncmain6pie.c
1885 $(COMPILE) -c -fPIE -o $@ $<
1886
1887 ifuncmod6.o: ifuncmod6.c
1888 $(COMPILE) -c -fPIC -o $@ $<
1889 ifuncmod6.so: ifuncmod6.o gcctestdir/ld
1890 $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
1891
1892 check_PROGRAMS += ifuncmain6pie
1893 ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
1894 $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
1895
1896 ifuncmain7pic.o: ifuncmain7.c
1897 $(COMPILE) -c -fPIC -o $@ $<
1898
1899 ifuncmain7pie.o: ifuncmain7.c
1900 $(COMPILE) -c -fPIE -o $@ $<
1901
1902 if HAVE_STATIC
1903 if IFUNC_STATIC
1904 check_PROGRAMS += ifuncmain7static
1905 ifuncmain7static_SOURCES = ifuncmain7.c
1906 ifuncmain7static_DEPENDENCIES = gcctestdir/ld
1907 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
1908 ifuncmain7static_LDADD =
1909
1910 check_PROGRAMS += ifuncmain7picstatic
1911 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
1912 $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
1913 endif
1914 endif
1915
1916 check_PROGRAMS += ifuncmain7
1917 ifuncmain7_SOURCES = ifuncmain7.c
1918 ifuncmain7_DEPENDENCIES = gcctestdir/ld
1919 ifuncmain7_LDFLAGS = -Bgcctestdir/
1920 ifuncmain7_LDADD =
1921
1922 check_PROGRAMS += ifuncmain7pic
1923 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
1924 $(LINK) -Bgcctestdir/ ifuncmain7pic.o
1925
1926 check_PROGRAMS += ifuncmain7pie
1927 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
1928 $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
1929
1930 check_PROGRAMS += ifuncvar
1931 ifuncvar1_pic.o: ifuncvar1.c
1932 $(COMPILE) -c -fPIC -o $@ $<
1933 ifuncvar2_pic.o: ifuncvar2.c
1934 $(COMPILE) -c -fPIC -o $@ $<
1935 ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
1936 $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o
1937 ifuncvar_SOURCES = ifuncvar3.c
1938 ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
1939 ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
1940 ifuncvar_LDADD = ifuncvar.so
1941
1942 endif IFUNC
1943
1944 # Test that strong reference to a weak symbol in a DSO remains strong.
1945 check_SCRIPTS += strong_ref_weak_def.sh
1946 check_DATA += strong_ref_weak_def.stdout
1947 MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
1948 strong_ref_weak_def.stdout
1949 strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
1950 $(COMPILE) -o $@ -c -fPIC $<
1951 strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
1952 gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
1953 strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
1954 $(COMPILE) -o $@ -c -fPIC $<
1955 strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
1956 gcctestdir/ld
1957 gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
1958 strong_ref_weak_def_2.so
1959 strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
1960 $(TEST_READELF) -sWD $< > $@
1961
1962 # Test that a strong weak reference remains strong if there is another
1963 # weak reference in a DSO.
1964 check_SCRIPTS += dyn_weak_ref.sh
1965 check_DATA += dyn_weak_ref.stdout
1966 MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
1967 dyn_weak_ref.stdout
1968 dyn_weak_ref_2.o: dyn_weak_ref_2.c
1969 $(COMPILE) -o $@ -c -fPIC $<
1970 dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
1971 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
1972 dyn_weak_ref_1.o: dyn_weak_ref_1.c
1973 $(COMPILE) -o $@ -c -fPIC $<
1974 # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
1975 # so that the weak ref there goes to gold's symbol table first.
1976 dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
1977 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
1978 dyn_weak_ref.stdout: dyn_weak_ref_1.so
1979 $(TEST_READELF) -sWD $< > $@
1980
1981
1982 # Test that --start-lib and --end-lib function correctly.
1983 check_PROGRAMS += start_lib_test
1984 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
1985 gcctestdir/ld
1986 $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
1987 -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib
1988 libstart_lib_test.a: start_lib_test_1.o
1989 $(TEST_AR) rc $@ $^
1990
1991 # Test that MEMORY region support works.
1992 check_SCRIPTS += memory_test.sh
1993 check_DATA += memory_test.stdout
1994 MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o
1995 memory_test.o: memory_test.s
1996 $(COMPILE) -o $@ -c $<
1997 memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t
1998 $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -T $(srcdir)/memory_test.t -o $@ memory_test.o
1999 memory_test.stdout: memory_test
2000 $(TEST_READELF) -lWS $< > $@
2001
2002 if HAVE_PUBNAMES
2003
2004 # Test that --gdb-index functions correctly without gcc-generated pubnames.
2005 check_SCRIPTS += gdb_index_test_1.sh
2006 check_DATA += gdb_index_test_1.stdout
2007 MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1
2008 gdb_index_test.o: gdb_index_test.cc
2009 $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $<
2010 gdb_index_test_1: gdb_index_test.o gcctestdir/ld
2011 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2012 gdb_index_test_1.stdout: gdb_index_test_1
2013 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2014
2015 if HAVE_ZLIB
2016
2017 # Test that --gdb-index functions correctly with compressed debug sections.
2018 check_SCRIPTS += gdb_index_test_2.sh
2019 check_DATA += gdb_index_test_2.stdout
2020 MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2
2021 gdb_index_test_cdebug.o: gdb_index_test.cc
2022 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
2023 gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
2024 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2025 gdb_index_test_2.stdout: gdb_index_test_2
2026 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2027
2028 endif HAVE_ZLIB
2029
2030 # Another simple C test (DW_AT_high_pc encoding) for --gdb-index.
2031 check_SCRIPTS += gdb_index_test_3.sh
2032 check_DATA += gdb_index_test_3.stdout
2033 MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3
2034 gdb_index_test_3.o: gdb_index_test_3.c
2035 $(COMPILE) -O0 -g -c -o $@ $<
2036 gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld
2037 $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $<
2038 gdb_index_test_3.stdout: gdb_index_test_3
2039 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2040
2041 # Test that --gdb-index functions correctly with gcc-generated pubnames.
2042 check_SCRIPTS += gdb_index_test_4.sh
2043 check_DATA += gdb_index_test_4.stdout
2044 MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4
2045 gdb_index_test_pub.o: gdb_index_test.cc
2046 $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $<
2047 gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld
2048 $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
2049 gdb_index_test_4.stdout: gdb_index_test_4
2050 $(TEST_READELF) --debug-dump=gdb_index $< > $@
2051
2052 endif HAVE_PUBNAMES
2053
2054 # End-to-end incremental linking tests.
2055 # Incremental linking is currently supported only on the x86_64 target.
2056
2057 if DEFAULT_TARGET_X86_64
2058
2059 two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
2060 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2061 two_file_test_1_ndebug.o: two_file_test_1.cc
2062 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2063 two_file_test_1b_ndebug.o: two_file_test_1b.cc
2064 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2065 two_file_test_2_ndebug.o: two_file_test_2.cc
2066 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2067 two_file_test_main_ndebug.o: two_file_test_main.cc
2068 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
2069
2070 check_PROGRAMS += incremental_test_2
2071 MOSTLYCLEANFILES += two_file_test_tmp_2.o
2072 incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
2073 two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
2074 cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
2075 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
2076 @sleep 1
2077 cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
2078 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
2079
2080 check_PROGRAMS += incremental_test_3
2081 MOSTLYCLEANFILES += two_file_test_tmp_3.o
2082 incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2083 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2084 cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
2085 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
2086 @sleep 1
2087 cp -f two_file_test_1b.o two_file_test_tmp_3.o
2088 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
2089
2090 check_PROGRAMS += incremental_test_4
2091 MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
2092 incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
2093 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2094 cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
2095 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
2096 mv -f incremental_test_4 incremental_test_4.base
2097 @sleep 1
2098 cp -f two_file_test_2.o two_file_test_tmp_4.o
2099 $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
2100
2101 check_PROGRAMS += incremental_test_5
2102 MOSTLYCLEANFILES += two_file_test_5.a
2103 incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2104 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2105 cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
2106 $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
2107 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
2108 @sleep 1
2109 cp -f two_file_test_1b.o two_file_test_tmp_5.o
2110 $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
2111 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
2112
2113 # Test the --incremental-unchanged flag with an archive library.
2114 # The second link should not update the library.
2115 check_PROGRAMS += incremental_test_6
2116 MOSTLYCLEANFILES += two_file_test_6.a
2117 incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
2118 two_file_test_2.o two_file_test_main.o gcctestdir/ld
2119 cp -f two_file_test_1b.o two_file_test_tmp_6.o
2120 $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
2121 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
2122 @sleep 1
2123 cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
2124 $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
2125 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
2126
2127 check_PROGRAMS += incremental_copy_test
2128 incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
2129 cp -f copy_test_v1.o copy_test_tmp.o
2130 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
2131 @sleep 1
2132 cp -f copy_test.o copy_test_tmp.o
2133 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
2134
2135 check_PROGRAMS += incremental_common_test_1
2136 incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
2137 cp -f common_test_1_v1.o common_test_1_tmp.o
2138 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o
2139 @sleep 1
2140 cp -f common_test_1_v2.o common_test_1_tmp.o
2141 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o
2142
2143 check_PROGRAMS += incremental_comdat_test_1
2144 incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld
2145 cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
2146 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
2147 @sleep 1
2148 cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
2149 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
2150 @sleep 1
2151 cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
2152 $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
2153
2154 endif DEFAULT_TARGET_X86_64
2155
2156 endif GCC
2157 endif NATIVE_LINKER
2158
2159 # These tests work with native and cross linkers.
2160
2161 if NATIVE_OR_CROSS_LINKER
2162
2163 # Test script section order.
2164 check_SCRIPTS += script_test_10.sh
2165 check_DATA += script_test_10.stdout
2166 script_test_10.o: script_test_10.s
2167 $(TEST_AS) -o $@ $<
2168 script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
2169 gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t
2170 script_test_10.stdout: script_test_10
2171 $(TEST_READELF) -SW script_test_10 > $@
2172
2173 # These tests work with cross linkers only.
2174
2175 if DEFAULT_TARGET_I386
2176
2177 check_SCRIPTS += split_i386.sh
2178 check_DATA += split_i386_1.stdout split_i386_2.stdout \
2179 split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
2180 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
2181 split_i386_1.o: split_i386_1.s
2182 $(TEST_AS) -o $@ $<
2183 split_i386_2.o: split_i386_2.s
2184 $(TEST_AS) -o $@ $<
2185 split_i386_3.o: split_i386_3.s
2186 $(TEST_AS) -o $@ $<
2187 split_i386_4.o: split_i386_4.s
2188 $(TEST_AS) -o $@ $<
2189 split_i386_n.o: split_i386_n.s
2190 $(TEST_AS) -o $@ $<
2191 split_i386_1: split_i386_1.o split_i386_n.o ../ld-new
2192 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o
2193 split_i386_1.stdout: split_i386_1
2194 $(TEST_OBJDUMP) -d $< > $@
2195 split_i386_2: split_i386_2.o split_i386_n.o ../ld-new
2196 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o
2197 split_i386_2.stdout: split_i386_2
2198 $(TEST_OBJDUMP) -d $< > $@
2199 split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new
2200 ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0
2201 split_i386_4: split_i386_4.o split_i386_n.o ../ld-new
2202 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o
2203 split_i386_4.stdout: split_i386_4
2204 $(TEST_OBJDUMP) -d $< > $@
2205 split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new
2206 ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0
2207 MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \
2208 split_i386_4 split_i386_r
2209
2210 endif DEFAULT_TARGET_I386
2211
2212 if DEFAULT_TARGET_X86_64
2213
2214 check_SCRIPTS += split_x86_64.sh
2215 check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \
2216 split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
2217 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
2218 split_x86_64_1.o: split_x86_64_1.s
2219 $(TEST_AS) -o $@ $<
2220 split_x86_64_2.o: split_x86_64_2.s
2221 $(TEST_AS) -o $@ $<
2222 split_x86_64_3.o: split_x86_64_3.s
2223 $(TEST_AS) -o $@ $<
2224 split_x86_64_4.o: split_x86_64_4.s
2225 $(TEST_AS) -o $@ $<
2226 split_x86_64_n.o: split_x86_64_n.s
2227 $(TEST_AS) -o $@ $<
2228 split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new
2229 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o
2230 split_x86_64_1.stdout: split_x86_64_1
2231 $(TEST_OBJDUMP) -d $< > $@
2232 split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new
2233 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o
2234 split_x86_64_2.stdout: split_x86_64_2
2235 $(TEST_OBJDUMP) -d $< > $@
2236 split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new
2237 ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0
2238 split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new
2239 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o
2240 split_x86_64_4.stdout: split_x86_64_4
2241 $(TEST_OBJDUMP) -d $< > $@
2242 split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
2243 ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0
2244 MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
2245 split_x86_64_4 split_x86_64_r
2246
2247 endif DEFAULT_TARGET_X86_64
2248
2249 if DEFAULT_TARGET_ARM
2250
2251 check_SCRIPTS += arm_abs_global.sh
2252 check_DATA += arm_abs_global.stdout
2253 arm_abs_lib.o: arm_abs_lib.s
2254 $(TEST_AS) -march=armv7-a -o $@ $<
2255 libarm_abs.so: arm_abs_lib.o ../ld-new
2256 ../ld-new -shared -o $@ arm_abs_lib.o
2257 arm_abs_global.o: arm_abs_global.s
2258 $(TEST_AS) -march=armv7-a -o $@ $<
2259 arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new
2260 ../ld-new -o $@ arm_abs_global.o -L. -larm_abs
2261 arm_abs_global.stdout: arm_abs_global
2262 $(TEST_READELF) -r $< > $@
2263
2264 MOSTLYCLEANFILES += arm_abs_global
2265
2266 check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh
2267 check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \
2268 thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \
2269 thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \
2270 thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \
2271 thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \
2272 thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \
2273 arm_thm_jump8.stdout
2274
2275 arm_bl_in_range.stdout: arm_bl_in_range
2276 $(TEST_OBJDUMP) -D $< > $@
2277
2278 arm_bl_in_range: arm_bl_in_range.o ../ld-new
2279 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
2280
2281 arm_bl_in_range.o: arm_bl_in_range.s
2282 $(TEST_AS) -o $@ $<
2283
2284 arm_bl_out_of_range.stdout: arm_bl_out_of_range
2285 $(TEST_OBJDUMP) -S $< > $@
2286
2287 arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new
2288 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
2289
2290 arm_bl_out_of_range.o: arm_bl_out_of_range.s
2291 $(TEST_AS) -o $@ $<
2292
2293 thumb_bl_in_range.stdout: thumb_bl_in_range
2294 $(TEST_OBJDUMP) -D $< > $@
2295
2296 thumb_bl_in_range: thumb_bl_in_range.o ../ld-new
2297 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2298
2299 thumb_bl_in_range.o: thumb_bl_in_range.s
2300 $(TEST_AS) -o $@ -march=armv5te $<
2301
2302 thumb_bl_out_of_range.stdout: thumb_bl_out_of_range
2303 $(TEST_OBJDUMP) -D $< > $@
2304
2305 thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new
2306 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2307
2308 thumb_bl_out_of_range.o: thumb_bl_out_of_range.s
2309 $(TEST_AS) -o $@ -march=armv5te $<
2310
2311 thumb2_bl_in_range.stdout: thumb2_bl_in_range
2312 $(TEST_OBJDUMP) -D $< > $@
2313
2314 thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new
2315 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2316
2317 thumb2_bl_in_range.o: thumb_bl_in_range.s
2318 $(TEST_AS) -o $@ -march=armv7-a $<
2319
2320 thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range
2321 $(TEST_OBJDUMP) -D $< > $@
2322
2323 thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new
2324 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2325
2326 thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s
2327 $(TEST_AS) -o $@ -march=armv7-a $<
2328
2329 thumb_blx_in_range.stdout: thumb_blx_in_range
2330 $(TEST_OBJDUMP) -D $< > $@
2331
2332 thumb_blx_in_range: thumb_blx_in_range.o ../ld-new
2333 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2334
2335 thumb_blx_in_range.o: thumb_blx_in_range.s
2336 $(TEST_AS) -o $@ -march=armv5te $<
2337
2338 thumb_blx_out_of_range.stdout: thumb_blx_out_of_range
2339 $(TEST_OBJDUMP) -D $< > $@
2340
2341 thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new
2342 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2343
2344 thumb_blx_out_of_range.o: thumb_blx_out_of_range.s
2345 $(TEST_AS) -o $@ -march=armv5te $<
2346
2347 thumb2_blx_in_range.stdout: thumb2_blx_in_range
2348 $(TEST_OBJDUMP) -D $< > $@
2349
2350 thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new
2351 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2352
2353 thumb2_blx_in_range.o: thumb_blx_in_range.s
2354 $(TEST_AS) -o $@ -march=armv7-a $<
2355
2356 thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range
2357 $(TEST_OBJDUMP) -D $< > $@
2358
2359 thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new
2360 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
2361
2362 thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s
2363 $(TEST_AS) -o $@ -march=armv7-a $<
2364
2365 thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local
2366 $(TEST_OBJDUMP) -D $< > $@
2367
2368 thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new
2369 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
2370
2371 thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s
2372 $(TEST_AS) -o $@ -march=armv5te $<
2373
2374 arm_thm_jump11.stdout: arm_thm_jump11
2375 $(TEST_OBJDUMP) -D $< > $@
2376
2377 arm_thm_jump11: arm_thm_jump11.o ../ld-new
2378 ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $<
2379
2380 arm_thm_jump11.o: arm_thm_jump11.s
2381 $(TEST_AS) -o $@ $<
2382
2383 arm_thm_jump8.stdout: arm_thm_jump8
2384 $(TEST_OBJDUMP) -D $< > $@
2385
2386 arm_thm_jump8: arm_thm_jump8.o ../ld-new
2387 ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $<
2388
2389 arm_thm_jump8.o: arm_thm_jump8.s
2390 $(TEST_AS) -o $@ $<
2391
2392 MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \
2393 thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \
2394 thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \
2395 thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \
2396 arm_thm_jump8
2397
2398 check_SCRIPTS += arm_fix_v4bx.sh
2399 check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \
2400 arm_no_fix_v4bx.stdout
2401
2402 arm_fix_v4bx.stdout: arm_fix_v4bx
2403 $(TEST_OBJDUMP) -D -j.text $< > $@
2404
2405 arm_fix_v4bx: arm_fix_v4bx.o ../ld-new
2406 ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $<
2407
2408 arm_fix_v4bx.o: arm_fix_v4bx.s
2409 $(TEST_AS) -o $@ $<
2410
2411 arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking
2412 $(TEST_OBJDUMP) -D -j.text $< > $@
2413
2414 arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new
2415 ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $<
2416
2417 arm_no_fix_v4bx.stdout: arm_no_fix_v4bx
2418 $(TEST_OBJDUMP) -D -j.text $< > $@
2419
2420 arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new
2421 ../ld-new --no-fix-arm1176 -o $@ $<
2422
2423 MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx
2424
2425 check_SCRIPTS += arm_attr_merge.sh
2426 check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
2427 arm_attr_merge_7.stdout
2428
2429 arm_attr_merge_6.stdout: arm_attr_merge_6
2430 $(TEST_READELF) -A $< > $@
2431
2432 arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o
2433 ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
2434
2435 arm_attr_merge_6a.o: arm_attr_merge_6a.s
2436 $(TEST_AS) -o $@ $<
2437
2438 arm_attr_merge_6b.o: arm_attr_merge_6b.s
2439 $(TEST_AS) -o $@ $<
2440
2441 arm_attr_merge_6r.stdout: arm_attr_merge_6r
2442 $(TEST_READELF) -A $< > $@
2443
2444 arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o
2445 ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
2446
2447 arm_attr_merge_7.stdout: arm_attr_merge_7
2448 $(TEST_READELF) -A $< > $@
2449
2450 arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o
2451 ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
2452
2453 arm_attr_merge_7a.o: arm_attr_merge_7a.s
2454 $(TEST_AS) -o $@ $<
2455
2456 arm_attr_merge_7b.o: arm_attr_merge_7b.s
2457 $(TEST_AS) -o $@ $<
2458
2459 MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7
2460
2461 # ARM1176 workaround test.
2462 check_SCRIPTS += arm_fix_1176.sh
2463 check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \
2464 arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \
2465 arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout
2466
2467 arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z
2468 $(TEST_OBJDUMP) -D -j.foo $< > $@
2469
2470 arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new
2471 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2472
2473 arm_fix_1176_default_v6z.o: arm_fix_1176.s
2474 $(TEST_AS) -march=armv6z -o $@ $<
2475
2476 arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z
2477 $(TEST_OBJDUMP) -D -j.foo $< > $@
2478
2479 arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new
2480 ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $<
2481
2482 arm_fix_1176_on_v6z.o: arm_fix_1176.s
2483 $(TEST_AS) -march=armv6z -o $@ $<
2484
2485 arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z
2486 $(TEST_OBJDUMP) -D -j.foo $< > $@
2487
2488 arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new
2489 ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $<
2490
2491 arm_fix_1176_off_v6z.o: arm_fix_1176.s
2492 $(TEST_AS) -march=armv6z -o $@ $<
2493
2494 arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te
2495 $(TEST_OBJDUMP) -D -j.foo $< > $@
2496
2497 arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new
2498 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2499
2500 arm_fix_1176_default_v5te.o: arm_fix_1176.s
2501 $(TEST_AS) -march=armv5te -o $@ $<
2502
2503 arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a
2504 $(TEST_OBJDUMP) -D -j.foo $< > $@
2505
2506 arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new
2507 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2508
2509 arm_fix_1176_default_v7a.o: arm_fix_1176.s
2510 $(TEST_AS) -march=armv7-a -o $@ $<
2511
2512 arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s
2513 $(TEST_OBJDUMP) -D -j.foo $< > $@
2514
2515 arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new
2516 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
2517
2518 arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s
2519 $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $<
2520
2521 MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \
2522 arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s
2523
2524 # Cortex-A8 workaround test.
2525
2526 check_SCRIPTS += arm_cortex_a8.sh
2527 check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \
2528 arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \
2529 arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout
2530
2531 arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond
2532 $(TEST_OBJDUMP) -D -j.text $< > $@
2533
2534 arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new
2535 ../ld-new -o $@ $<
2536
2537 arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s
2538 $(TEST_AS) -o $@ $<
2539
2540 arm_cortex_a8_b.stdout: arm_cortex_a8_b
2541 $(TEST_OBJDUMP) -D -j.text $< > $@
2542
2543 arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new
2544 ../ld-new --fix-cortex-a8 -o $@ $<
2545
2546 arm_cortex_a8_b.o: arm_cortex_a8_b.s
2547 $(TEST_AS) -o $@ $<
2548
2549 arm_cortex_a8_bl.stdout: arm_cortex_a8_bl
2550 $(TEST_OBJDUMP) -D -j.text $< > $@
2551
2552 arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new
2553 ../ld-new -o $@ $<
2554
2555 arm_cortex_a8_bl.o: arm_cortex_a8_bl.s
2556 $(TEST_AS) -o $@ $<
2557
2558 arm_cortex_a8_blx.stdout: arm_cortex_a8_blx
2559 $(TEST_OBJDUMP) -D -j.text $< > $@
2560
2561 arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new
2562 ../ld-new -o $@ $<
2563
2564 arm_cortex_a8_blx.o: arm_cortex_a8_blx.s
2565 $(TEST_AS) -o $@ $<
2566
2567 arm_cortex_a8_local.stdout: arm_cortex_a8_local
2568 $(TEST_OBJDUMP) -D -j.text $< > $@
2569
2570 arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new
2571 ../ld-new -o $@ $<
2572
2573 arm_cortex_a8_local.o: arm_cortex_a8_local.s
2574 $(TEST_AS) -o $@ $<
2575
2576 arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc
2577 $(TEST_OBJDUMP) -D -j.text $< > $@
2578
2579 arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new
2580 ../ld-new -o $@ $<
2581
2582 arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s
2583 $(TEST_AS) -o $@ $<
2584
2585 MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \
2586 arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc
2587
2588 check_SCRIPTS += arm_exidx_test.sh
2589 check_DATA += arm_exidx_test.stdout
2590
2591 arm_exidx_test.stdout: arm_exidx_test.so
2592 $(TEST_READELF) -Sr $< > $@
2593
2594 arm_exidx_test.so: arm_exidx_test.o ../ld-new
2595 ../ld-new -shared -o $@ $<
2596
2597 arm_exidx_test.o: arm_exidx_test.s
2598 $(TEST_AS) -o $@ $<
2599
2600 check_SCRIPTS += pr12826.sh
2601 check_DATA += pr12826.stdout
2602
2603 pr12826.stdout: pr12826.so
2604 $(TEST_READELF) -A $< > $@
2605
2606 pr12826.so: pr12826_1.o pr12826_2.o ../ld-new
2607 ../ld-new -shared -o $@ $<
2608
2609 pr12826_1.o: pr12826_1.s
2610 $(TEST_AS) -o $@ $<
2611
2612 pr12826_2.o: pr12826_2.s
2613 $(TEST_AS) -o $@ $<
2614
2615 check_SCRIPTS += arm_unaligned_reloc.sh
2616 check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout
2617
2618 arm_unaligned_reloc.stdout: arm_unaligned_reloc
2619 $(TEST_OBJDUMP) -D $< > $@
2620
2621 arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r
2622 $(TEST_OBJDUMP) -Dr $< > $@
2623
2624 arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new
2625 ../ld-new -o $@ $<
2626
2627 arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new
2628 ../ld-new -r -o $@ $<
2629
2630 arm_unaligned_reloc.o: arm_unaligned_reloc.s
2631 $(TEST_AS) -o $@ $<
2632
2633 MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r
2634
2635 # Check ARM to ARM farcall veneers
2636
2637 check_SCRIPTS += arm_farcall_arm_arm.sh
2638 check_DATA += arm_farcall_arm_arm.stdout
2639
2640 arm_farcall_arm_arm.stdout: arm_farcall_arm_arm
2641 $(TEST_OBJDUMP) -d $< > $@
2642
2643 arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new
2644 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $<
2645
2646 arm_farcall_arm_arm.o: arm_farcall_arm_arm.s
2647 $(TEST_AS) -o $@ $<
2648
2649 MOSTLYCLEANFILES += arm_farcall_arm_arm
2650
2651 # Check ARM to Thumb farcall veneers
2652
2653 check_SCRIPTS += arm_farcall_arm_thumb.sh
2654 check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout
2655
2656 arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb
2657 $(TEST_OBJDUMP) -D $< > $@
2658
2659 arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new
2660 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
2661
2662 arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s
2663 $(TEST_AS) -o $@ $<
2664
2665 arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t
2666 $(TEST_OBJDUMP) -D $< > $@
2667
2668 arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new
2669 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
2670
2671 arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s
2672 $(TEST_AS) -march=armv5t -o $@ $<
2673
2674 MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t
2675
2676 # Check Thumb to Thumb farcall veneers
2677
2678 check_SCRIPTS += arm_farcall_thumb_thumb.sh
2679 check_DATA += arm_farcall_thumb_thumb.stdout \
2680 arm_farcall_thumb_thumb_5t.stdout \
2681 arm_farcall_thumb_thumb_7m.stdout \
2682 arm_farcall_thumb_thumb_6m.stdout
2683
2684 arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb
2685 $(TEST_OBJDUMP) -D $< > $@
2686
2687 arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new
2688 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
2689
2690 arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s
2691 $(TEST_AS) -march=armv4t -o $@ $<
2692
2693 arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t
2694 $(TEST_OBJDUMP) -D $< > $@
2695
2696 arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new
2697 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
2698
2699 arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s
2700 $(TEST_AS) -march=armv5t -o $@ $<
2701
2702 arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m
2703 $(TEST_OBJDUMP) -D $< > $@
2704
2705 arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new
2706 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
2707
2708 arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s
2709 $(TEST_AS) -march=armv7-m -o $@ $<
2710
2711 arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m
2712 $(TEST_OBJDUMP) -D $< > $@
2713
2714 arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new
2715 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
2716
2717 arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s
2718 $(TEST_AS) -march=armv6-m -o $@ $<
2719
2720 MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \
2721 arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m
2722
2723 # Check Thumb to ARM farcall veneers
2724
2725 check_SCRIPTS += arm_farcall_thumb_arm.sh
2726 check_DATA += arm_farcall_thumb_arm.stdout \
2727 arm_farcall_thumb_arm_5t.stdout
2728
2729 arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm
2730 $(TEST_OBJDUMP) -D $< > $@
2731
2732 arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new
2733 ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
2734
2735 arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s
2736 $(TEST_AS) -o $@ $<
2737
2738 arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t
2739 $(TEST_OBJDUMP) -D $< > $@
2740
2741 arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new
2742 ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
2743
2744 arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s
2745 $(TEST_AS) -march=armv5t -o $@ $<
2746
2747 MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t
2748
2749 endif DEFAULT_TARGET_ARM
2750
2751 endif NATIVE_OR_CROSS_LINKER
2752
2753 # Tests for the dwp tool.
2754 # We don't want to rely yet on GCC support for -gsplit-dwarf,
2755 # so we use (for now) test cases in x86 assembly language,
2756 # compiled from the dwp_test_*.cc sources.
2757
2758 if DEFAULT_TARGET_X86_64
2759
2760 dwp_test_main.o: dwp_test_main.s
2761 $(TEST_AS) -o $@ $<
2762 dwp_test_1.o: dwp_test_1.s
2763 $(TEST_AS) -o $@ $<
2764 dwp_test_1b.o: dwp_test_1b.s
2765 $(TEST_AS) -o $@ $<
2766 dwp_test_2.o: dwp_test_2.s
2767 $(TEST_AS) -o $@ $<
2768
2769 dwp_test_main.dwo: dwp_test_main.o
2770 $(TEST_OBJCOPY) --extract-dwo $< $@
2771 dwp_test_1.dwo: dwp_test_1.o
2772 $(TEST_OBJCOPY) --extract-dwo $< $@
2773 dwp_test_1b.dwo: dwp_test_1b.o
2774 $(TEST_OBJCOPY) --extract-dwo $< $@
2775 dwp_test_2.dwo: dwp_test_2.o
2776 $(TEST_OBJCOPY) --extract-dwo $< $@
2777
2778 check_SCRIPTS += dwp_test_1.sh
2779 check_DATA += dwp_test_1.stdout
2780 dwp_test_1.stdout: dwp_test_1.dwp
2781 $(TEST_READELF) -wi $< > $@
2782 dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
2783 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
2784
2785 check_SCRIPTS += dwp_test_2.sh
2786 check_DATA += dwp_test_2.stdout
2787 dwp_test_2.stdout: dwp_test_2.dwp
2788 $(TEST_READELF) -wi $< > $@
2789 dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp
2790 ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp
2791 dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo
2792 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo
2793 dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo
2794 ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo
2795
2796 endif DEFAULT_TARGET_X86_64
This page took 0.087183 seconds and 5 git commands to generate.