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