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