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