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 | ||
351a8000 ILT |
235 | check_PROGRAMS += basic_test |
236 | check_PROGRAMS += basic_static_test | |
237 | check_PROGRAMS += basic_pic_test | |
238 | check_PROGRAMS += basic_static_pic_test | |
56ba9a23 | 239 | basic_test.o: basic_test.cc |
22dc1b09 | 240 | $(CXXCOMPILE) -O0 -c -o $@ $< |
56ba9a23 ILT |
241 | basic_test: basic_test.o gcctestdir/ld |
242 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
243 | basic_static_test: basic_test.o gcctestdir/ld | |
244 | $(CXXLINK) -Bgcctestdir/ -static basic_test.o | |
22dc1b09 | 245 | |
56ba9a23 | 246 | basic_pic_test.o: basic_test.cc |
22dc1b09 | 247 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
56ba9a23 ILT |
248 | basic_pic_test: basic_pic_test.o gcctestdir/ld |
249 | $(CXXLINK) -Bgcctestdir/ basic_pic_test.o | |
250 | basic_static_pic_test: basic_pic_test.o gcctestdir/ld | |
251 | $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o | |
22dc1b09 | 252 | |
374ad285 ILT |
253 | check_PROGRAMS += basic_pie_test |
254 | basic_pie_test.o: basic_test.cc | |
255 | $(CXXCOMPILE) -O0 -c -fpie -o $@ $< | |
256 | basic_pie_test: basic_pie_test.o gcctestdir/ld | |
257 | $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o | |
351a8000 ILT |
258 | |
259 | check_PROGRAMS += constructor_test | |
260 | check_PROGRAMS += constructor_static_test | |
d5026652 ILT |
261 | constructor_test_SOURCES = constructor_test.cc |
262 | constructor_test_DEPENDENCIES = gcctestdir/ld | |
263 | constructor_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 264 | constructor_test_LDADD = |
d5026652 | 265 | |
351a8000 ILT |
266 | constructor_static_test_SOURCES = $(constructor_test_SOURCES) |
267 | constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) | |
268 | constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static | |
1abce4a6 | 269 | constructor_static_test_LDADD = $(constructor_test_LDADD) |
cb615bc1 | 270 | |
351a8000 ILT |
271 | |
272 | check_PROGRAMS += two_file_test | |
273 | check_PROGRAMS += two_file_static_test | |
274 | check_PROGRAMS += two_file_pic_test | |
3bd52c28 ILT |
275 | two_file_test_SOURCES = \ |
276 | two_file_test_1.cc \ | |
03e8f2b2 | 277 | two_file_test_1b.cc \ |
3bd52c28 ILT |
278 | two_file_test_2.cc \ |
279 | two_file_test_main.cc \ | |
280 | two_file_test.h | |
281 | two_file_test_DEPENDENCIES = gcctestdir/ld | |
282 | two_file_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 283 | two_file_test_LDADD = |
3bd52c28 | 284 | |
351a8000 ILT |
285 | two_file_static_test_SOURCES = $(two_file_test_SOURCES) |
286 | two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) | |
287 | two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static | |
1abce4a6 | 288 | two_file_static_test_LDADD = $(two_file_test_LDADD) |
f958d5fc ILT |
289 | |
290 | two_file_pic_test_SOURCES = two_file_test_main.cc | |
291 | two_file_pic_test_DEPENDENCIES = \ | |
03e8f2b2 | 292 | gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 293 | two_file_pic_test_LDFLAGS = -Bgcctestdir/ |
03e8f2b2 | 294 | two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 295 | |
351a8000 ILT |
296 | |
297 | check_PROGRAMS += two_file_shared_1_test | |
298 | check_PROGRAMS += two_file_shared_2_test | |
299 | check_PROGRAMS += two_file_shared_1_pic_2_test | |
300 | check_PROGRAMS += two_file_shared_2_pic_1_test | |
301 | check_PROGRAMS += two_file_same_shared_test | |
302 | check_PROGRAMS += two_file_separate_shared_12_test | |
303 | check_PROGRAMS += two_file_separate_shared_21_test | |
304 | two_file_test_1_pic.o: two_file_test_1.cc | |
305 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
306 | two_file_test_1b_pic.o: two_file_test_1b.cc |
307 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 ILT |
308 | two_file_test_2_pic.o: two_file_test_2.cc |
309 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
310 | two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld |
311 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o | |
351a8000 ILT |
312 | two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld |
313 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o | |
03e8f2b2 ILT |
314 | two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld |
315 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o | |
351a8000 | 316 | |
3bd52c28 ILT |
317 | two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc |
318 | two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so | |
319 | two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
320 | two_file_shared_1_test_LDADD = two_file_shared_1.so | |
321 | ||
03e8f2b2 | 322 | two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
323 | two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so |
324 | two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
325 | two_file_shared_2_test_LDADD = two_file_shared_2.so | |
326 | ||
386c048c ILT |
327 | two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc |
328 | two_file_shared_1_pic_2_test_DEPENDENCIES = \ | |
2f2de248 | 329 | gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o |
386c048c | 330 | two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
03e8f2b2 | 331 | 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 |
332 | |
333 | two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc | |
334 | two_file_shared_2_pic_1_test_DEPENDENCIES = \ | |
335 | gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o | |
336 | two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
337 | two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so | |
338 | ||
3bd52c28 ILT |
339 | two_file_same_shared_test_SOURCES = two_file_test_main.cc |
340 | two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so | |
341 | two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
342 | two_file_same_shared_test_LDADD = two_file_shared.so | |
343 | ||
344 | two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc | |
345 | two_file_separate_shared_12_test_DEPENDENCIES = \ | |
346 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
347 | two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
348 | two_file_separate_shared_12_test_LDADD = \ | |
349 | two_file_shared_1.so two_file_shared_2.so | |
350 | ||
351 | two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc | |
352 | two_file_separate_shared_21_test_DEPENDENCIES = \ | |
353 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
354 | two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
355 | two_file_separate_shared_21_test_LDADD = \ | |
356 | two_file_shared_2.so two_file_shared_1.so | |
357 | ||
6a74a719 ILT |
358 | check_PROGRAMS += two_file_relocatable_test |
359 | two_file_relocatable_test_SOURCES = two_file_test_main.cc | |
360 | two_file_relocatable_test_DEPENDENCIES = \ | |
361 | gcctestdir/ld two_file_relocatable.o | |
362 | two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
363 | two_file_relocatable_test_LDADD = two_file_relocatable.o | |
364 | two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
365 | gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
366 | ||
374ad285 ILT |
367 | check_PROGRAMS += two_file_pie_test |
368 | two_file_test_1_pie.o: two_file_test_1.cc | |
369 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
370 | two_file_test_1b_pie.o: two_file_test_1b.cc | |
371 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
372 | two_file_test_2_pie.o: two_file_test_2.cc | |
373 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
374 | two_file_test_main_pie.o: two_file_test_main.cc | |
375 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
376 | two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \ | |
377 | two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld | |
378 | $(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 | |
379 | ||
031cdbed ILT |
380 | check_SCRIPTS += two_file_shared.sh |
381 | check_DATA += two_file_shared.dbg | |
72fef11a | 382 | MOSTLYCLEANFILES += two_file_shared.dbg |
031cdbed ILT |
383 | two_file_shared.dbg: two_file_shared.so |
384 | $(TEST_READELF) -w $< >$@ 2>/dev/null | |
385 | ||
63402fe4 ILT |
386 | # The nonpic tests will fail on platforms which can not put non-PIC |
387 | # code into shared libraries, so we just don't run them in that case. | |
63402fe4 | 388 | if FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 389 | |
351a8000 ILT |
390 | check_PROGRAMS += two_file_shared_1_nonpic_test |
391 | check_PROGRAMS += two_file_shared_2_nonpic_test | |
392 | check_PROGRAMS += two_file_same_shared_nonpic_test | |
393 | check_PROGRAMS += two_file_separate_shared_12_nonpic_test | |
394 | check_PROGRAMS += two_file_separate_shared_21_nonpic_test | |
03e8f2b2 ILT |
395 | check_PROGRAMS += two_file_mixed_shared_test |
396 | check_PROGRAMS += two_file_mixed_2_shared_test | |
351a8000 | 397 | two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld |
03e8f2b2 | 398 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o |
351a8000 ILT |
399 | two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld |
400 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o | |
03e8f2b2 ILT |
401 | two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld |
402 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
403 | two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld | |
404 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o | |
405 | two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld | |
406 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so | |
351a8000 | 407 | |
3bd52c28 ILT |
408 | two_file_shared_1_nonpic_test_SOURCES = \ |
409 | two_file_test_2.cc two_file_test_main.cc | |
410 | two_file_shared_1_nonpic_test_DEPENDENCIES = \ | |
411 | gcctestdir/ld two_file_shared_1_nonpic.so | |
412 | two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
413 | two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so | |
414 | ||
415 | two_file_shared_2_nonpic_test_SOURCES = \ | |
03e8f2b2 | 416 | two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
417 | two_file_shared_2_nonpic_test_DEPENDENCIES = \ |
418 | gcctestdir/ld two_file_shared_2_nonpic.so | |
419 | two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
420 | two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so | |
421 | ||
422 | two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc | |
423 | two_file_same_shared_nonpic_test_DEPENDENCIES = \ | |
424 | gcctestdir/ld two_file_shared_nonpic.so | |
425 | two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
426 | two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so | |
427 | ||
428 | two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc | |
429 | two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \ | |
430 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
431 | two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
432 | two_file_separate_shared_12_nonpic_test_LDADD = \ | |
433 | two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
434 | ||
435 | two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc | |
436 | two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \ | |
437 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
438 | two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
439 | two_file_separate_shared_21_nonpic_test_LDADD = \ | |
440 | two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so | |
441 | ||
03e8f2b2 ILT |
442 | two_file_mixed_shared_test_SOURCES = two_file_test_main.cc |
443 | two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so | |
444 | two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
445 | two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so | |
446 | ||
447 | two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc | |
448 | two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so | |
449 | two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
450 | two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so | |
451 | ||
351a8000 | 452 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 453 | |
6835af53 ILT |
454 | check_PROGRAMS += two_file_strip_test |
455 | two_file_strip_test: two_file_test | |
456 | $(TEST_STRIP) -o two_file_strip_test two_file_test | |
457 | ||
458 | check_PROGRAMS += two_file_same_shared_strip_test | |
459 | two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc | |
460 | two_file_same_shared_strip_test_DEPENDENCIES = \ | |
461 | gcctestdir/ld two_file_shared_strip.so | |
462 | two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R. | |
463 | two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so | |
464 | two_file_shared_strip.so: two_file_shared.so | |
465 | $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so | |
466 | ||
49bdd526 ILT |
467 | check_PROGRAMS += common_test_1 |
468 | common_test_1_SOURCES = common_test_1.c | |
469 | common_test_1_DEPENDENCIES = gcctestdir/ld | |
470 | common_test_1_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 471 | common_test_1_LDADD = |
351a8000 | 472 | |
eda294df ILT |
473 | check_PROGRAMS += common_test_2 |
474 | common_test_2_SOURCES = common_test_1.c | |
475 | common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld | |
476 | common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
477 | common_test_2_LDADD = common_test_2.so common_test_3.so | |
478 | common_test_2_pic.o: common_test_2.c | |
479 | $(COMPILE) -c -fpic -o $@ $< | |
480 | common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld | |
481 | $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so | |
482 | common_test_3_pic.o: common_test_3.c | |
483 | $(COMPILE) -c -fpic -o $@ $< | |
484 | common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld | |
485 | $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script | |
486 | ||
351a8000 ILT |
487 | check_PROGRAMS += exception_test |
488 | check_PROGRAMS += exception_static_test | |
489 | check_PROGRAMS += exception_shared_1_test | |
490 | check_PROGRAMS += exception_shared_2_test | |
491 | check_PROGRAMS += exception_same_shared_test | |
492 | check_PROGRAMS += exception_separate_shared_12_test | |
493 | check_PROGRAMS += exception_separate_shared_21_test | |
494 | exception_test_1_pic.o: exception_test_1.cc | |
495 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
496 | exception_test_2_pic.o: exception_test_2.cc | |
497 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
498 | exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld | |
499 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o | |
500 | exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld | |
501 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o | |
502 | exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld | |
503 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o | |
63402fe4 | 504 | |
3151305a ILT |
505 | exception_test_SOURCES = \ |
506 | exception_test_main.cc \ | |
507 | exception_test_1.cc \ | |
508 | exception_test_2.cc \ | |
509 | exception_test.h | |
510 | exception_test_DEPENDENCIES = gcctestdir/ld | |
511 | exception_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 512 | exception_test_LDADD = |
3151305a | 513 | |
351a8000 ILT |
514 | exception_static_test_SOURCES = $(exception_test_SOURCES) |
515 | exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) | |
516 | exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static | |
1abce4a6 | 517 | exception_static_test_LDADD = $(exception_test_LDADD) |
3151305a ILT |
518 | |
519 | exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc | |
520 | exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so | |
521 | exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
522 | exception_shared_1_test_LDADD = exception_shared_1.so | |
523 | ||
524 | exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc | |
525 | exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so | |
526 | exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
527 | exception_shared_2_test_LDADD = exception_shared_2.so | |
528 | ||
529 | exception_same_shared_test_SOURCES = exception_test_main.cc | |
530 | exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so | |
531 | exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
532 | exception_same_shared_test_LDADD = exception_shared.so | |
533 | ||
534 | exception_separate_shared_12_test_SOURCES = exception_test_main.cc | |
535 | exception_separate_shared_12_test_DEPENDENCIES = \ | |
536 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
537 | exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
538 | exception_separate_shared_12_test_LDADD = \ | |
539 | exception_shared_1.so exception_shared_2.so | |
540 | ||
541 | exception_separate_shared_21_test_SOURCES = exception_test_main.cc | |
542 | exception_separate_shared_21_test_DEPENDENCIES = \ | |
543 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
544 | exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
545 | exception_separate_shared_21_test_LDADD = \ | |
546 | exception_shared_2.so exception_shared_1.so | |
547 | ||
3151305a | 548 | |
351a8000 | 549 | check_PROGRAMS += weak_test |
a360aedd | 550 | weak_test_SOURCES = weak_test.cc |
0e470e5c | 551 | weak_test_DEPENDENCIES = gcctestdir/ld |
a360aedd | 552 | weak_test_LDFLAGS = -Bgcctestdir/ |
1abce4a6 | 553 | weak_test_LDADD = |
a360aedd | 554 | |
86925eef | 555 | check_PROGRAMS += weak_undef_test |
72fef11a | 556 | MOSTLYCLEANFILES += alt/weak_undef_lib.so |
86925eef CC |
557 | weak_undef_test_SOURCES = weak_undef_test.cc |
558 | weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so | |
559 | weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
560 | weak_undef_test_LDADD = -L . weak_undef_lib.so | |
561 | weak_undef_file1.o: weak_undef_file1.cc | |
562 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
563 | weak_undef_file2.o: weak_undef_file2.cc | |
564 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
565 | weak_undef_lib.so: weak_undef_file1.o | |
566 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o | |
567 | alt/weak_undef_lib.so: weak_undef_file2.o | |
568 | test -d alt || mkdir -p alt | |
569 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o | |
351a8000 | 570 | |
f3c69fca CC |
571 | if FN_PTRS_IN_SO_WITHOUT_PIC |
572 | check_PROGRAMS += weak_undef_nonpic_test | |
72fef11a | 573 | MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so |
f3c69fca CC |
574 | weak_undef_nonpic_test_SOURCES = weak_undef_test.cc |
575 | weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so | |
576 | weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
577 | weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so | |
578 | weak_undef_file1_nonpic.o: weak_undef_file1.cc | |
579 | $(CXXCOMPILE) -c -o $@ $< | |
580 | weak_undef_file2_nonpic.o: weak_undef_file2.cc | |
581 | $(CXXCOMPILE) -c -o $@ $< | |
582 | weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o | |
583 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o | |
584 | alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o | |
585 | test -d alt || mkdir -p alt | |
586 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o | |
587 | endif FN_PTRS_IN_SO_WITHOUT_PIC | |
588 | ||
589 | ||
99a37bfd ILT |
590 | check_PROGRAMS += weak_alias_test |
591 | weak_alias_test_SOURCES = weak_alias_test_main.cc | |
592 | weak_alias_test_DEPENDENCIES = \ | |
593 | gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \ | |
594 | weak_alias_test_3.o weak_alias_test_4.so | |
595 | weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
596 | weak_alias_test_LDADD = \ | |
597 | weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \ | |
598 | weak_alias_test_4.so | |
599 | weak_alias_test_1_pic.o: weak_alias_test_1.cc | |
600 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 601 | weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld |
99a37bfd ILT |
602 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o |
603 | weak_alias_test_2_pic.o: weak_alias_test_2.cc | |
604 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 605 | weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld |
99a37bfd ILT |
606 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o |
607 | weak_alias_test_3.o: weak_alias_test_3.cc | |
608 | $(CXXCOMPILE) -c -o $@ $< | |
609 | weak_alias_test_4_pic.o: weak_alias_test_4.cc | |
610 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 611 | weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld |
99a37bfd ILT |
612 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o |
613 | ||
de4c45bd ILT |
614 | check_SCRIPTS += weak_plt.sh |
615 | check_PROGRAMS += weak_plt | |
616 | check_DATA += weak_plt_shared.so | |
617 | weak_plt_main_pic.o: weak_plt_main.cc | |
618 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
619 | weak_plt: weak_plt_main_pic.o gcctestdir/ld | |
620 | $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o | |
621 | weak_plt_shared_pic.o: weak_plt_shared.cc | |
622 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
623 | weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld | |
624 | $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o | |
625 | ||
f34787f8 ILT |
626 | check_PROGRAMS += copy_test |
627 | copy_test_SOURCES = copy_test.cc | |
628 | copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so | |
629 | copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
630 | copy_test_LDADD = copy_test_1.so copy_test_2.so | |
631 | copy_test_1_pic.o: copy_test_1.cc | |
632 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
633 | copy_test_1.so: gcctestdir/ld copy_test_1_pic.o | |
634 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o | |
635 | copy_test_2_pic.o: copy_test_2.cc | |
636 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
637 | copy_test_2.so: gcctestdir/ld copy_test_2_pic.o | |
638 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o | |
639 | ||
6eee141f ILT |
640 | if TLS |
641 | ||
351a8000 ILT |
642 | check_PROGRAMS += tls_test |
643 | check_PROGRAMS += tls_pic_test | |
c7177d31 | 644 | check_PROGRAMS += tls_pie_test |
b3705d2a | 645 | check_PROGRAMS += tls_pie_pic_test |
351a8000 | 646 | check_PROGRAMS += tls_shared_test |
c03c7692 | 647 | check_PROGRAMS += tls_shared_ie_test |
c2b45e22 | 648 | check_PROGRAMS += tls_shared_gd_to_ie_test |
351a8000 ILT |
649 | tls_test_pic.o: tls_test.cc |
650 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
651 | tls_test_file2_pic.o: tls_test_file2.cc | |
652 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
155a0dd7 ILT |
653 | tls_test_c_pic.o: tls_test_c.c |
654 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
655 | tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld | |
9c2d0ef9 | 656 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs |
c2b45e22 CC |
657 | tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld |
658 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o | |
351a8000 | 659 | |
c03c7692 ILT |
660 | tls_test_pic_ie.o: tls_test.cc |
661 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
662 | tls_test_file2_pic_ie.o: tls_test_file2.cc | |
663 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
155a0dd7 ILT |
664 | tls_test_c_pic_ie.o: tls_test_c.c |
665 | $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $< | |
666 | tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld | |
667 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o | |
c03c7692 | 668 | |
e0374858 | 669 | tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h |
155a0dd7 | 670 | tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o |
6eee141f | 671 | tls_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
672 | tls_test_LDADD = tls_test_c.o -lpthread |
673 | tls_test_c.o: tls_test_c.c | |
674 | $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $< | |
6eee141f ILT |
675 | |
676 | tls_pic_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
677 | tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \ |
678 | tls_test_c_pic.o | |
6eee141f | 679 | tls_pic_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
680 | tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \ |
681 | -lpthread | |
6eee141f | 682 | |
c7177d31 ILT |
683 | tls_test_main_pie.o: tls_test_main.cc tls_test.h |
684 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
685 | tls_test_pie.o: tls_test.cc tls_test.h | |
686 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
687 | tls_test_file2_pie.o: tls_test_file2.cc tls_test.h | |
688 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
689 | tls_test_c_pie.o: tls_test_c.c | |
690 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
691 | tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \ | |
692 | tls_test_c_pie.o gcctestdir/ld | |
693 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread | |
694 | ||
b3705d2a ILT |
695 | tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \ |
696 | tls_test_c_pic.o gcctestdir/ld | |
697 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread | |
698 | ||
6eee141f ILT |
699 | tls_shared_test_SOURCES = tls_test_main.cc |
700 | tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so | |
701 | tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
702 | tls_shared_test_LDADD = tls_test_shared.so -lpthread | |
703 | ||
c03c7692 ILT |
704 | tls_shared_ie_test_SOURCES = tls_test_main.cc |
705 | tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so | |
706 | tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
707 | tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread | |
708 | ||
c2b45e22 | 709 | tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc |
155a0dd7 ILT |
710 | tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \ |
711 | tls_test_c_pic.o tls_test_shared2.so | |
c2b45e22 | 712 | tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
713 | tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \ |
714 | tls_test_shared2.so -lpthread | |
c2b45e22 CC |
715 | |
716 | if TLS_GNU2_DIALECT | |
717 | ||
718 | check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test | |
719 | ||
720 | tls_test_gnu2.o: tls_test.cc | |
721 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
722 | tls_test_file2_gnu2.o: tls_test_file2.cc | |
723 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
155a0dd7 ILT |
724 | tls_test_c_gnu2.o: tls_test_c.c |
725 | $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $< | |
c2b45e22 CC |
726 | tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld |
727 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o | |
728 | ||
729 | tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
730 | tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \ |
731 | tls_test_c_gnu2.o tls_test_gnu2_shared2.so | |
c2b45e22 | 732 | tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
733 | tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \ |
734 | tls_test_gnu2_shared2.so -lpthread | |
c2b45e22 CC |
735 | |
736 | if TLS_DESCRIPTORS | |
737 | ||
738 | check_PROGRAMS += tls_shared_gnu2_test | |
739 | ||
155a0dd7 ILT |
740 | tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld |
741 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o | |
c2b45e22 CC |
742 | |
743 | tls_shared_gnu2_test_SOURCES = tls_test_main.cc | |
744 | tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so | |
745 | tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
746 | tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread | |
747 | ||
748 | endif TLS_DESCRIPTORS | |
749 | ||
750 | endif TLS_GNU2_DIALECT | |
751 | ||
351a8000 ILT |
752 | if STATIC_TLS |
753 | check_PROGRAMS += tls_static_test | |
754 | check_PROGRAMS += tls_static_pic_test | |
755 | ||
756 | tls_static_test_SOURCES = $(tls_test_SOURCES) | |
757 | tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) | |
758 | tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static | |
759 | tls_static_test_LDADD = $(tls_test_LDADD) | |
760 | ||
761 | tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES) | |
762 | tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) | |
763 | tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static | |
764 | tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) | |
765 | endif | |
6eee141f ILT |
766 | |
767 | if FN_PTRS_IN_SO_WITHOUT_PIC | |
351a8000 | 768 | check_PROGRAMS += tls_shared_nonpic_test |
155a0dd7 ILT |
769 | tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld |
770 | $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o | |
6eee141f ILT |
771 | |
772 | tls_shared_nonpic_test_SOURCES = tls_test_main.cc | |
773 | tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so | |
774 | tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
775 | tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread | |
351a8000 | 776 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
6eee141f | 777 | |
351a8000 | 778 | endif TLS |
6eee141f | 779 | |
d491d34e ILT |
780 | check_PROGRAMS += many_sections_test |
781 | many_sections_test_SOURCES = many_sections_test.cc | |
782 | many_sections_test_DEPENDENCIES = gcctestdir/ld | |
783 | many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic | |
1abce4a6 | 784 | many_sections_test_LDADD = |
d491d34e ILT |
785 | |
786 | BUILT_SOURCES += many_sections_define.h | |
72fef11a | 787 | MOSTLYCLEANFILES += many_sections_define.h |
d491d34e ILT |
788 | many_sections_define.h: |
789 | (for i in `seq 1 70000`; do \ | |
790 | echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \ | |
791 | done) > $@.tmp | |
792 | mv -f $@.tmp $@ | |
793 | ||
794 | BUILT_SOURCES += many_sections_check.h | |
72fef11a | 795 | MOSTLYCLEANFILES += many_sections_check.h |
d491d34e | 796 | many_sections_check.h: |
4c94d6ae | 797 | (for i in `seq 1 1000 70000`; do \ |
d491d34e ILT |
798 | echo "assert(var_$$i == $$i);"; \ |
799 | done) > $@.tmp | |
800 | mv -f $@.tmp $@ | |
801 | ||
802 | check_PROGRAMS += many_sections_r_test | |
d491d34e ILT |
803 | many_sections_r_test.o: many_sections_test.o gcctestdir/ld |
804 | gcctestdir/ld -r -o $@ many_sections_test.o | |
7bc3e21a ILT |
805 | many_sections_r_test: many_sections_r_test.o gcctestdir/ld |
806 | $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS) | |
6eee141f | 807 | |
2fd32231 ILT |
808 | if CONSTRUCTOR_PRIORITY |
809 | ||
810 | check_PROGRAMS += initpri1 | |
811 | initpri1_SOURCES = initpri1.c | |
812 | initpri1_DEPENDENCIES = gcctestdir/ld | |
813 | initpri1_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 814 | initpri1_LDADD = |
2fd32231 ILT |
815 | |
816 | endif | |
817 | ||
818 | ||
351a8000 ILT |
819 | # Test --detect-odr-violations |
820 | check_SCRIPTS += debug_msg.sh | |
6eee141f | 821 | |
351a8000 ILT |
822 | # Create the data files that debug_msg.sh analyzes. |
823 | check_DATA += debug_msg.err | |
824 | MOSTLYCLEANFILES += debug_msg.err | |
825 | debug_msg.o: debug_msg.cc | |
826 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc | |
827 | odr_violation1.o: odr_violation1.cc | |
828 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc | |
829 | odr_violation2.o: odr_violation2.cc | |
830 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc | |
831 | debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld | |
832 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" | |
833 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ | |
834 | then \ | |
835 | echo 1>&2 "Link of debug_msg should have failed"; \ | |
836 | rm -f $@; \ | |
837 | exit 1; \ | |
838 | fi | |
839 | ||
840 | # See if we can also detect problems when we're linking .so's, not .o's. | |
841 | check_DATA += debug_msg_so.err | |
842 | MOSTLYCLEANFILES += debug_msg_so.err | |
843 | debug_msg.so: debug_msg.cc gcctestdir/ld | |
844 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
845 | odr_violation1.so: odr_violation1.cc gcctestdir/ld | |
846 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
847 | odr_violation2.so: odr_violation2.cc gcctestdir/ld | |
848 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc | |
849 | debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld | |
850 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" | |
851 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ | |
852 | then \ | |
853 | echo 1>&2 "Link of debug_msg_so should have failed"; \ | |
854 | rm -f $@; \ | |
855 | exit 1; \ | |
856 | fi | |
857 | ||
858 | # We also want to make sure we do something reasonable when there's no | |
859 | # debug info available. For the best test, we use .so's. | |
860 | check_DATA += debug_msg_ndebug.err | |
861 | MOSTLYCLEANFILES += debug_msg_ndebug.err | |
862 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld | |
863 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
864 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld | |
865 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
866 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld | |
867 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc | |
868 | debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld | |
869 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@" | |
870 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \ | |
871 | then \ | |
872 | echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ | |
873 | rm -f $@; \ | |
874 | exit 1; \ | |
875 | fi | |
876 | ||
877 | ||
878 | # Similar to --detect-odr-violations: check for undefined symbols in .so's | |
879 | check_SCRIPTS += undef_symbol.sh | |
880 | check_DATA += undef_symbol.err | |
881 | MOSTLYCLEANFILES += undef_symbol.err | |
882 | undef_symbol.o: undef_symbol.cc | |
883 | $(CXXCOMPILE) -O0 -g -c -fPIC $< | |
884 | undef_symbol.so: undef_symbol.o gcctestdir/ld | |
885 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o | |
886 | undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld | |
887 | @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@" | |
888 | @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \ | |
889 | then \ | |
890 | echo 1>&2 "Link of undef_symbol_test should have failed"; \ | |
891 | rm -f $@; \ | |
892 | exit 1; \ | |
893 | fi | |
894 | ||
895 | ||
351a8000 ILT |
896 | # Test -o when emitting to a special file (such as something in /dev). |
897 | check_PROGRAMS += flagstest_o_specialfile | |
0e470e5c | 898 | flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld |
351a8000 ILT |
899 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@ |
900 | chmod a+x $@ | |
901 | test -s $@ | |
902 | ||
7fcd0256 ILT |
903 | if HAVE_ZLIB |
904 | ||
905 | # Test --compress-debug-sections. FIXME: check we actually compress. | |
906 | check_PROGRAMS += flagstest_compress_debug_sections | |
907 | flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld | |
908 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib | |
909 | test -s $@ | |
910 | ||
911 | ||
351a8000 ILT |
912 | # The specialfile output has a tricky case when we also compress debug |
913 | # sections, because it requires output-file resizing. | |
914 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections | |
0e470e5c ILT |
915 | flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \ |
916 | gcctestdir/ld | |
126f3ece | 917 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@ |
351a8000 ILT |
918 | chmod a+x $@ |
919 | test -s $@ | |
920 | ||
7fcd0256 ILT |
921 | endif HAVE_ZLIB |
922 | ||
99f8faca ILT |
923 | # Test symbol versioning. |
924 | check_PROGRAMS += ver_test | |
925 | ver_test_SOURCES = ver_test_main.cc | |
926 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
927 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
928 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
929 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld | |
930 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so | |
09124467 ILT |
931 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
932 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so | |
933 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld | |
934 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o | |
99f8faca ILT |
935 | ver_test_1.o: ver_test_1.cc |
936 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
937 | ver_test_2.o: ver_test_2.cc | |
938 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
939 | ver_test_3.o: ver_test_3.cc | |
940 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
941 | ver_test_4.o: ver_test_4.cc | |
942 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 943 | |
0602e05a ILT |
944 | check_SCRIPTS += ver_test_1.sh |
945 | check_DATA += ver_test_1.syms | |
946 | ver_test_1.syms: ver_test_1.so | |
947 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
948 | ||
be3e6201 ILT |
949 | check_PROGRAMS += ver_test_2 |
950 | ver_test_2_SOURCES = ver_test_main_2.cc | |
951 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
952 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
953 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
954 | ||
be3e6201 ILT |
955 | check_SCRIPTS += ver_test_2.sh |
956 | check_DATA += ver_test_2.syms | |
957 | ver_test_2.syms: ver_test_2 | |
6835af53 | 958 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 959 | |
686c8caf ILT |
960 | check_SCRIPTS += ver_test_4.sh |
961 | check_DATA += ver_test_4.syms | |
962 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 963 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
964 | |
965 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld | |
966 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so | |
967 | ver_test_5.o: ver_test_5.cc | |
968 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
969 | check_SCRIPTS += ver_test_5.sh | |
970 | check_DATA += ver_test_5.syms | |
971 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 972 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 973 | |
18e6b24e ILT |
974 | check_PROGRAMS += ver_test_6 |
975 | ver_test_6_SOURCES = ver_test_6.c | |
976 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
977 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
978 | ver_test_6_LDADD = ver_test_2.so | |
979 | ||
479f6503 ILT |
980 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
981 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o | |
982 | ver_test_7.o: ver_test_7.cc | |
983 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
984 | check_SCRIPTS += ver_test_7.sh | |
985 | check_DATA += ver_test_7.syms | |
986 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 987 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 988 | |
75517b77 ILT |
989 | check_PROGRAMS += ver_test_8 |
990 | ver_test_8_SOURCES = two_file_test_main.cc | |
991 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so | |
992 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
993 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so | |
994 | ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld | |
995 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so | |
996 | ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld | |
997 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o | |
998 | ||
95d14cd3 ILT |
999 | check_PROGRAMS += ver_test_9 |
1000 | ver_test_9_SOURCES = ver_test_main.cc | |
1001 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so | |
1002 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1003 | ver_test_9_LDADD = ver_test_9.so | |
1004 | ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld | |
1005 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so | |
1006 | ver_test_9.o: ver_test_9.cc | |
1007 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1008 | ||
057ead22 ILT |
1009 | check_SCRIPTS += ver_test_10.sh |
1010 | check_DATA += ver_test_10.syms | |
1011 | ver_test_10.syms: ver_test_10.so | |
1012 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1013 | ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script | |
1014 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o | |
1015 | ||
9c5b8369 | 1016 | check_PROGRAMS += ver_test_11 |
72fef11a | 1017 | MOSTLYCLEANFILES += ver_test_11.a |
9c5b8369 ILT |
1018 | ver_test_11_SOURCES = ver_test_main_2.cc |
1019 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a | |
1020 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1021 | ver_test_11_LDADD = ver_test_11.a | |
1022 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o | |
1023 | $(TEST_AR) rc $@ $^ | |
1024 | ||
8bdcdf2c ILT |
1025 | check_PROGRAMS += protected_1 |
1026 | protected_1_SOURCES = \ | |
1027 | protected_main_1.cc protected_main_2.cc protected_main_3.cc | |
1028 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1029 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1030 | protected_1_LDADD = protected_1.so | |
1031 | ||
1032 | protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1033 | $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1034 | protected_1_pic.o: protected_1.cc | |
1035 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1036 | protected_2_pic.o: protected_2.cc | |
1037 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1038 | protected_3_pic.o: protected_3.cc | |
1039 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1040 | ||
1041 | check_PROGRAMS += protected_2 | |
1042 | protected_2_SOURCES = protected_main_1.cc protected_3.cc | |
1043 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1044 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1045 | protected_2_LDADD = protected_1.so | |
1046 | ||
837504c4 ILT |
1047 | check_DATA += protected_3.err |
1048 | MOSTLYCLEANFILES += protected_3.err | |
1049 | protected_4_pic.o: protected_4.cc | |
1050 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1051 | protected_3.err: protected_4_pic.o gcctestdir/ld | |
1052 | @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@" | |
1053 | @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \ | |
1054 | echo 1>&2 "Link of protected_4.so should have failed"; \ | |
1055 | rm -f $@; \ | |
1056 | exit 1; \ | |
1057 | fi | |
1058 | ||
9f1d377b ILT |
1059 | check_PROGRAMS += relro_test |
1060 | relro_test_SOURCES = relro_test_main.cc | |
1061 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so | |
1062 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1063 | relro_test_LDADD = relro_test.so | |
1064 | relro_test.so: gcctestdir/ld relro_test_pic.o | |
1065 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o | |
1066 | relro_test_pic.o: relro_test.cc | |
1067 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1068 | ||
2d924fd9 ILT |
1069 | check_PROGRAMS += relro_script_test |
1070 | relro_script_test_SOURCES = relro_test_main.cc | |
1071 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so | |
1072 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1073 | relro_script_test_LDADD = relro_script_test.so | |
1074 | relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o | |
1075 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o | |
1076 | ||
e5756efb ILT |
1077 | check_PROGRAMS += script_test_1 |
1078 | script_test_1_SOURCES = script_test_1.cc | |
1079 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t | |
1080 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t | |
1abce4a6 | 1081 | script_test_1_LDADD = |
e5756efb | 1082 | |
a445fddf ILT |
1083 | check_PROGRAMS += script_test_2 |
1084 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
1085 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
1086 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t | |
1abce4a6 | 1087 | script_test_2_LDADD = |
a445fddf | 1088 | |
88dd47ac ILT |
1089 | check_PROGRAMS += justsyms |
1090 | justsyms_SOURCES = justsyms_1.cc | |
1091 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
1092 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
1abce4a6 | 1093 | justsyms_LDADD = |
88dd47ac ILT |
1094 | justsyms_2.o: justsyms_2.cc |
1095 | $(CXXCOMPILE) -c -o $@ $< | |
83bfb6b7 | 1096 | justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t |
88dd47ac ILT |
1097 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o |
1098 | ||
bc644c6c | 1099 | check_PROGRAMS += binary_test |
72fef11a | 1100 | MOSTLYCLEANFILES += binary.txt |
bc644c6c ILT |
1101 | binary_test_SOURCES = binary_test.cc |
1102 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
1103 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf | |
1abce4a6 | 1104 | binary_test_LDADD = |
bc644c6c ILT |
1105 | # Copy the file to the build directory to avoid worrying about the |
1106 | # full pathname in the generated symbols. | |
1107 | binary.txt: $(srcdir)/binary.in | |
1108 | rm -f $@ | |
1109 | $(LN_S) $< $@ | |
1110 | ||
09124467 ILT |
1111 | check_SCRIPTS += ver_matching_test.sh |
1112 | check_DATA += ver_matching_test.stdout | |
1113 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
6affe781 | 1114 | ver_matching_def.so: ver_matching_def.cc $(srcdir)/version_script.map gcctestdir/ld |
09124467 ILT |
1115 | $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map |
1116 | ver_matching_test.stdout: ver_matching_def.so | |
6835af53 | 1117 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
1c4f3631 ILT |
1118 | |
1119 | check_PROGRAMS += script_test_3 | |
1120 | check_SCRIPTS += script_test_3.sh | |
1121 | check_DATA += script_test_3.stdout | |
1122 | MOSTLYCLEANFILES += script_test_3.stdout | |
1123 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
1124 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t | |
1125 | script_test_3.stdout: script_test_3 | |
2cefc357 | 1126 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
09124467 | 1127 | |
4ebf39db ILT |
1128 | check_PROGRAMS += tls_phdrs_script_test |
1129 | tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) | |
1130 | tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t | |
1131 | tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t | |
1132 | tls_phdrs_script_test_LDADD = $(tls_test_LDADD) | |
1133 | ||
e6188289 ILT |
1134 | check_SCRIPTS += script_test_4.sh |
1135 | check_DATA += script_test_4.stdout | |
72fef11a | 1136 | MOSTLYCLEANFILES += script_test_4 |
e6188289 ILT |
1137 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t |
1138 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t | |
1139 | script_test_4.stdout: script_test_4 | |
1140 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout | |
1141 | ||
6c93b22c ILT |
1142 | check_PROGRAMS += tls_script_test |
1143 | tls_script_test_SOURCES = $(tls_test_SOURCES) | |
1144 | tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t | |
1145 | tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t | |
1146 | tls_script_test_LDADD = $(tls_test_LDADD) | |
1147 | ||
401a9a73 CC |
1148 | check_SCRIPTS += script_test_5.sh |
1149 | check_DATA += script_test_5.stdout | |
72fef11a | 1150 | MOSTLYCLEANFILES += script_test_5 |
401a9a73 CC |
1151 | script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t |
1152 | $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t | |
1153 | script_test_5.stdout: script_test_5 | |
1154 | $(TEST_READELF) -SW script_test_5 > script_test_5.stdout | |
1155 | ||
3c12dcdb DK |
1156 | check_SCRIPTS += script_test_6.sh |
1157 | check_DATA += script_test_6.stdout | |
1158 | MOSTLYCLEANFILES += script_test_6 | |
1159 | script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t | |
1160 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \ | |
1161 | -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000 | |
1162 | script_test_6.stdout: script_test_6 | |
1163 | $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout | |
1164 | ||
1165 | check_SCRIPTS += script_test_7.sh | |
1166 | check_DATA += script_test_7.stdout | |
1167 | MOSTLYCLEANFILES += script_test_7 | |
1168 | script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1169 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t | |
1170 | script_test_7.stdout: script_test_7 | |
1171 | $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout | |
1172 | ||
1173 | check_SCRIPTS += script_test_8.sh | |
1174 | check_DATA += script_test_8.stdout | |
1175 | MOSTLYCLEANFILES += script_test_8 | |
1176 | script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1177 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \ | |
1178 | -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000 | |
1179 | script_test_8.stdout: script_test_8 | |
1180 | $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout | |
1181 | ||
d103a984 RÁE |
1182 | |
1183 | check_SCRIPTS += script_test_9.sh | |
1184 | check_DATA += script_test_9.stdout | |
1185 | script_test_9.o: script_test_9.cc | |
1186 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
1187 | script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o | |
1188 | $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t | |
1189 | script_test_9.stdout: script_test_9 | |
1190 | $(TEST_READELF) -lW script_test_9 > script_test_9.stdout | |
1191 | ||
1192 | ||
c82fbeee CS |
1193 | # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, |
1194 | # and --dynamic-list-cpp-typeinfo | |
1195 | ||
1196 | check_SCRIPTS += dynamic_list.sh | |
1197 | check_DATA += dynamic_list.stdout | |
72fef11a | 1198 | MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout |
c82fbeee CS |
1199 | dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t |
1200 | $(CXXLINK) -Bgcctestdir/ basic_test.o \ | |
1201 | -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ | |
1202 | -Wl,--dynamic-list-data \ | |
1203 | -Wl,--dynamic-list-cpp-new \ | |
1204 | -Wl,--dynamic-list-cpp-typeinfo | |
1205 | dynamic_list.stdout: dynamic_list | |
94e6ee91 | 1206 | $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout |
c82fbeee | 1207 | |
fbd8a257 | 1208 | check_PROGRAMS += thin_archive_test_1 |
72fef11a CC |
1209 | MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \ |
1210 | alt/thin_archive_test_2.o alt/thin_archive_test_4.o \ | |
1211 | alt/libthin2.a alt/libthin4.a | |
fbd8a257 CC |
1212 | thin_archive_test_1_SOURCES = thin_archive_main.cc |
1213 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a | |
1214 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt | |
1215 | thin_archive_test_1_LDADD = libthin1.a -lthin2 | |
1216 | ||
1217 | check_PROGRAMS += thin_archive_test_2 | |
1218 | thin_archive_test_2_SOURCES = thin_archive_main.cc | |
1219 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a | |
1220 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. | |
1221 | thin_archive_test_2_LDADD = -lthinall | |
1222 | ||
1223 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o | |
1224 | rm -f $@ | |
1225 | $(TEST_AR) crT $@ $^ | |
1226 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o | |
1227 | rm -f $@ | |
1228 | $(TEST_AR) crT $@ $^ | |
1229 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o | |
1230 | rm -f $@ | |
1231 | $(TEST_AR) crT $@ $^ | |
1232 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o | |
1233 | rm -f $@ | |
1234 | $(TEST_AR) crT $@ $^ | |
1235 | libthinall.a: libthin3.a alt/libthin4.a | |
1236 | rm -f $@ | |
1237 | $(TEST_AR) crT $@ $^ | |
1238 | alt/thin_archive_test_2.o: thin_archive_test_2.cc | |
1239 | test -d alt || mkdir -p alt | |
1240 | $(CXXCOMPILE) -c -o $@ $< | |
1241 | alt/thin_archive_test_4.o: thin_archive_test_4.cc | |
1242 | test -d alt || mkdir -p alt | |
1243 | $(CXXCOMPILE) -c -o $@ $< | |
1244 | ||
89fc3421 CC |
1245 | if PLUGINS |
1246 | ||
1247 | check_PROGRAMS += plugin_test_1 | |
1248 | check_SCRIPTS += plugin_test_1.sh | |
1249 | check_DATA += plugin_test_1.err | |
1250 | MOSTLYCLEANFILES += plugin_test_1.err | |
abc8dcba CC |
1251 | 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 |
1252 | $(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 |
1253 | plugin_test_1.err: plugin_test_1 |
1254 | @touch plugin_test_1.err | |
1255 | ||
1256 | check_PROGRAMS += plugin_test_2 | |
1257 | check_SCRIPTS += plugin_test_2.sh | |
1258 | check_DATA += plugin_test_2.err | |
1259 | MOSTLYCLEANFILES += plugin_test_2.err | |
1260 | 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 | |
1261 | $(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 | |
1262 | plugin_test_2.err: plugin_test_2 | |
1263 | @touch plugin_test_2.err | |
1264 | ||
d66a9eb3 CC |
1265 | check_PROGRAMS += plugin_test_3 |
1266 | check_SCRIPTS += plugin_test_3.sh | |
1267 | check_DATA += plugin_test_3.err | |
1268 | MOSTLYCLEANFILES += plugin_test_3.err | |
1269 | 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 | |
1270 | $(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 | |
1271 | plugin_test_3.err: plugin_test_3 | |
1272 | @touch plugin_test_3.err | |
1273 | ||
0f7c0701 CC |
1274 | check_PROGRAMS += plugin_test_4 |
1275 | check_SCRIPTS += plugin_test_4.sh | |
1276 | check_DATA += plugin_test_4.err | |
72fef11a | 1277 | MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err |
0f7c0701 CC |
1278 | plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so |
1279 | $(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 | |
1280 | plugin_test_4.err: plugin_test_4 | |
1281 | @touch plugin_test_4.err | |
1282 | ||
1283 | plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms | |
1284 | $(TEST_AR) cr $@ $^ | |
1285 | ||
24998053 CC |
1286 | check_PROGRAMS += plugin_test_5 |
1287 | 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 | |
1288 | $(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 | |
1289 | ||
be234d88 CC |
1290 | check_PROGRAMS += plugin_test_6 |
1291 | check_SCRIPTS += plugin_test_6.sh | |
1292 | check_DATA += plugin_test_6.err | |
1293 | MOSTLYCLEANFILES += plugin_test_6.err | |
1294 | plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so | |
1295 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err | |
1296 | plugin_test_6.err: plugin_test_6 | |
1297 | @touch plugin_test_6.err | |
1298 | ||
5e0f337e RÁE |
1299 | check_PROGRAMS += plugin_test_7 |
1300 | check_SCRIPTS += plugin_test_7.sh | |
1301 | check_DATA += plugin_test_7.err plugin_test_7.syms | |
1302 | MOSTLYCLEANFILES += plugin_test_7.err | |
1303 | plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so | |
1304 | $(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 | |
1305 | plugin_test_7.syms: plugin_test_7 | |
1306 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1307 | plugin_test_7_1.o: plugin_test_7_1.c | |
1308 | $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1309 | plugin_test_7_1_orig.o: plugin_test_7_1.c | |
1310 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1311 | plugin_test_7_1.syms: plugin_test_7_1_orig.o | |
1312 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1313 | plugin_test_7_2.o: plugin_test_7_2.c | |
1314 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1315 | plugin_test_7.err: plugin_test_7 | |
1316 | ||
f3a2388f CC |
1317 | # Test plugins with -r. |
1318 | check_PROGRAMS += plugin_test_8 | |
1319 | 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 | |
1320 | ../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 | |
1321 | plugin_test_8: plugin_test_8.o gcctestdir/ld | |
1322 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o | |
1323 | ||
1324 | # Test that symbols known in the IR file but not in the replacement file | |
1325 | # produce an unresolved symbol error. | |
1326 | check_DATA += plugin_test_9.err | |
1327 | MOSTLYCLEANFILES += plugin_test_9.err | |
1328 | plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so | |
1329 | @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>$@" | |
1330 | @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 \ | |
1331 | echo 1>&2 "Link of plugin_test_9 should have failed"; \ | |
1332 | rm -f $@; \ | |
1333 | exit 1; \ | |
1334 | fi | |
1335 | # Make a .syms file that claims to define the symbol _Z4t16av. | |
1336 | two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o | |
1337 | cp two_file_test_1.syms $@.tmp | |
1338 | grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp | |
1339 | mv -f $@.tmp $@ | |
1340 | # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. | |
1341 | MOSTLYCLEANFILES += two_file_test_1c.o | |
1342 | two_file_test_1c.o: two_file_test_1.o | |
1343 | cp two_file_test_1.o $@ | |
1344 | ||
89fc3421 CC |
1345 | plugin_test.so: plugin_test.o |
1346 | $(LINK) -Bgcctestdir/ -shared plugin_test.o | |
1347 | plugin_test.o: plugin_test.c | |
1348 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1349 | ||
1350 | two_file_test_main.syms: two_file_test_main.o | |
1351 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1352 | two_file_test_1.syms: two_file_test_1.o | |
1353 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1354 | two_file_test_1b.syms: two_file_test_1b.o | |
1355 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1356 | two_file_test_2.syms: two_file_test_2.o | |
1357 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
be234d88 CC |
1358 | plugin_common_test_1.syms: plugin_common_test_1.o |
1359 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1360 | plugin_common_test_2.syms: plugin_common_test_2.o | |
1361 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
24998053 | 1362 | |
abc8dcba | 1363 | empty.syms: |
24998053 CC |
1364 | @echo "" >$@ |
1365 | @echo "Symbol table" >>$@ | |
1366 | ||
1367 | MOSTLYCLEANFILES += unused.c | |
1368 | unused.syms: unused.o | |
1369 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1370 | @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ | |
1371 | unused.o: unused.c | |
1372 | $(COMPILE) -c -o $@ $< | |
1373 | unused.c: | |
1374 | @cp /dev/null $@ | |
89fc3421 CC |
1375 | |
1376 | endif PLUGINS | |
1377 | ||
65514900 CC |
1378 | check_PROGRAMS += exclude_libs_test |
1379 | check_SCRIPTS += exclude_libs_test.sh | |
1380 | check_DATA += exclude_libs_test.syms | |
1381 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ | |
2fdd743f | 1382 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
65514900 CC |
1383 | exclude_libs_test_SOURCES = exclude_libs_test.c |
1384 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ | |
2fdd743f DK |
1385 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
1386 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ | |
1387 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ | |
1388 | -Wl,--exclude-libs,libexclude_libs_test_3 | |
1389 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ | |
1390 | alt/libexclude_libs_test_3.a | |
65514900 CC |
1391 | exclude_libs_test.syms: exclude_libs_test |
1392 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1393 | libexclude_libs_test_1.a: exclude_libs_test_1.o | |
1394 | $(TEST_AR) rc $@ $^ | |
1395 | libexclude_libs_test_2.a: exclude_libs_test_2.o | |
1396 | $(TEST_AR) rc $@ $^ | |
2fdd743f DK |
1397 | alt/libexclude_libs_test_3.a: exclude_libs_test_3.o |
1398 | test -d alt || mkdir -p alt | |
1399 | $(TEST_AR) rc $@ $^ | |
65514900 | 1400 | |
805bb01c DK |
1401 | check_PROGRAMS += local_labels_test |
1402 | local_labels_test.o: ver_test_6.c | |
1403 | $(COMPILE) -g -c -Wa,-L -o $@ $< | |
1404 | local_labels_test: local_labels_test.o | |
1405 | $(LINK) -Bgcctestdir/ local_labels_test.o | |
1406 | ||
bb04269c DK |
1407 | check_PROGRAMS += discard_locals_test |
1408 | check_SCRIPTS += discard_locals_test.sh | |
d3bbad62 ILT |
1409 | check_DATA += discard_locals_test.syms \ |
1410 | discard_locals_relocatable_test1.syms \ | |
1411 | discard_locals_relocatable_test2.syms | |
1412 | MOSTLYCLEANFILES += discard_locals_test.syms \ | |
1413 | discard_locals_relocatable_test1.syms \ | |
1414 | discard_locals_relocatable_test2.syms \ | |
1415 | discard_locals_relocatable_test1.out \ | |
1416 | discard_locals_relocatable_test2.out | |
bb04269c DK |
1417 | discard_locals_test_SOURCES = discard_locals_test.c |
1418 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals | |
1419 | discard_locals_test.syms: discard_locals_test | |
1420 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1421 | # '-Wa,-L' is required to preserve the local label used for testing. | |
1422 | discard_locals_test.o: discard_locals_test.c | |
1423 | $(COMPILE) -c -Wa,-L -o $@ $< | |
1424 | ||
d3bbad62 ILT |
1425 | discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out |
1426 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1427 | discard_locals_relocatable_test.o: discard_locals_relocatable_test.c | |
1428 | $(COMPILE) -c -Wa,-L -fPIC -o $@ $< | |
1429 | discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new | |
1430 | ../ld-new --discard-locals -relocatable -o $@ $< | |
1431 | ||
1432 | discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out | |
1433 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1434 | discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new | |
1435 | ../ld-new --discard-all -relocatable -o $@ $< | |
1436 | ||
8a5e3e08 ILT |
1437 | if MCMODEL_MEDIUM |
1438 | check_PROGRAMS += large | |
1439 | large_SOURCES = large.c | |
1440 | large_CFLAGS = -mcmodel=medium | |
1441 | large_DEPENDENCIES = gcctestdir/ld | |
1442 | large_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 1443 | large_LDADD = |
8a5e3e08 ILT |
1444 | endif MCMODEL_MEDIUM |
1445 | ||
645afe0c CC |
1446 | # Test that hidden and internal symbols in the main program cannot be |
1447 | # referenced by a shared library. | |
1448 | check_SCRIPTS += hidden_test.sh | |
1449 | check_DATA += hidden_test.err | |
1450 | MOSTLYCLEANFILES += hidden_test hidden_test.err | |
1451 | libhidden.so: hidden_test_1.c gcctestdir/ld | |
1452 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c | |
1453 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld | |
1454 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err | |
1455 | hidden_test.err: hidden_test | |
1456 | @touch hidden_test.err | |
1457 | ||
8c604651 CS |
1458 | # Test -retain-symbols-file. |
1459 | check_SCRIPTS += retain_symbols_file_test.sh | |
1460 | check_DATA += retain_symbols_file_test.stdout | |
1461 | MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \ | |
1462 | retain_symbols_file_test.stdout | |
1463 | retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld | |
1464 | echo 'main' > retain_symbols_file_test.in | |
1465 | echo 't1' >> retain_symbols_file_test.in | |
1466 | echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in | |
1467 | echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in | |
1468 | echo '_Z3t18v' >> retain_symbols_file_test.in | |
1469 | echo '__tcf_0' >> retain_symbols_file_test.in | |
1470 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o | |
1471 | retain_symbols_file_test.stdout: retain_symbols_file_test.so | |
1472 | $(TEST_NM) -C retain_symbols_file_test.so > $@ | |
1473 | ||
1474 | ||
6a89f575 CC |
1475 | # Test that if the output file already exists and is empty, |
1476 | # it will get execute permission. | |
1477 | check_PROGRAMS += permission_test | |
1478 | permission_test: basic_test.o gcctestdir/ld | |
1479 | umask 022; \ | |
1480 | rm -f $@; \ | |
1481 | touch $@; \ | |
1482 | chmod 600 $@; \ | |
1483 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
1484 | ||
ae3b5189 CD |
1485 | # Check -l:foo.a |
1486 | check_PROGRAMS += searched_file_test | |
1487 | MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \ | |
1488 | alt/searched_file_test_lib.a | |
1489 | searched_file_test_SOURCES = searched_file_test.cc | |
1490 | searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a | |
1491 | searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt | |
1492 | searched_file_test_LDADD = -l:searched_file_test_lib.a | |
1493 | searched_file_test_lib.o: searched_file_test_lib.cc | |
1494 | $(CXXCOMPILE) -c -o $@ $< | |
1495 | alt/searched_file_test_lib.a: searched_file_test_lib.o | |
1496 | test -d alt || mkdir -p alt | |
1497 | $(TEST_AR) rc $@ $^ | |
1498 | ||
c5617f2f DK |
1499 | # Test that no .gnu.version sections are created when |
1500 | # symbol versioning is not used. | |
1501 | check_SCRIPTS += no_version_test.sh | |
1502 | check_DATA += no_version_test.stdout | |
1503 | MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout | |
1504 | # We invoke the linker directly since gcc may include additional objects that | |
1505 | # uses symbol versioning. | |
1506 | libno_version_test.so: no_version_test.o gcctestdir/ld | |
1507 | gcctestdir/ld -shared -o $@ no_version_test.o | |
1508 | no_version_test.o: no_version_test.c | |
1509 | $(COMPILE) -o $@ -c -fPIC $< | |
1510 | no_version_test.stdout: libno_version_test.so | |
1511 | $(TEST_OBJDUMP) -h $< > $@ | |
1512 | ||
351a8000 ILT |
1513 | endif GCC |
1514 | endif NATIVE_LINKER | |
364c7fa5 ILT |
1515 | |
1516 | # These tests work with cross linkers. | |
1517 | ||
1518 | if DEFAULT_TARGET_I386 | |
1519 | ||
1520 | check_SCRIPTS += split_i386.sh | |
1521 | check_DATA += split_i386_1.stdout split_i386_2.stdout \ | |
1522 | split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout | |
1523 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
1524 | split_i386_1.o: split_i386_1.s | |
1525 | $(TEST_AS) -o $@ $< | |
1526 | split_i386_2.o: split_i386_2.s | |
1527 | $(TEST_AS) -o $@ $< | |
1528 | split_i386_3.o: split_i386_3.s | |
1529 | $(TEST_AS) -o $@ $< | |
1530 | split_i386_4.o: split_i386_4.s | |
1531 | $(TEST_AS) -o $@ $< | |
1532 | split_i386_n.o: split_i386_n.s | |
1533 | $(TEST_AS) -o $@ $< | |
1534 | split_i386_1: split_i386_1.o split_i386_n.o ../ld-new | |
1535 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o | |
1536 | split_i386_1.stdout: split_i386_1 | |
1537 | $(TEST_OBJDUMP) -d $< > $@ | |
1538 | split_i386_2: split_i386_2.o split_i386_n.o ../ld-new | |
1539 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o | |
1540 | split_i386_2.stdout: split_i386_2 | |
1541 | $(TEST_OBJDUMP) -d $< > $@ | |
1542 | split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new | |
1543 | ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0 | |
1544 | split_i386_4: split_i386_4.o split_i386_n.o ../ld-new | |
1545 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o | |
1546 | split_i386_4.stdout: split_i386_4 | |
1547 | $(TEST_OBJDUMP) -d $< > $@ | |
1548 | split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new | |
1549 | ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0 | |
1550 | MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \ | |
1551 | split_i386_4 split_i386_r | |
1552 | ||
1553 | endif DEFAULT_TARGET_I386 | |
1554 | ||
1555 | if DEFAULT_TARGET_X86_64 | |
1556 | ||
1557 | check_SCRIPTS += split_x86_64.sh | |
1558 | check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \ | |
1559 | split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout | |
1560 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
1561 | split_x86_64_1.o: split_x86_64_1.s | |
1562 | $(TEST_AS) -o $@ $< | |
1563 | split_x86_64_2.o: split_x86_64_2.s | |
1564 | $(TEST_AS) -o $@ $< | |
1565 | split_x86_64_3.o: split_x86_64_3.s | |
1566 | $(TEST_AS) -o $@ $< | |
1567 | split_x86_64_4.o: split_x86_64_4.s | |
1568 | $(TEST_AS) -o $@ $< | |
1569 | split_x86_64_n.o: split_x86_64_n.s | |
1570 | $(TEST_AS) -o $@ $< | |
1571 | split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
1572 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o | |
1573 | split_x86_64_1.stdout: split_x86_64_1 | |
1574 | $(TEST_OBJDUMP) -d $< > $@ | |
1575 | split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new | |
1576 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o | |
1577 | split_x86_64_2.stdout: split_x86_64_2 | |
1578 | $(TEST_OBJDUMP) -d $< > $@ | |
1579 | split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new | |
1580 | ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0 | |
1581 | split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new | |
1582 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o | |
1583 | split_x86_64_4.stdout: split_x86_64_4 | |
1584 | $(TEST_OBJDUMP) -d $< > $@ | |
1585 | split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
1586 | ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 | |
1587 | MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ | |
1588 | split_x86_64_4 split_x86_64_r | |
1589 | ||
1590 | endif DEFAULT_TARGET_X86_64 | |
e4782e83 DK |
1591 | |
1592 | if DEFAULT_TARGET_ARM | |
1593 | ||
1594 | check_SCRIPTS += arm_abs_global.sh | |
1595 | check_DATA += arm_abs_global.stdout | |
1596 | arm_abs_lib.o: arm_abs_lib.s | |
1597 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 1598 | libarm_abs.so: arm_abs_lib.o ../ld-new |
e4782e83 DK |
1599 | ../ld-new -shared -o $@ arm_abs_lib.o |
1600 | arm_abs_global.o: arm_abs_global.s | |
1601 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 1602 | arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new |
e4782e83 DK |
1603 | ../ld-new -o $@ arm_abs_global.o -L. -larm_abs |
1604 | arm_abs_global.stdout: arm_abs_global | |
1605 | $(TEST_READELF) -r $< > $@ | |
1606 | ||
1607 | MOSTLYCLEANFILES += arm_abs_global | |
1608 | ||
2a2b6d42 DK |
1609 | check_SCRIPTS += arm_branch_in_range.sh |
1610 | check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \ | |
1611 | thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \ | |
a2c7281b DK |
1612 | thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \ |
1613 | thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \ | |
1614 | thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout | |
2a2b6d42 DK |
1615 | |
1616 | arm_bl_in_range.stdout: arm_bl_in_range | |
1617 | $(TEST_OBJDUMP) -D $< > $@ | |
1618 | ||
d3bbad62 | 1619 | arm_bl_in_range: arm_bl_in_range.o ../ld-new |
2a2b6d42 DK |
1620 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
1621 | ||
1622 | arm_bl_in_range.o: arm_bl_in_range.s | |
1623 | $(TEST_AS) -o $@ $< | |
1624 | ||
1625 | arm_bl_out_of_range.stdout: arm_bl_out_of_range | |
1626 | $(TEST_OBJDUMP) -S $< > $@ | |
1627 | ||
d3bbad62 | 1628 | arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
1629 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
1630 | ||
1631 | arm_bl_out_of_range.o: arm_bl_out_of_range.s | |
1632 | $(TEST_AS) -o $@ $< | |
1633 | ||
1634 | thumb_bl_in_range.stdout: thumb_bl_in_range | |
1635 | $(TEST_OBJDUMP) -D $< > $@ | |
1636 | ||
d3bbad62 | 1637 | thumb_bl_in_range: thumb_bl_in_range.o ../ld-new |
2a2b6d42 DK |
1638 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
1639 | ||
1640 | thumb_bl_in_range.o: thumb_bl_in_range.s | |
1641 | $(TEST_AS) -o $@ -march=armv5te $< | |
1642 | ||
1643 | thumb_bl_out_of_range.stdout: thumb_bl_out_of_range | |
1644 | $(TEST_OBJDUMP) -D $< > $@ | |
1645 | ||
a2c7281b | 1646 | thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
1647 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
1648 | ||
a2c7281b | 1649 | thumb_bl_out_of_range.o: thumb_bl_out_of_range.s |
2a2b6d42 DK |
1650 | $(TEST_AS) -o $@ -march=armv5te $< |
1651 | ||
1652 | thumb2_bl_in_range.stdout: thumb2_bl_in_range | |
1653 | $(TEST_OBJDUMP) -D $< > $@ | |
1654 | ||
d3bbad62 | 1655 | thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new |
2a2b6d42 DK |
1656 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
1657 | ||
1658 | thumb2_bl_in_range.o: thumb_bl_in_range.s | |
1659 | $(TEST_AS) -o $@ -march=armv7-a $< | |
1660 | ||
1661 | thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range | |
1662 | $(TEST_OBJDUMP) -D $< > $@ | |
1663 | ||
a2c7281b | 1664 | thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
1665 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
1666 | ||
a2c7281b DK |
1667 | thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s |
1668 | $(TEST_AS) -o $@ -march=armv7-a $< | |
1669 | ||
1670 | thumb_blx_in_range.stdout: thumb_blx_in_range | |
1671 | $(TEST_OBJDUMP) -D $< > $@ | |
1672 | ||
1673 | thumb_blx_in_range: thumb_blx_in_range.o ../ld-new | |
1674 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< | |
1675 | ||
1676 | thumb_blx_in_range.o: thumb_blx_in_range.s | |
1677 | $(TEST_AS) -o $@ -march=armv5te $< | |
1678 | ||
1679 | thumb_blx_out_of_range.stdout: thumb_blx_out_of_range | |
1680 | $(TEST_OBJDUMP) -D $< > $@ | |
1681 | ||
1682 | thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new | |
1683 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< | |
1684 | ||
1685 | thumb_blx_out_of_range.o: thumb_blx_out_of_range.s | |
1686 | $(TEST_AS) -o $@ -march=armv5te $< | |
1687 | ||
1688 | thumb2_blx_in_range.stdout: thumb2_blx_in_range | |
1689 | $(TEST_OBJDUMP) -D $< > $@ | |
1690 | ||
1691 | thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new | |
1692 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
1693 | ||
1694 | thumb2_blx_in_range.o: thumb_blx_in_range.s | |
1695 | $(TEST_AS) -o $@ -march=armv7-a $< | |
1696 | ||
1697 | thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range | |
1698 | $(TEST_OBJDUMP) -D $< > $@ | |
1699 | ||
1700 | thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new | |
1701 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
1702 | ||
1703 | thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2a2b6d42 DK |
1704 | $(TEST_AS) -o $@ -march=armv7-a $< |
1705 | ||
1706 | MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \ | |
a2c7281b DK |
1707 | thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \ |
1708 | thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \ | |
1709 | thumb2_blx_out_of_range | |
2a2b6d42 | 1710 | |
2fd9ae7a DK |
1711 | check_SCRIPTS += arm_fix_v4bx.sh |
1712 | check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \ | |
1713 | arm_no_fix_v4bx.stdout | |
1714 | ||
1715 | arm_fix_v4bx.stdout: arm_fix_v4bx | |
1716 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
1717 | ||
d3bbad62 | 1718 | arm_fix_v4bx: arm_fix_v4bx.o ../ld-new |
2fd9ae7a DK |
1719 | ../ld-new --fix-v4bx -o $@ $< |
1720 | ||
1721 | arm_fix_v4bx.o: arm_fix_v4bx.s | |
1722 | $(TEST_AS) -o $@ $< | |
1723 | ||
1724 | arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking | |
1725 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
1726 | ||
d3bbad62 | 1727 | arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new |
2fd9ae7a DK |
1728 | ../ld-new --fix-v4bx-interworking -o $@ $< |
1729 | ||
1730 | arm_no_fix_v4bx.stdout: arm_no_fix_v4bx | |
1731 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
1732 | ||
d3bbad62 | 1733 | arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new |
2fd9ae7a DK |
1734 | ../ld-new -o $@ $< |
1735 | ||
1736 | MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx | |
1737 | ||
da59ad79 DK |
1738 | check_SCRIPTS += arm_attr_merge.sh |
1739 | check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \ | |
1740 | arm_attr_merge_7.stdout | |
1741 | ||
1742 | arm_attr_merge_6.stdout: arm_attr_merge_6 | |
1743 | $(TEST_READELF) -A $< > $@ | |
1744 | ||
1745 | arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o | |
1746 | ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o | |
1747 | ||
1748 | arm_attr_merge_6a.o: arm_attr_merge_6a.s | |
1749 | $(TEST_AS) -o $@ $< | |
1750 | ||
1751 | arm_attr_merge_6b.o: arm_attr_merge_6b.s | |
1752 | $(TEST_AS) -o $@ $< | |
1753 | ||
1754 | arm_attr_merge_6r.stdout: arm_attr_merge_6r | |
1755 | $(TEST_READELF) -A $< > $@ | |
1756 | ||
1757 | arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o | |
1758 | ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o | |
1759 | ||
1760 | arm_attr_merge_7.stdout: arm_attr_merge_7 | |
1761 | $(TEST_READELF) -A $< > $@ | |
1762 | ||
1763 | arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o | |
1764 | ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o | |
1765 | ||
1766 | arm_attr_merge_7a.o: arm_attr_merge_7a.s | |
1767 | $(TEST_AS) -o $@ $< | |
1768 | ||
1769 | arm_attr_merge_7b.o: arm_attr_merge_7b.s | |
1770 | $(TEST_AS) -o $@ $< | |
1771 | ||
1772 | MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7 | |
1773 | ||
e4782e83 | 1774 | endif DEFAULT_TARGET_ARM |