]>
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 | |
30e1f9e6 | 212 | $(TEST_NM) -n final_layout > final_layout.stdout |
6e9ba2ca | 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) > [email protected] | |
815 | mv -f [email protected] $@ | |
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) > [email protected] | |
823 | mv -f [email protected] $@ | |
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 | |
71ff8986 ILT |
852 | # Compile with different optimization flags to check that rearranged |
853 | # instructions don't cause a false positive. | |
351a8000 | 854 | odr_violation2.o: odr_violation2.cc |
71ff8986 | 855 | $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 ILT |
856 | debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld |
857 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" | |
858 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ | |
859 | then \ | |
860 | echo 1>&2 "Link of debug_msg should have failed"; \ | |
861 | rm -f $@; \ | |
862 | exit 1; \ | |
863 | fi | |
864 | ||
865 | # See if we can also detect problems when we're linking .so's, not .o's. | |
866 | check_DATA += debug_msg_so.err | |
867 | MOSTLYCLEANFILES += debug_msg_so.err | |
868 | debug_msg.so: debug_msg.cc gcctestdir/ld | |
869 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
870 | odr_violation1.so: odr_violation1.cc gcctestdir/ld | |
871 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
872 | odr_violation2.so: odr_violation2.cc gcctestdir/ld | |
71ff8986 | 873 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 ILT |
874 | debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld |
875 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" | |
876 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ | |
877 | then \ | |
878 | echo 1>&2 "Link of debug_msg_so should have failed"; \ | |
879 | rm -f $@; \ | |
880 | exit 1; \ | |
881 | fi | |
882 | ||
883 | # We also want to make sure we do something reasonable when there's no | |
884 | # debug info available. For the best test, we use .so's. | |
885 | check_DATA += debug_msg_ndebug.err | |
886 | MOSTLYCLEANFILES += debug_msg_ndebug.err | |
887 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld | |
888 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
889 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld | |
890 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
891 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld | |
71ff8986 | 892 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 ILT |
893 | debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld |
894 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@" | |
895 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \ | |
896 | then \ | |
897 | echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ | |
898 | rm -f $@; \ | |
899 | exit 1; \ | |
900 | fi | |
901 | ||
902 | ||
903 | # Similar to --detect-odr-violations: check for undefined symbols in .so's | |
904 | check_SCRIPTS += undef_symbol.sh | |
905 | check_DATA += undef_symbol.err | |
906 | MOSTLYCLEANFILES += undef_symbol.err | |
907 | undef_symbol.o: undef_symbol.cc | |
908 | $(CXXCOMPILE) -O0 -g -c -fPIC $< | |
909 | undef_symbol.so: undef_symbol.o gcctestdir/ld | |
910 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o | |
911 | undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld | |
912 | @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@" | |
913 | @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \ | |
914 | then \ | |
915 | echo 1>&2 "Link of undef_symbol_test should have failed"; \ | |
916 | rm -f $@; \ | |
917 | exit 1; \ | |
918 | fi | |
919 | ||
920 | ||
351a8000 ILT |
921 | # Test -o when emitting to a special file (such as something in /dev). |
922 | check_PROGRAMS += flagstest_o_specialfile | |
0e470e5c | 923 | flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld |
351a8000 ILT |
924 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@ |
925 | chmod a+x $@ | |
926 | test -s $@ | |
927 | ||
7fcd0256 ILT |
928 | if HAVE_ZLIB |
929 | ||
930 | # Test --compress-debug-sections. FIXME: check we actually compress. | |
931 | check_PROGRAMS += flagstest_compress_debug_sections | |
932 | flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld | |
933 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib | |
934 | test -s $@ | |
935 | ||
936 | ||
351a8000 ILT |
937 | # The specialfile output has a tricky case when we also compress debug |
938 | # sections, because it requires output-file resizing. | |
939 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections | |
0e470e5c ILT |
940 | flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \ |
941 | gcctestdir/ld | |
126f3ece | 942 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@ |
351a8000 ILT |
943 | chmod a+x $@ |
944 | test -s $@ | |
945 | ||
7fcd0256 ILT |
946 | endif HAVE_ZLIB |
947 | ||
99f8faca ILT |
948 | # Test symbol versioning. |
949 | check_PROGRAMS += ver_test | |
950 | ver_test_SOURCES = ver_test_main.cc | |
951 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
952 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
953 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
954 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld | |
955 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so | |
09124467 ILT |
956 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
957 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so | |
958 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld | |
959 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o | |
99f8faca ILT |
960 | ver_test_1.o: ver_test_1.cc |
961 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
962 | ver_test_2.o: ver_test_2.cc | |
963 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
964 | ver_test_3.o: ver_test_3.cc | |
965 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
966 | ver_test_4.o: ver_test_4.cc | |
967 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 968 | |
0602e05a ILT |
969 | check_SCRIPTS += ver_test_1.sh |
970 | check_DATA += ver_test_1.syms | |
971 | ver_test_1.syms: ver_test_1.so | |
972 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
973 | ||
be3e6201 ILT |
974 | check_PROGRAMS += ver_test_2 |
975 | ver_test_2_SOURCES = ver_test_main_2.cc | |
976 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
977 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
978 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
979 | ||
be3e6201 ILT |
980 | check_SCRIPTS += ver_test_2.sh |
981 | check_DATA += ver_test_2.syms | |
982 | ver_test_2.syms: ver_test_2 | |
6835af53 | 983 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 984 | |
686c8caf ILT |
985 | check_SCRIPTS += ver_test_4.sh |
986 | check_DATA += ver_test_4.syms | |
987 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 988 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
989 | |
990 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld | |
991 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so | |
992 | ver_test_5.o: ver_test_5.cc | |
993 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
994 | check_SCRIPTS += ver_test_5.sh | |
995 | check_DATA += ver_test_5.syms | |
996 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 997 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 998 | |
18e6b24e ILT |
999 | check_PROGRAMS += ver_test_6 |
1000 | ver_test_6_SOURCES = ver_test_6.c | |
1001 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
1002 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1003 | ver_test_6_LDADD = ver_test_2.so | |
1004 | ||
479f6503 ILT |
1005 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
1006 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o | |
1007 | ver_test_7.o: ver_test_7.cc | |
1008 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1009 | check_SCRIPTS += ver_test_7.sh | |
1010 | check_DATA += ver_test_7.syms | |
1011 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 1012 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 1013 | |
75517b77 ILT |
1014 | check_PROGRAMS += ver_test_8 |
1015 | ver_test_8_SOURCES = two_file_test_main.cc | |
1016 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so | |
1017 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1018 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so | |
1019 | ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld | |
1020 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so | |
1021 | ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld | |
1022 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o | |
1023 | ||
95d14cd3 ILT |
1024 | check_PROGRAMS += ver_test_9 |
1025 | ver_test_9_SOURCES = ver_test_main.cc | |
1026 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so | |
1027 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1028 | ver_test_9_LDADD = ver_test_9.so | |
1029 | ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld | |
1030 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so | |
1031 | ver_test_9.o: ver_test_9.cc | |
1032 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1033 | ||
057ead22 ILT |
1034 | check_SCRIPTS += ver_test_10.sh |
1035 | check_DATA += ver_test_10.syms | |
1036 | ver_test_10.syms: ver_test_10.so | |
1037 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1038 | ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script | |
1039 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o | |
1040 | ||
9c5b8369 | 1041 | check_PROGRAMS += ver_test_11 |
72fef11a | 1042 | MOSTLYCLEANFILES += ver_test_11.a |
9c5b8369 ILT |
1043 | ver_test_11_SOURCES = ver_test_main_2.cc |
1044 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a | |
1045 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1046 | ver_test_11_LDADD = ver_test_11.a | |
1047 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o | |
1048 | $(TEST_AR) rc $@ $^ | |
1049 | ||
8bdcdf2c ILT |
1050 | check_PROGRAMS += protected_1 |
1051 | protected_1_SOURCES = \ | |
1052 | protected_main_1.cc protected_main_2.cc protected_main_3.cc | |
1053 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1054 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1055 | protected_1_LDADD = protected_1.so | |
1056 | ||
1057 | protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1058 | $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1059 | protected_1_pic.o: protected_1.cc | |
1060 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1061 | protected_2_pic.o: protected_2.cc | |
1062 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1063 | protected_3_pic.o: protected_3.cc | |
1064 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1065 | ||
1066 | check_PROGRAMS += protected_2 | |
1067 | protected_2_SOURCES = protected_main_1.cc protected_3.cc | |
1068 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1069 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1070 | protected_2_LDADD = protected_1.so | |
1071 | ||
837504c4 ILT |
1072 | check_DATA += protected_3.err |
1073 | MOSTLYCLEANFILES += protected_3.err | |
1074 | protected_4_pic.o: protected_4.cc | |
1075 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1076 | protected_3.err: protected_4_pic.o gcctestdir/ld | |
1077 | @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@" | |
1078 | @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \ | |
1079 | echo 1>&2 "Link of protected_4.so should have failed"; \ | |
1080 | rm -f $@; \ | |
1081 | exit 1; \ | |
1082 | fi | |
1083 | ||
9f1d377b | 1084 | check_PROGRAMS += relro_test |
fc497986 CC |
1085 | check_SCRIPTS += relro_test.sh |
1086 | check_DATA += relro_test.stdout | |
9f1d377b ILT |
1087 | relro_test_SOURCES = relro_test_main.cc |
1088 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so | |
1089 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1090 | relro_test_LDADD = relro_test.so | |
1091 | relro_test.so: gcctestdir/ld relro_test_pic.o | |
1092 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o | |
1093 | relro_test_pic.o: relro_test.cc | |
1094 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
fc497986 CC |
1095 | relro_test.stdout: relro_test.so |
1096 | $(TEST_READELF) -SlW relro_test.so > relro_test.stdout | |
9f1d377b | 1097 | |
5f1ab67a ILT |
1098 | check_PROGRAMS += relro_strip_test |
1099 | relro_strip_test_SOURCES = relro_test_main.cc | |
1100 | relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so | |
1101 | relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1102 | relro_strip_test_LDADD = relro_strip_test.so | |
1103 | relro_strip_test.so: relro_test.so | |
1104 | $(TEST_STRIP) -o $@ $< | |
1105 | ||
2d924fd9 ILT |
1106 | check_PROGRAMS += relro_script_test |
1107 | relro_script_test_SOURCES = relro_test_main.cc | |
1108 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so | |
1109 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1110 | relro_script_test_LDADD = relro_script_test.so | |
1111 | relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o | |
1112 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o | |
1113 | ||
e5756efb ILT |
1114 | check_PROGRAMS += script_test_1 |
1115 | script_test_1_SOURCES = script_test_1.cc | |
1116 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t | |
1117 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t | |
1abce4a6 | 1118 | script_test_1_LDADD = |
e5756efb | 1119 | |
a445fddf ILT |
1120 | check_PROGRAMS += script_test_2 |
1121 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
1122 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
1123 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t | |
1abce4a6 | 1124 | script_test_2_LDADD = |
a445fddf | 1125 | |
88dd47ac ILT |
1126 | check_PROGRAMS += justsyms |
1127 | justsyms_SOURCES = justsyms_1.cc | |
1128 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
1129 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
1abce4a6 | 1130 | justsyms_LDADD = |
88dd47ac ILT |
1131 | justsyms_2.o: justsyms_2.cc |
1132 | $(CXXCOMPILE) -c -o $@ $< | |
83bfb6b7 | 1133 | justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t |
88dd47ac ILT |
1134 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o |
1135 | ||
bc644c6c | 1136 | check_PROGRAMS += binary_test |
72fef11a | 1137 | MOSTLYCLEANFILES += binary.txt |
bc644c6c ILT |
1138 | binary_test_SOURCES = binary_test.cc |
1139 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
1140 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf | |
1abce4a6 | 1141 | binary_test_LDADD = |
bc644c6c ILT |
1142 | # Copy the file to the build directory to avoid worrying about the |
1143 | # full pathname in the generated symbols. | |
1144 | binary.txt: $(srcdir)/binary.in | |
1145 | rm -f $@ | |
1146 | $(LN_S) $< $@ | |
1147 | ||
09124467 ILT |
1148 | check_SCRIPTS += ver_matching_test.sh |
1149 | check_DATA += ver_matching_test.stdout | |
1150 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
2fbb4320 ILT |
1151 | ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld |
1152 | $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map | |
1153 | ver_matching_def_pic.o: ver_matching_def.cc | |
1154 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< | |
09124467 | 1155 | ver_matching_test.stdout: ver_matching_def.so |
6835af53 | 1156 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
1c4f3631 ILT |
1157 | |
1158 | check_PROGRAMS += script_test_3 | |
1159 | check_SCRIPTS += script_test_3.sh | |
1160 | check_DATA += script_test_3.stdout | |
1161 | MOSTLYCLEANFILES += script_test_3.stdout | |
1162 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
1163 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t | |
1164 | script_test_3.stdout: script_test_3 | |
2cefc357 | 1165 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
09124467 | 1166 | |
4ebf39db ILT |
1167 | check_PROGRAMS += tls_phdrs_script_test |
1168 | tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) | |
1169 | tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t | |
1170 | tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t | |
1171 | tls_phdrs_script_test_LDADD = $(tls_test_LDADD) | |
1172 | ||
e6188289 ILT |
1173 | check_SCRIPTS += script_test_4.sh |
1174 | check_DATA += script_test_4.stdout | |
72fef11a | 1175 | MOSTLYCLEANFILES += script_test_4 |
e6188289 ILT |
1176 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t |
1177 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t | |
1178 | script_test_4.stdout: script_test_4 | |
1179 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout | |
1180 | ||
6c93b22c ILT |
1181 | check_PROGRAMS += tls_script_test |
1182 | tls_script_test_SOURCES = $(tls_test_SOURCES) | |
1183 | tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t | |
1184 | tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t | |
1185 | tls_script_test_LDADD = $(tls_test_LDADD) | |
1186 | ||
401a9a73 CC |
1187 | check_SCRIPTS += script_test_5.sh |
1188 | check_DATA += script_test_5.stdout | |
72fef11a | 1189 | MOSTLYCLEANFILES += script_test_5 |
401a9a73 CC |
1190 | script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t |
1191 | $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t | |
1192 | script_test_5.stdout: script_test_5 | |
1193 | $(TEST_READELF) -SW script_test_5 > script_test_5.stdout | |
1194 | ||
3c12dcdb DK |
1195 | check_SCRIPTS += script_test_6.sh |
1196 | check_DATA += script_test_6.stdout | |
1197 | MOSTLYCLEANFILES += script_test_6 | |
1198 | script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t | |
1199 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \ | |
1200 | -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000 | |
1201 | script_test_6.stdout: script_test_6 | |
1202 | $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout | |
1203 | ||
1204 | check_SCRIPTS += script_test_7.sh | |
1205 | check_DATA += script_test_7.stdout | |
1206 | MOSTLYCLEANFILES += script_test_7 | |
1207 | script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1208 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t | |
1209 | script_test_7.stdout: script_test_7 | |
1210 | $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout | |
1211 | ||
1212 | check_SCRIPTS += script_test_8.sh | |
1213 | check_DATA += script_test_8.stdout | |
1214 | MOSTLYCLEANFILES += script_test_8 | |
1215 | script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1216 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \ | |
1217 | -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000 | |
1218 | script_test_8.stdout: script_test_8 | |
1219 | $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout | |
1220 | ||
d103a984 RÁE |
1221 | |
1222 | check_SCRIPTS += script_test_9.sh | |
1223 | check_DATA += script_test_9.stdout | |
1224 | script_test_9.o: script_test_9.cc | |
1225 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
1226 | script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o | |
1227 | $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t | |
1228 | script_test_9.stdout: script_test_9 | |
1229 | $(TEST_READELF) -lW script_test_9 > script_test_9.stdout | |
1230 | ||
1231 | ||
c82fbeee CS |
1232 | # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, |
1233 | # and --dynamic-list-cpp-typeinfo | |
1234 | ||
1235 | check_SCRIPTS += dynamic_list.sh | |
1236 | check_DATA += dynamic_list.stdout | |
72fef11a | 1237 | MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout |
c82fbeee CS |
1238 | dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t |
1239 | $(CXXLINK) -Bgcctestdir/ basic_test.o \ | |
1240 | -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ | |
1241 | -Wl,--dynamic-list-data \ | |
1242 | -Wl,--dynamic-list-cpp-new \ | |
1243 | -Wl,--dynamic-list-cpp-typeinfo | |
1244 | dynamic_list.stdout: dynamic_list | |
94e6ee91 | 1245 | $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout |
c82fbeee | 1246 | |
fbd8a257 | 1247 | check_PROGRAMS += thin_archive_test_1 |
72fef11a CC |
1248 | MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \ |
1249 | alt/thin_archive_test_2.o alt/thin_archive_test_4.o \ | |
1250 | alt/libthin2.a alt/libthin4.a | |
fbd8a257 CC |
1251 | thin_archive_test_1_SOURCES = thin_archive_main.cc |
1252 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a | |
1253 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt | |
1254 | thin_archive_test_1_LDADD = libthin1.a -lthin2 | |
1255 | ||
1256 | check_PROGRAMS += thin_archive_test_2 | |
1257 | thin_archive_test_2_SOURCES = thin_archive_main.cc | |
1258 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a | |
1259 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. | |
1260 | thin_archive_test_2_LDADD = -lthinall | |
1261 | ||
1262 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o | |
1263 | rm -f $@ | |
1264 | $(TEST_AR) crT $@ $^ | |
1265 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o | |
1266 | rm -f $@ | |
1267 | $(TEST_AR) crT $@ $^ | |
1268 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o | |
1269 | rm -f $@ | |
1270 | $(TEST_AR) crT $@ $^ | |
1271 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o | |
1272 | rm -f $@ | |
1273 | $(TEST_AR) crT $@ $^ | |
1274 | libthinall.a: libthin3.a alt/libthin4.a | |
1275 | rm -f $@ | |
1276 | $(TEST_AR) crT $@ $^ | |
1277 | alt/thin_archive_test_2.o: thin_archive_test_2.cc | |
1278 | test -d alt || mkdir -p alt | |
1279 | $(CXXCOMPILE) -c -o $@ $< | |
1280 | alt/thin_archive_test_4.o: thin_archive_test_4.cc | |
1281 | test -d alt || mkdir -p alt | |
1282 | $(CXXCOMPILE) -c -o $@ $< | |
1283 | ||
89fc3421 CC |
1284 | if PLUGINS |
1285 | ||
1286 | check_PROGRAMS += plugin_test_1 | |
1287 | check_SCRIPTS += plugin_test_1.sh | |
1288 | check_DATA += plugin_test_1.err | |
1289 | MOSTLYCLEANFILES += plugin_test_1.err | |
abc8dcba CC |
1290 | 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 |
1291 | $(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 |
1292 | plugin_test_1.err: plugin_test_1 |
1293 | @touch plugin_test_1.err | |
1294 | ||
1295 | check_PROGRAMS += plugin_test_2 | |
1296 | check_SCRIPTS += plugin_test_2.sh | |
1297 | check_DATA += plugin_test_2.err | |
1298 | MOSTLYCLEANFILES += plugin_test_2.err | |
1299 | 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 | |
1300 | $(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 | |
1301 | plugin_test_2.err: plugin_test_2 | |
1302 | @touch plugin_test_2.err | |
1303 | ||
d66a9eb3 CC |
1304 | check_PROGRAMS += plugin_test_3 |
1305 | check_SCRIPTS += plugin_test_3.sh | |
1306 | check_DATA += plugin_test_3.err | |
1307 | MOSTLYCLEANFILES += plugin_test_3.err | |
1308 | 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 | |
1309 | $(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 | |
1310 | plugin_test_3.err: plugin_test_3 | |
1311 | @touch plugin_test_3.err | |
1312 | ||
0f7c0701 CC |
1313 | check_PROGRAMS += plugin_test_4 |
1314 | check_SCRIPTS += plugin_test_4.sh | |
1315 | check_DATA += plugin_test_4.err | |
72fef11a | 1316 | MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err |
0f7c0701 CC |
1317 | plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so |
1318 | $(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 | |
1319 | plugin_test_4.err: plugin_test_4 | |
1320 | @touch plugin_test_4.err | |
1321 | ||
1322 | plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms | |
1323 | $(TEST_AR) cr $@ $^ | |
1324 | ||
24998053 CC |
1325 | check_PROGRAMS += plugin_test_5 |
1326 | 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 | |
1327 | $(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 | |
1328 | ||
be234d88 CC |
1329 | check_PROGRAMS += plugin_test_6 |
1330 | check_SCRIPTS += plugin_test_6.sh | |
1331 | check_DATA += plugin_test_6.err | |
1332 | MOSTLYCLEANFILES += plugin_test_6.err | |
1333 | plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so | |
1334 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err | |
1335 | plugin_test_6.err: plugin_test_6 | |
1336 | @touch plugin_test_6.err | |
1337 | ||
5e0f337e RÁE |
1338 | check_PROGRAMS += plugin_test_7 |
1339 | check_SCRIPTS += plugin_test_7.sh | |
1340 | check_DATA += plugin_test_7.err plugin_test_7.syms | |
1341 | MOSTLYCLEANFILES += plugin_test_7.err | |
1342 | plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so | |
1343 | $(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 | |
1344 | plugin_test_7.syms: plugin_test_7 | |
1345 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1346 | plugin_test_7_1.o: plugin_test_7_1.c | |
1347 | $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1348 | plugin_test_7_1_orig.o: plugin_test_7_1.c | |
1349 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1350 | plugin_test_7_1.syms: plugin_test_7_1_orig.o | |
1351 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1352 | plugin_test_7_2.o: plugin_test_7_2.c | |
1353 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1354 | plugin_test_7.err: plugin_test_7 | |
1355 | ||
f3a2388f CC |
1356 | # Test plugins with -r. |
1357 | check_PROGRAMS += plugin_test_8 | |
1358 | 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 | |
1359 | ../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 | |
1360 | plugin_test_8: plugin_test_8.o gcctestdir/ld | |
1361 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o | |
1362 | ||
1363 | # Test that symbols known in the IR file but not in the replacement file | |
1364 | # produce an unresolved symbol error. | |
1365 | check_DATA += plugin_test_9.err | |
1366 | MOSTLYCLEANFILES += plugin_test_9.err | |
1367 | plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so | |
1368 | @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>$@" | |
1369 | @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 \ | |
1370 | echo 1>&2 "Link of plugin_test_9 should have failed"; \ | |
1371 | rm -f $@; \ | |
1372 | exit 1; \ | |
1373 | fi | |
1374 | # Make a .syms file that claims to define the symbol _Z4t16av. | |
1375 | two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o | |
1376 | cp two_file_test_1.syms [email protected] | |
1377 | grep "_Z4t16av" two_file_test_1b.syms >> [email protected] | |
1378 | mv -f [email protected] $@ | |
1379 | # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. | |
1380 | MOSTLYCLEANFILES += two_file_test_1c.o | |
1381 | two_file_test_1c.o: two_file_test_1.o | |
1382 | cp two_file_test_1.o $@ | |
1383 | ||
89fc3421 CC |
1384 | plugin_test.so: plugin_test.o |
1385 | $(LINK) -Bgcctestdir/ -shared plugin_test.o | |
1386 | plugin_test.o: plugin_test.c | |
1387 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1388 | ||
1389 | two_file_test_main.syms: two_file_test_main.o | |
1390 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1391 | two_file_test_1.syms: two_file_test_1.o | |
1392 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1393 | two_file_test_1b.syms: two_file_test_1b.o | |
1394 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1395 | two_file_test_2.syms: two_file_test_2.o | |
1396 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
be234d88 CC |
1397 | plugin_common_test_1.syms: plugin_common_test_1.o |
1398 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1399 | plugin_common_test_2.syms: plugin_common_test_2.o | |
1400 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
24998053 | 1401 | |
abc8dcba | 1402 | empty.syms: |
24998053 CC |
1403 | @echo "" >$@ |
1404 | @echo "Symbol table" >>$@ | |
1405 | ||
1406 | MOSTLYCLEANFILES += unused.c | |
1407 | unused.syms: unused.o | |
1408 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1409 | @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ | |
1410 | unused.o: unused.c | |
1411 | $(COMPILE) -c -o $@ $< | |
1412 | unused.c: | |
1413 | @cp /dev/null $@ | |
89fc3421 CC |
1414 | |
1415 | endif PLUGINS | |
1416 | ||
65514900 CC |
1417 | check_PROGRAMS += exclude_libs_test |
1418 | check_SCRIPTS += exclude_libs_test.sh | |
1419 | check_DATA += exclude_libs_test.syms | |
1420 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ | |
2fdd743f | 1421 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
65514900 CC |
1422 | exclude_libs_test_SOURCES = exclude_libs_test.c |
1423 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ | |
2fdd743f DK |
1424 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
1425 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ | |
1426 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ | |
1427 | -Wl,--exclude-libs,libexclude_libs_test_3 | |
1428 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ | |
1429 | alt/libexclude_libs_test_3.a | |
65514900 CC |
1430 | exclude_libs_test.syms: exclude_libs_test |
1431 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1432 | libexclude_libs_test_1.a: exclude_libs_test_1.o | |
1433 | $(TEST_AR) rc $@ $^ | |
1434 | libexclude_libs_test_2.a: exclude_libs_test_2.o | |
1435 | $(TEST_AR) rc $@ $^ | |
2fdd743f DK |
1436 | alt/libexclude_libs_test_3.a: exclude_libs_test_3.o |
1437 | test -d alt || mkdir -p alt | |
1438 | $(TEST_AR) rc $@ $^ | |
65514900 | 1439 | |
805bb01c DK |
1440 | check_PROGRAMS += local_labels_test |
1441 | local_labels_test.o: ver_test_6.c | |
1442 | $(COMPILE) -g -c -Wa,-L -o $@ $< | |
1443 | local_labels_test: local_labels_test.o | |
1444 | $(LINK) -Bgcctestdir/ local_labels_test.o | |
1445 | ||
bb04269c DK |
1446 | check_PROGRAMS += discard_locals_test |
1447 | check_SCRIPTS += discard_locals_test.sh | |
d3bbad62 ILT |
1448 | check_DATA += discard_locals_test.syms \ |
1449 | discard_locals_relocatable_test1.syms \ | |
1450 | discard_locals_relocatable_test2.syms | |
1451 | MOSTLYCLEANFILES += discard_locals_test.syms \ | |
1452 | discard_locals_relocatable_test1.syms \ | |
1453 | discard_locals_relocatable_test2.syms \ | |
1454 | discard_locals_relocatable_test1.out \ | |
1455 | discard_locals_relocatable_test2.out | |
bb04269c DK |
1456 | discard_locals_test_SOURCES = discard_locals_test.c |
1457 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals | |
1458 | discard_locals_test.syms: discard_locals_test | |
1459 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1460 | # '-Wa,-L' is required to preserve the local label used for testing. | |
1461 | discard_locals_test.o: discard_locals_test.c | |
1462 | $(COMPILE) -c -Wa,-L -o $@ $< | |
1463 | ||
d3bbad62 ILT |
1464 | discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out |
1465 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1466 | discard_locals_relocatable_test.o: discard_locals_relocatable_test.c | |
1467 | $(COMPILE) -c -Wa,-L -fPIC -o $@ $< | |
1468 | discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new | |
1469 | ../ld-new --discard-locals -relocatable -o $@ $< | |
1470 | ||
1471 | discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out | |
1472 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1473 | discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new | |
1474 | ../ld-new --discard-all -relocatable -o $@ $< | |
1475 | ||
8a5e3e08 ILT |
1476 | if MCMODEL_MEDIUM |
1477 | check_PROGRAMS += large | |
1478 | large_SOURCES = large.c | |
1479 | large_CFLAGS = -mcmodel=medium | |
1480 | large_DEPENDENCIES = gcctestdir/ld | |
1481 | large_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 1482 | large_LDADD = |
8a5e3e08 ILT |
1483 | endif MCMODEL_MEDIUM |
1484 | ||
645afe0c CC |
1485 | # Test that hidden and internal symbols in the main program cannot be |
1486 | # referenced by a shared library. | |
1487 | check_SCRIPTS += hidden_test.sh | |
1488 | check_DATA += hidden_test.err | |
1489 | MOSTLYCLEANFILES += hidden_test hidden_test.err | |
1490 | libhidden.so: hidden_test_1.c gcctestdir/ld | |
1491 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c | |
1492 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld | |
1493 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err | |
1494 | hidden_test.err: hidden_test | |
1495 | @touch hidden_test.err | |
1496 | ||
8c604651 CS |
1497 | # Test -retain-symbols-file. |
1498 | check_SCRIPTS += retain_symbols_file_test.sh | |
1499 | check_DATA += retain_symbols_file_test.stdout | |
1500 | MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \ | |
1501 | retain_symbols_file_test.stdout | |
1502 | retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld | |
1503 | echo 'main' > retain_symbols_file_test.in | |
1504 | echo 't1' >> retain_symbols_file_test.in | |
1505 | echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in | |
1506 | echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in | |
1507 | echo '_Z3t18v' >> retain_symbols_file_test.in | |
1508 | echo '__tcf_0' >> retain_symbols_file_test.in | |
1509 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o | |
1510 | retain_symbols_file_test.stdout: retain_symbols_file_test.so | |
1511 | $(TEST_NM) -C retain_symbols_file_test.so > $@ | |
1512 | ||
1513 | ||
6a89f575 CC |
1514 | # Test that if the output file already exists and is empty, |
1515 | # it will get execute permission. | |
1516 | check_PROGRAMS += permission_test | |
1517 | permission_test: basic_test.o gcctestdir/ld | |
1518 | umask 022; \ | |
1519 | rm -f $@; \ | |
1520 | touch $@; \ | |
1521 | chmod 600 $@; \ | |
1522 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
1523 | ||
ae3b5189 CD |
1524 | # Check -l:foo.a |
1525 | check_PROGRAMS += searched_file_test | |
1526 | MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \ | |
1527 | alt/searched_file_test_lib.a | |
1528 | searched_file_test_SOURCES = searched_file_test.cc | |
1529 | searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a | |
1530 | searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt | |
1531 | searched_file_test_LDADD = -l:searched_file_test_lib.a | |
1532 | searched_file_test_lib.o: searched_file_test_lib.cc | |
1533 | $(CXXCOMPILE) -c -o $@ $< | |
1534 | alt/searched_file_test_lib.a: searched_file_test_lib.o | |
1535 | test -d alt || mkdir -p alt | |
1536 | $(TEST_AR) rc $@ $^ | |
1537 | ||
c5617f2f DK |
1538 | # Test that no .gnu.version sections are created when |
1539 | # symbol versioning is not used. | |
1540 | check_SCRIPTS += no_version_test.sh | |
1541 | check_DATA += no_version_test.stdout | |
1542 | MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout | |
1543 | # We invoke the linker directly since gcc may include additional objects that | |
1544 | # uses symbol versioning. | |
1545 | libno_version_test.so: no_version_test.o gcctestdir/ld | |
1546 | gcctestdir/ld -shared -o $@ no_version_test.o | |
1547 | no_version_test.o: no_version_test.c | |
1548 | $(COMPILE) -o $@ -c -fPIC $< | |
1549 | no_version_test.stdout: libno_version_test.so | |
1550 | $(TEST_OBJDUMP) -h $< > $@ | |
1551 | ||
7223e9ca ILT |
1552 | # Test STT_GNU_IFUNC symbols. |
1553 | if IFUNC | |
1554 | ||
1555 | ifuncmod1.o: ifuncmod1.c | |
1556 | $(COMPILE) -c -fpic -o $@ $< | |
1557 | ifuncmod1.so: ifuncmod1.o gcctestdir/ld | |
1558 | $(LINK) -Bgcctestdir/ -shared ifuncmod1.o | |
1559 | ||
1560 | ifuncdep1.o: ifuncmod1.c | |
1561 | $(COMPILE) -c -o $@ $< | |
1562 | ||
1563 | ifuncmain1pic.o: ifuncmain1.c | |
1564 | $(COMPILE) -c -fpic -o $@ $< | |
1565 | ifuncmain1pie.o: ifuncmain1.c | |
1566 | $(COMPILE) -c -fpie -o $@ $< | |
1567 | ||
1568 | check_PROGRAMS += ifuncmain1static | |
1569 | ifuncmain1static_SOURCES = ifuncmain1.c | |
1570 | ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o | |
1571 | ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static | |
1572 | ifuncmain1static_LDADD = ifuncdep1.o | |
1573 | ||
1574 | check_PROGRAMS += ifuncmain1picstatic | |
1575 | ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
1576 | $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o | |
1577 | ||
1578 | check_PROGRAMS += ifuncmain1 | |
1579 | ifuncmain1_SOURCES = ifuncmain1.c | |
1580 | ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
1581 | ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1582 | ifuncmain1_LDADD = ifuncmod1.so | |
1583 | ||
1584 | check_PROGRAMS += ifuncmain1pic | |
1585 | ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld | |
1586 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
1587 | ||
1588 | check_PROGRAMS += ifuncmain1vis | |
1589 | ifuncmain1vis_SOURCES = ifuncmain1vis.c | |
1590 | ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
1591 | ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1592 | ifuncmain1vis_LDADD = ifuncmod1.so | |
1593 | ||
1594 | check_PROGRAMS += ifuncmain1vispic | |
1595 | ifuncmain1vispic.o: ifuncmain1vis.c | |
1596 | $(COMPILE) -c -fpic -o $@ $< | |
1597 | ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld | |
1598 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
1599 | ||
1600 | check_PROGRAMS += ifuncmain1staticpic | |
1601 | ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
1602 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o | |
1603 | ||
1604 | check_PROGRAMS += ifuncmain1pie | |
1605 | ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld | |
1606 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,. | |
1607 | ||
1608 | check_PROGRAMS += ifuncmain1vispie | |
1609 | ifuncmain1vispie.o: ifuncmain1vis.c | |
1610 | $(COMPILE) -c -fpie -o $@ $< | |
1611 | ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld | |
1612 | $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. | |
1613 | ||
1614 | check_PROGRAMS += ifuncmain1staticpie | |
1615 | ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld | |
1616 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o | |
1617 | ||
1618 | ifuncmain2pic.o: ifuncmain2.c | |
1619 | $(COMPILE) -c -fpic -o $@ $< | |
1620 | ||
1621 | ifuncdep2pic.o: ifuncdep2.c | |
1622 | $(COMPILE) -c -fpic -o $@ $< | |
1623 | ||
1624 | check_PROGRAMS += ifuncmain2static | |
1625 | ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c | |
1626 | ifuncmain2static_DEPENDENCIES = gcctestdir/ld | |
1627 | ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1628 | ifuncmain2static_LDADD = |
7223e9ca ILT |
1629 | |
1630 | check_PROGRAMS += ifuncmain2picstatic | |
1631 | ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
1632 | $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o | |
1633 | ||
1634 | check_PROGRAMS += ifuncmain2 | |
1635 | ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c | |
1636 | ifuncmain2_DEPENDENCIES = gcctestdir/ld | |
1637 | ifuncmain2_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1638 | ifuncmain2_LDADD = |
7223e9ca ILT |
1639 | |
1640 | check_PROGRAMS += ifuncmain2pic | |
1641 | ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
1642 | $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o | |
1643 | ||
1644 | ifuncmod3.o: ifuncmod3.c | |
1645 | $(COMPILE) -c -fpic -o $@ $< | |
1646 | ifuncmod3.so: ifuncmod3.o gcctestdir/ld | |
1647 | $(LINK) -Bgcctestdir/ -shared ifuncmod3.o | |
1648 | ||
1649 | check_PROGRAMS += ifuncmain3 | |
1650 | ifuncmain3_SOURCES = ifuncmain3.c | |
1651 | ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so | |
1652 | ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,. | |
1653 | ifuncmain3_LDADD = -ldl | |
1654 | ||
1655 | ifuncmain4pic.o: ifuncmain4.c | |
1656 | $(COMPILE) -c -fpic -o $@ $< | |
1657 | ||
1658 | check_PROGRAMS += ifuncmain4static | |
1659 | ifuncmain4static_SOURCES = ifuncmain4.c | |
1660 | ifuncmain4static_DEPENDENCIES = gcctestdir/ld | |
1661 | ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1662 | ifuncmain4static_LDADD = |
7223e9ca ILT |
1663 | |
1664 | check_PROGRAMS += ifuncmain4picstatic | |
1665 | ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld | |
1666 | $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o | |
1667 | ||
1668 | check_PROGRAMS += ifuncmain4 | |
1669 | ifuncmain4_SOURCES = ifuncmain4.c | |
1670 | ifuncmain4_DEPENDENCIES = gcctestdir/ld | |
1671 | ifuncmain4_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1672 | ifuncmain4_LDADD = |
7223e9ca ILT |
1673 | |
1674 | ifuncmain5pic.o: ifuncmain5.c | |
1675 | $(COMPILE) -c -fpic -o $@ $< | |
1676 | ||
1677 | ifuncmain5pie.o: ifuncmain5.c | |
1678 | $(COMPILE) -c -fpie -o $@ $< | |
1679 | ||
1680 | ifuncmod5.o: ifuncmod5.c | |
1681 | $(COMPILE) -c -fpic -o $@ $< | |
1682 | ifuncmod5.so: ifuncmod5.o gcctestdir/ld | |
1683 | $(LINK) -Bgcctestdir/ -shared ifuncmod5.o | |
1684 | ||
1685 | ifuncdep5.o: ifuncmod5.c | |
1686 | $(COMPILE) -c -o $@ $< | |
1687 | ||
1688 | check_PROGRAMS += ifuncmain5static | |
1689 | ifuncmain5static_SOURCES = ifuncmain5.c | |
1690 | ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o | |
1691 | ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static | |
1692 | ifuncmain5static_LDADD = ifuncdep5.o | |
1693 | ||
1694 | check_PROGRAMS += ifuncmain5picstatic | |
1695 | ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
1696 | $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o | |
1697 | ||
1698 | check_PROGRAMS += ifuncmain5 | |
1699 | ifuncmain5_SOURCES = ifuncmain5.c | |
1700 | ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so | |
1701 | ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1702 | ifuncmain5_LDADD = ifuncmod5.so | |
1703 | ||
1704 | check_PROGRAMS += ifuncmain5pic | |
1705 | ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld | |
1706 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,. | |
1707 | ||
1708 | check_PROGRAMS += ifuncmain5staticpic | |
1709 | ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
1710 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o | |
1711 | ||
1712 | check_PROGRAMS += ifuncmain5pie | |
1713 | ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld | |
1714 | $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. | |
1715 | ||
1716 | ifuncmain6pie.o: ifuncmain6pie.c | |
1717 | $(COMPILE) -c -fpie -o $@ $< | |
1718 | ||
1719 | ifuncmod6.o: ifuncmod6.c | |
1720 | $(COMPILE) -c -fpic -o $@ $< | |
1721 | ifuncmod6.so: ifuncmod6.o gcctestdir/ld | |
1722 | $(LINK) -Bgcctestdir/ -shared ifuncmod6.o | |
1723 | ||
1724 | check_PROGRAMS += ifuncmain6pie | |
1725 | ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld | |
1726 | $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. | |
1727 | ||
1728 | ifuncmain7pic.o: ifuncmain7.c | |
1729 | $(COMPILE) -c -fpic -o $@ $< | |
1730 | ||
1731 | ifuncmain7pie.o: ifuncmain7.c | |
1732 | $(COMPILE) -c -fpie -o $@ $< | |
1733 | ||
1734 | check_PROGRAMS += ifuncmain7static | |
1735 | ifuncmain7static_SOURCES = ifuncmain7.c | |
1736 | ifuncmain7static_DEPENDENCIES = gcctestdir/ld | |
1737 | ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1738 | ifuncmain7static_LDADD = |
7223e9ca ILT |
1739 | |
1740 | check_PROGRAMS += ifuncmain7picstatic | |
1741 | ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld | |
1742 | $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o | |
1743 | ||
1744 | check_PROGRAMS += ifuncmain7 | |
1745 | ifuncmain7_SOURCES = ifuncmain7.c | |
1746 | ifuncmain7_DEPENDENCIES = gcctestdir/ld | |
1747 | ifuncmain7_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1748 | ifuncmain7_LDADD = |
7223e9ca ILT |
1749 | |
1750 | check_PROGRAMS += ifuncmain7pic | |
1751 | ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld | |
1752 | $(LINK) -Bgcctestdir/ ifuncmain7pic.o | |
1753 | ||
1754 | check_PROGRAMS += ifuncmain7pie | |
1755 | ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld | |
1756 | $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o | |
1757 | ||
1758 | endif IFUNC | |
1759 | ||
74f67560 DK |
1760 | # Test that strong reference to a weak symbol in a DSO remains strong. |
1761 | check_SCRIPTS += strong_ref_weak_def.sh | |
1762 | check_DATA += strong_ref_weak_def.stdout | |
1763 | MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \ | |
1764 | strong_ref_weak_def.stdout | |
1765 | strong_ref_weak_def_2.o: strong_ref_weak_def_2.c | |
1766 | $(COMPILE) -o $@ -c -fPIC $< | |
1767 | strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld | |
1768 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o | |
1769 | strong_ref_weak_def_1.o: strong_ref_weak_def_1.c | |
1770 | $(COMPILE) -o $@ -c -fPIC $< | |
1771 | strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \ | |
1772 | gcctestdir/ld | |
1773 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \ | |
1774 | strong_ref_weak_def_2.so | |
1775 | strong_ref_weak_def.stdout: strong_ref_weak_def_1.so | |
1776 | $(TEST_READELF) -sWD $< > $@ | |
1777 | ||
a4649286 DK |
1778 | # Test that a strong weak reference remains strong if there is another |
1779 | # weak reference in a DSO. | |
1780 | check_SCRIPTS += dyn_weak_ref.sh | |
1781 | check_DATA += dyn_weak_ref.stdout | |
1782 | MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \ | |
1783 | dyn_weak_ref.stdout | |
1784 | dyn_weak_ref_2.o: dyn_weak_ref_2.c | |
1785 | $(COMPILE) -o $@ -c -fPIC $< | |
1786 | dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld | |
1787 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o | |
1788 | dyn_weak_ref_1.o: dyn_weak_ref_1.c | |
1789 | $(COMPILE) -o $@ -c -fPIC $< | |
1790 | # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o | |
1791 | # so that the weak ref there goes to gold's symbol table first. | |
1792 | dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld | |
1793 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o | |
1794 | dyn_weak_ref.stdout: dyn_weak_ref_1.so | |
1795 | $(TEST_READELF) -sWD $< > $@ | |
1796 | ||
1797 | ||
97b4be1c CC |
1798 | # Test that --start-lib and --end-lib function correctly. |
1799 | check_PROGRAMS += start_lib_test | |
1800 | start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \ | |
1801 | gcctestdir/ld | |
1802 | $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \ | |
1803 | -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib | |
1804 | libstart_lib_test.a: start_lib_test_1.o | |
1805 | $(TEST_AR) rc $@ $^ | |
1806 | ||
7f8cd844 NC |
1807 | # Test that MEMORY region support works. |
1808 | check_SCRIPTS += memory_test.sh | |
1809 | check_DATA += memory_test.stdout | |
1810 | MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o | |
d4d91489 ILT |
1811 | memory_test.o: memory_test.s |
1812 | $(COMPILE) -o $@ -c $< | |
1813 | memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t | |
7f8cd844 NC |
1814 | $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o |
1815 | memory_test.stdout: memory_test | |
41a8542a | 1816 | $(TEST_READELF) -lWS $< > $@ |
7f8cd844 | 1817 | |
2eedd706 CC |
1818 | # End-to-end incremental linking tests. |
1819 | # Incremental linking is currently supported only on the x86_64 target. | |
1820 | ||
1821 | if DEFAULT_TARGET_X86_64 | |
1822 | ||
1823 | check_PROGRAMS += incremental_test_2 | |
1824 | MOSTLYCLEANFILES += two_file_test_tmp.o | |
1825 | incremental_test_2: two_file_test_1_v1.o two_file_test_1.o two_file_test_1b.o \ | |
1826 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
1827 | cp -f two_file_test_1_v1.o two_file_test_tmp.o | |
1828 | $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_tmp.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o | |
1829 | @sleep 1 | |
1830 | cp -f two_file_test_1.o two_file_test_tmp.o | |
1831 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o | |
1832 | ||
1833 | check_PROGRAMS += incremental_test_3 | |
1834 | incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
1835 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
1836 | cp -f two_file_test_1b_v1.o two_file_test_tmp.o | |
1837 | $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_tmp.o two_file_test_2.o two_file_test_main.o | |
1838 | @sleep 1 | |
1839 | cp -f two_file_test_1b.o two_file_test_tmp.o | |
1840 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp.o two_file_test_2.o two_file_test_main.o | |
1841 | ||
1842 | check_PROGRAMS += incremental_test_4 | |
aa92d6ed | 1843 | MOSTLYCLEANFILES += incremental_test_4.base |
2eedd706 CC |
1844 | incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ |
1845 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
1846 | cp -f two_file_test_2_v1.o two_file_test_tmp.o | |
1847 | $(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp.o two_file_test_main.o | |
aa92d6ed | 1848 | mv -f incremental_test_4 incremental_test_4.base |
2eedd706 CC |
1849 | @sleep 1 |
1850 | cp -f two_file_test_2.o two_file_test_tmp.o | |
aa92d6ed | 1851 | $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp.o two_file_test_main.o |
2eedd706 CC |
1852 | |
1853 | endif DEFAULT_TARGET_X86_64 | |
1854 | ||
351a8000 ILT |
1855 | endif GCC |
1856 | endif NATIVE_LINKER | |
364c7fa5 | 1857 | |
eb373049 ILT |
1858 | # These tests work with native and cross linkers. |
1859 | ||
1860 | if NATIVE_OR_CROSS_LINKER | |
1861 | ||
1862 | # Test script section order. | |
1863 | check_SCRIPTS += script_test_10.sh | |
1864 | check_DATA += script_test_10.stdout | |
1865 | script_test_10.o: script_test_10.s | |
1866 | $(TEST_AS) -o $@ $< | |
1867 | script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld | |
1868 | gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t | |
1869 | script_test_10.stdout: script_test_10 | |
1870 | $(TEST_READELF) -SW script_test_10 > $@ | |
1871 | ||
1872 | # These tests work with cross linkers only. | |
364c7fa5 ILT |
1873 | |
1874 | if DEFAULT_TARGET_I386 | |
1875 | ||
1876 | check_SCRIPTS += split_i386.sh | |
1877 | check_DATA += split_i386_1.stdout split_i386_2.stdout \ | |
1878 | split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout | |
1879 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
1880 | split_i386_1.o: split_i386_1.s | |
1881 | $(TEST_AS) -o $@ $< | |
1882 | split_i386_2.o: split_i386_2.s | |
1883 | $(TEST_AS) -o $@ $< | |
1884 | split_i386_3.o: split_i386_3.s | |
1885 | $(TEST_AS) -o $@ $< | |
1886 | split_i386_4.o: split_i386_4.s | |
1887 | $(TEST_AS) -o $@ $< | |
1888 | split_i386_n.o: split_i386_n.s | |
1889 | $(TEST_AS) -o $@ $< | |
1890 | split_i386_1: split_i386_1.o split_i386_n.o ../ld-new | |
1891 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o | |
1892 | split_i386_1.stdout: split_i386_1 | |
1893 | $(TEST_OBJDUMP) -d $< > $@ | |
1894 | split_i386_2: split_i386_2.o split_i386_n.o ../ld-new | |
1895 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o | |
1896 | split_i386_2.stdout: split_i386_2 | |
1897 | $(TEST_OBJDUMP) -d $< > $@ | |
1898 | split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new | |
1899 | ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0 | |
1900 | split_i386_4: split_i386_4.o split_i386_n.o ../ld-new | |
1901 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o | |
1902 | split_i386_4.stdout: split_i386_4 | |
1903 | $(TEST_OBJDUMP) -d $< > $@ | |
1904 | split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new | |
1905 | ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0 | |
1906 | MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \ | |
1907 | split_i386_4 split_i386_r | |
1908 | ||
1909 | endif DEFAULT_TARGET_I386 | |
1910 | ||
1911 | if DEFAULT_TARGET_X86_64 | |
1912 | ||
1913 | check_SCRIPTS += split_x86_64.sh | |
1914 | check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \ | |
1915 | split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout | |
1916 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
1917 | split_x86_64_1.o: split_x86_64_1.s | |
1918 | $(TEST_AS) -o $@ $< | |
1919 | split_x86_64_2.o: split_x86_64_2.s | |
1920 | $(TEST_AS) -o $@ $< | |
1921 | split_x86_64_3.o: split_x86_64_3.s | |
1922 | $(TEST_AS) -o $@ $< | |
1923 | split_x86_64_4.o: split_x86_64_4.s | |
1924 | $(TEST_AS) -o $@ $< | |
1925 | split_x86_64_n.o: split_x86_64_n.s | |
1926 | $(TEST_AS) -o $@ $< | |
1927 | split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
1928 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o | |
1929 | split_x86_64_1.stdout: split_x86_64_1 | |
1930 | $(TEST_OBJDUMP) -d $< > $@ | |
1931 | split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new | |
1932 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o | |
1933 | split_x86_64_2.stdout: split_x86_64_2 | |
1934 | $(TEST_OBJDUMP) -d $< > $@ | |
1935 | split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new | |
1936 | ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0 | |
1937 | split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new | |
1938 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o | |
1939 | split_x86_64_4.stdout: split_x86_64_4 | |
1940 | $(TEST_OBJDUMP) -d $< > $@ | |
1941 | split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
1942 | ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 | |
1943 | MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ | |
1944 | split_x86_64_4 split_x86_64_r | |
1945 | ||
1946 | endif DEFAULT_TARGET_X86_64 | |
e4782e83 DK |
1947 | |
1948 | if DEFAULT_TARGET_ARM | |
1949 | ||
1950 | check_SCRIPTS += arm_abs_global.sh | |
1951 | check_DATA += arm_abs_global.stdout | |
1952 | arm_abs_lib.o: arm_abs_lib.s | |
1953 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 1954 | libarm_abs.so: arm_abs_lib.o ../ld-new |
e4782e83 DK |
1955 | ../ld-new -shared -o $@ arm_abs_lib.o |
1956 | arm_abs_global.o: arm_abs_global.s | |
1957 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 1958 | arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new |
e4782e83 DK |
1959 | ../ld-new -o $@ arm_abs_global.o -L. -larm_abs |
1960 | arm_abs_global.stdout: arm_abs_global | |
1961 | $(TEST_READELF) -r $< > $@ | |
1962 | ||
1963 | MOSTLYCLEANFILES += arm_abs_global | |
1964 | ||
aa98ff75 | 1965 | check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh |
2a2b6d42 DK |
1966 | check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \ |
1967 | thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \ | |
a2c7281b DK |
1968 | thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \ |
1969 | thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \ | |
aa98ff75 DK |
1970 | thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \ |
1971 | thumb_bl_out_of_range_local.stdout | |
2a2b6d42 DK |
1972 | |
1973 | arm_bl_in_range.stdout: arm_bl_in_range | |
1974 | $(TEST_OBJDUMP) -D $< > $@ | |
1975 | ||
d3bbad62 | 1976 | arm_bl_in_range: arm_bl_in_range.o ../ld-new |
2a2b6d42 DK |
1977 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
1978 | ||
1979 | arm_bl_in_range.o: arm_bl_in_range.s | |
1980 | $(TEST_AS) -o $@ $< | |
1981 | ||
1982 | arm_bl_out_of_range.stdout: arm_bl_out_of_range | |
1983 | $(TEST_OBJDUMP) -S $< > $@ | |
1984 | ||
d3bbad62 | 1985 | arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
1986 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
1987 | ||
1988 | arm_bl_out_of_range.o: arm_bl_out_of_range.s | |
1989 | $(TEST_AS) -o $@ $< | |
1990 | ||
1991 | thumb_bl_in_range.stdout: thumb_bl_in_range | |
1992 | $(TEST_OBJDUMP) -D $< > $@ | |
1993 | ||
d3bbad62 | 1994 | thumb_bl_in_range: thumb_bl_in_range.o ../ld-new |
2a2b6d42 DK |
1995 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
1996 | ||
1997 | thumb_bl_in_range.o: thumb_bl_in_range.s | |
1998 | $(TEST_AS) -o $@ -march=armv5te $< | |
1999 | ||
2000 | thumb_bl_out_of_range.stdout: thumb_bl_out_of_range | |
2001 | $(TEST_OBJDUMP) -D $< > $@ | |
2002 | ||
a2c7281b | 2003 | thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
2004 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2005 | ||
a2c7281b | 2006 | thumb_bl_out_of_range.o: thumb_bl_out_of_range.s |
2a2b6d42 DK |
2007 | $(TEST_AS) -o $@ -march=armv5te $< |
2008 | ||
2009 | thumb2_bl_in_range.stdout: thumb2_bl_in_range | |
2010 | $(TEST_OBJDUMP) -D $< > $@ | |
2011 | ||
d3bbad62 | 2012 | thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new |
2a2b6d42 DK |
2013 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2014 | ||
2015 | thumb2_bl_in_range.o: thumb_bl_in_range.s | |
2016 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2017 | ||
2018 | thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range | |
2019 | $(TEST_OBJDUMP) -D $< > $@ | |
2020 | ||
a2c7281b | 2021 | thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
2022 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2023 | ||
a2c7281b DK |
2024 | thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s |
2025 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2026 | ||
2027 | thumb_blx_in_range.stdout: thumb_blx_in_range | |
2028 | $(TEST_OBJDUMP) -D $< > $@ | |
2029 | ||
2030 | thumb_blx_in_range: thumb_blx_in_range.o ../ld-new | |
2031 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< | |
2032 | ||
2033 | thumb_blx_in_range.o: thumb_blx_in_range.s | |
2034 | $(TEST_AS) -o $@ -march=armv5te $< | |
2035 | ||
2036 | thumb_blx_out_of_range.stdout: thumb_blx_out_of_range | |
2037 | $(TEST_OBJDUMP) -D $< > $@ | |
2038 | ||
2039 | thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new | |
2040 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< | |
2041 | ||
2042 | thumb_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2043 | $(TEST_AS) -o $@ -march=armv5te $< | |
2044 | ||
2045 | thumb2_blx_in_range.stdout: thumb2_blx_in_range | |
2046 | $(TEST_OBJDUMP) -D $< > $@ | |
2047 | ||
2048 | thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new | |
2049 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
2050 | ||
2051 | thumb2_blx_in_range.o: thumb_blx_in_range.s | |
2052 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2053 | ||
2054 | thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range | |
2055 | $(TEST_OBJDUMP) -D $< > $@ | |
2056 | ||
2057 | thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new | |
2058 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
2059 | ||
2060 | thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2a2b6d42 DK |
2061 | $(TEST_AS) -o $@ -march=armv7-a $< |
2062 | ||
aa98ff75 DK |
2063 | thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local |
2064 | $(TEST_OBJDUMP) -D $< > $@ | |
2065 | ||
2066 | thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new | |
2067 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< | |
2068 | ||
2069 | thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s | |
2070 | $(TEST_AS) -o $@ -march=armv5te $< | |
2071 | ||
2a2b6d42 | 2072 | MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \ |
a2c7281b DK |
2073 | thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \ |
2074 | thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \ | |
aa98ff75 | 2075 | thumb2_blx_out_of_range thumb_bl_out_of_range_local |
2a2b6d42 | 2076 | |
2fd9ae7a DK |
2077 | check_SCRIPTS += arm_fix_v4bx.sh |
2078 | check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \ | |
2079 | arm_no_fix_v4bx.stdout | |
2080 | ||
2081 | arm_fix_v4bx.stdout: arm_fix_v4bx | |
2082 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2083 | ||
d3bbad62 | 2084 | arm_fix_v4bx: arm_fix_v4bx.o ../ld-new |
2fd9ae7a DK |
2085 | ../ld-new --fix-v4bx -o $@ $< |
2086 | ||
2087 | arm_fix_v4bx.o: arm_fix_v4bx.s | |
2088 | $(TEST_AS) -o $@ $< | |
2089 | ||
2090 | arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking | |
2091 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2092 | ||
d3bbad62 | 2093 | arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new |
2fd9ae7a DK |
2094 | ../ld-new --fix-v4bx-interworking -o $@ $< |
2095 | ||
2096 | arm_no_fix_v4bx.stdout: arm_no_fix_v4bx | |
2097 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2098 | ||
d3bbad62 | 2099 | arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new |
2fd9ae7a DK |
2100 | ../ld-new -o $@ $< |
2101 | ||
2102 | MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx | |
2103 | ||
da59ad79 DK |
2104 | check_SCRIPTS += arm_attr_merge.sh |
2105 | check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \ | |
2106 | arm_attr_merge_7.stdout | |
2107 | ||
2108 | arm_attr_merge_6.stdout: arm_attr_merge_6 | |
2109 | $(TEST_READELF) -A $< > $@ | |
2110 | ||
2111 | arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o | |
2112 | ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o | |
2113 | ||
2114 | arm_attr_merge_6a.o: arm_attr_merge_6a.s | |
2115 | $(TEST_AS) -o $@ $< | |
2116 | ||
2117 | arm_attr_merge_6b.o: arm_attr_merge_6b.s | |
2118 | $(TEST_AS) -o $@ $< | |
2119 | ||
2120 | arm_attr_merge_6r.stdout: arm_attr_merge_6r | |
2121 | $(TEST_READELF) -A $< > $@ | |
2122 | ||
2123 | arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o | |
2124 | ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o | |
2125 | ||
2126 | arm_attr_merge_7.stdout: arm_attr_merge_7 | |
2127 | $(TEST_READELF) -A $< > $@ | |
2128 | ||
2129 | arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o | |
2130 | ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o | |
2131 | ||
2132 | arm_attr_merge_7a.o: arm_attr_merge_7a.s | |
2133 | $(TEST_AS) -o $@ $< | |
2134 | ||
2135 | arm_attr_merge_7b.o: arm_attr_merge_7b.s | |
2136 | $(TEST_AS) -o $@ $< | |
2137 | ||
2138 | MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7 | |
2139 | ||
aa98ff75 DK |
2140 | # Cortex-A8 workaround test. |
2141 | ||
2142 | check_SCRIPTS += arm_cortex_a8.sh | |
2143 | check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \ | |
2144 | arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \ | |
2145 | arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout | |
2146 | ||
2147 | arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond | |
2148 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2149 | ||
2150 | arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new | |
2151 | ../ld-new -o $@ $< | |
2152 | ||
2153 | arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s | |
2154 | $(TEST_AS) -o $@ $< | |
2155 | ||
2156 | arm_cortex_a8_b.stdout: arm_cortex_a8_b | |
2157 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2158 | ||
2159 | arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new | |
2160 | ../ld-new --fix-cortex-a8 -o $@ $< | |
2161 | ||
2162 | arm_cortex_a8_b.o: arm_cortex_a8_b.s | |
2163 | $(TEST_AS) -o $@ $< | |
2164 | ||
2165 | arm_cortex_a8_bl.stdout: arm_cortex_a8_bl | |
2166 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2167 | ||
2168 | arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new | |
2169 | ../ld-new -o $@ $< | |
2170 | ||
2171 | arm_cortex_a8_bl.o: arm_cortex_a8_bl.s | |
2172 | $(TEST_AS) -o $@ $< | |
2173 | ||
2174 | arm_cortex_a8_blx.stdout: arm_cortex_a8_blx | |
2175 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2176 | ||
2177 | arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new | |
2178 | ../ld-new -o $@ $< | |
2179 | ||
2180 | arm_cortex_a8_blx.o: arm_cortex_a8_blx.s | |
2181 | $(TEST_AS) -o $@ $< | |
2182 | ||
2183 | arm_cortex_a8_local.stdout: arm_cortex_a8_local | |
2184 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2185 | ||
2186 | arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new | |
2187 | ../ld-new -o $@ $< | |
2188 | ||
2189 | arm_cortex_a8_local.o: arm_cortex_a8_local.s | |
2190 | $(TEST_AS) -o $@ $< | |
2191 | ||
2192 | arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc | |
2193 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2194 | ||
2195 | arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new | |
2196 | ../ld-new -o $@ $< | |
2197 | ||
2198 | arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s | |
2199 | $(TEST_AS) -o $@ $< | |
2200 | ||
2201 | MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \ | |
2202 | arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc | |
2203 | ||
c87e4302 DK |
2204 | check_SCRIPTS += arm_exidx_test.sh |
2205 | check_DATA += arm_exidx_test.stdout | |
2206 | ||
2207 | arm_exidx_test.stdout: arm_exidx_test.so | |
2208 | $(TEST_READELF) -S $< > $@ | |
2209 | ||
2210 | arm_exidx_test.so: arm_exidx_test.o ../ld-new | |
2211 | ../ld-new -shared -o $@ $< | |
2212 | ||
2213 | arm_exidx_test.o: arm_exidx_test.s | |
2214 | $(TEST_AS) -o $@ $< | |
2215 | ||
2216 | MOSTLYCLEANFILES += arm_exidx_test.so | |
2217 | ||
e4782e83 | 2218 | endif DEFAULT_TARGET_ARM |
eb373049 ILT |
2219 | |
2220 | endif NATIVE_OR_CROSS_LINKER | |
2221 |