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