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