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