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