]>
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 | ||
aa543512 L |
22 | # COMPILE1, LINK1, CXXCOMPILE1, CXXLINK1 are renamed from COMPILE, LINK, |
23 | # CXXCOMPILE and CXXLINK generated by automake 1.11.1. FIXME: they should | |
24 | # be updated if they are different from automake used by gold. | |
25 | COMPILE1 = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | |
26 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | |
27 | LINK1 = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ | |
28 | CXXCOMPILE1 = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ | |
29 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) | |
30 | CXXLINK1 = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ | |
31 | -o $@ | |
32 | ||
33 | # Strip out -Wp,-D_FORTIFY_SOURCE=, which is rrelevant for the gold | |
34 | # testsuite and incompatible with -O0 used in gold tests, from | |
35 | # COMPILE, LINK, CXXCOMPILE and CXXLINK. | |
36 | COMPILE = `echo $(COMPILE1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9[0-9]]*//'` | |
37 | LINK = `echo $(LINK1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'` | |
38 | CXXCOMPILE = `echo $(CXXCOMPILE1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'` | |
39 | CXXLINK = `echo $(CXXLINK1) | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'` | |
40 | ||
3d587466 CC |
41 | # Strip out -static-libgcc and -static-libstdc++ options, for tests |
42 | # that must have these libraries linked dynamically. The -shared-libgcc | |
43 | # option does not work correctly, and there is no -shared-libstdc++ option. | |
44 | # (See GCC PR 55781 and PR 55782.) | |
45 | CXXLINK_S = `echo $(CXXLINK1) | sed -e 's/-static-lib\\(gcc\\|stdc++\\)//g'` | |
46 | ||
6835af53 ILT |
47 | TEST_READELF = $(top_builddir)/../binutils/readelf |
48 | TEST_OBJDUMP = $(top_builddir)/../binutils/objdump | |
35c813e2 | 49 | TEST_OBJCOPY = $(top_builddir)/../binutils/objcopy |
6835af53 ILT |
50 | TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt |
51 | TEST_STRIP = $(top_builddir)/../binutils/strip-new | |
fbd8a257 | 52 | TEST_AR = $(top_builddir)/../binutils/ar |
531813ad | 53 | TEST_NM = $(top_builddir)/../binutils/nm-new |
364c7fa5 | 54 | TEST_AS = $(top_builddir)/../gas/as-new |
6835af53 | 55 | |
89fc3421 CC |
56 | if PLUGINS |
57 | LIBDL = -ldl | |
58 | endif | |
59 | ||
fe9a4c12 ILT |
60 | if THREADS |
61 | THREADSLIB = -lpthread | |
62 | endif | |
63 | ||
155a0dd7 ILT |
64 | if OMP_SUPPORT |
65 | TLS_TEST_C_CFLAGS = -fopenmp | |
66 | endif | |
67 | ||
351a8000 ILT |
68 | # 'make clean' is good about deleting some intermediate files (such as |
69 | # .o's), but not all of them (such as .so's and .err files). We | |
70 | # improve on that here. automake-1.9 info docs say "mostlyclean" is | |
71 | # the right choice for files 'make' builds that people rebuild. | |
72fef11a | 72 | MOSTLYCLEANFILES = *.so *.syms *.stdout |
6eee141f | 73 | |
6eee141f | 74 | |
351a8000 ILT |
75 | # We will add to these later, for each individual test. Note |
76 | # that we add each test under check_SCRIPTS or check_PROGRAMS; | |
77 | # the TESTS variable is automatically populated from these. | |
78 | check_SCRIPTS = | |
79 | check_DATA = | |
80 | check_PROGRAMS = | |
d491d34e ILT |
81 | BUILT_SOURCES = |
82 | ||
351a8000 | 83 | TESTS = $(check_SCRIPTS) $(check_PROGRAMS) |
22dc1b09 | 84 | |
351a8000 ILT |
85 | # --------------------------------------------------------------------- |
86 | # These tests test the internals of gold (unittests). | |
5a6f7e2d | 87 | |
351a8000 | 88 | # Infrastucture needed for the unittests |
5a6f7e2d ILT |
89 | check_LIBRARIES = libgoldtest.a |
90 | libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc | |
91 | ||
ad2d6943 ILT |
92 | DEPENDENCIES = \ |
93 | libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP) | |
fe9a4c12 | 94 | LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ |
89fc3421 | 95 | $(THREADSLIB) $(LIBDL) |
5a6f7e2d | 96 | |
5a6f7e2d | 97 | |
351a8000 | 98 | # The unittests themselves |
eb373049 | 99 | if NATIVE_OR_CROSS_LINKER |
90e24de5 ILT |
100 | if GCC |
101 | ||
102 | # Infrastucture needed for the unittests: a directory where the linker | |
103 | # is named 'ld'. This is because the -B flag appends 'ld' to its arg. | |
104 | gcctestdir/ld: ../ld-new | |
105 | test -d gcctestdir || mkdir -p gcctestdir | |
106 | rm -f gcctestdir/ld | |
107 | (cd gcctestdir && $(LN_S) ../../ld-new ld) | |
108 | ||
472076e4 CC |
109 | # Some tests require the latest features of an in-tree assembler. |
110 | gcctestdir/as: $(TEST_AS) | |
111 | test -d gcctestdir || mkdir -p gcctestdir | |
112 | rm -f gcctestdir/as | |
113 | (cd gcctestdir && $(LN_S) $(abs_top_builddir)/../gas/as-new as) | |
114 | ||
90e24de5 ILT |
115 | endif GCC |
116 | ||
351a8000 | 117 | check_PROGRAMS += object_unittest |
5a6f7e2d | 118 | object_unittest_SOURCES = object_unittest.cc |
22dc1b09 | 119 | |
bc644c6c ILT |
120 | check_PROGRAMS += binary_unittest |
121 | binary_unittest_SOURCES = binary_unittest.cc | |
122 | ||
c2c7840a CC |
123 | check_PROGRAMS += leb128_unittest |
124 | leb128_unittest_SOURCES = leb128_unittest.cc | |
125 | ||
eb373049 | 126 | endif NATIVE_OR_CROSS_LINKER |
351a8000 ILT |
127 | |
128 | # --------------------------------------------------------------------- | |
129 | # These tests test the output of gold (end-to-end tests). In | |
130 | # particular, they make sure that gold can link "difficult" object | |
131 | # files, and the resulting object files run correctly. These can only | |
132 | # run if we've built ld-new for the native architecture (that is, | |
133 | # we're not cross-compiling it), since we run ld-new as part of these | |
134 | # tests. We use the gcc-specific flag '-B' to use our linker instead | |
135 | # of the default linker, which is why we only run our tests under gcc. | |
a360aedd | 136 | |
e2827e5f | 137 | if NATIVE_LINKER |
351a8000 | 138 | if GCC |
e2827e5f | 139 | |
351a8000 ILT |
140 | # Each of these .o's is a useful, small complete program. They're |
141 | # particularly useful for making sure ld-new's flags do what they're | |
142 | # supposed to (hence their names), but are used for many tests that | |
143 | # don't actually involve analyzing input data. | |
43771f76 ILT |
144 | flagstest_debug.o: constructor_test.cc |
145 | $(CXXCOMPILE) -O0 -g -c -o $@ $< | |
146 | flagstest_ndebug.o: constructor_test.cc | |
147 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
148 | ||
325e6408 RÁE |
149 | check_SCRIPTS += incremental_test.sh |
150 | check_DATA += incremental_test.stdout | |
151 | MOSTLYCLEANFILES += incremental_test | |
152 | incremental_test_1.o: incremental_test_1.c | |
153 | $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
154 | incremental_test_2.o: incremental_test_2.c | |
155 | $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
156 | incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld | |
8c21d9d3 | 157 | $(LINK) -Bgcctestdir/ -Wl,--incremental-full incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline |
325e6408 RÁE |
158 | incremental_test.stdout: incremental_test ../incremental-dump |
159 | ../incremental-dump incremental_test > $@ | |
43771f76 | 160 | |
531813ad ST |
161 | check_SCRIPTS += gc_comdat_test.sh |
162 | check_DATA += gc_comdat_test.stdout | |
72fef11a | 163 | MOSTLYCLEANFILES += gc_comdat_test |
531813ad | 164 | gc_comdat_test_1.o: gc_comdat_test_1.cc |
4daadc0d | 165 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
531813ad | 166 | gc_comdat_test_2.o: gc_comdat_test_2.cc |
4daadc0d | 167 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
531813ad | 168 | gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld |
4daadc0d | 169 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o |
531813ad ST |
170 | gc_comdat_test.stdout: gc_comdat_test |
171 | $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout | |
172 | ||
27721062 ST |
173 | check_SCRIPTS += gc_tls_test.sh |
174 | check_DATA += gc_tls_test.stdout | |
72fef11a | 175 | MOSTLYCLEANFILES += gc_tls_test |
27721062 ST |
176 | gc_tls_test.o: gc_tls_test.cc |
177 | $(CXXCOMPILE) -O0 -c -g -o $@ $< | |
178 | gc_tls_test:gc_tls_test.o gcctestdir/ld | |
179 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o | |
180 | gc_tls_test.stdout: gc_tls_test | |
181 | $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout | |
182 | ||
f1ec9ded ST |
183 | check_SCRIPTS += gc_orphan_section_test.sh |
184 | check_DATA += gc_orphan_section_test.stdout | |
185 | MOSTLYCLEANFILES += gc_orphan_section_test | |
186 | gc_orphan_section_test.o: gc_orphan_section_test.cc | |
187 | $(CXXCOMPILE) -O0 -c -g -o $@ $< | |
188 | gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld | |
189 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o | |
190 | gc_orphan_section_test.stdout: gc_orphan_section_test | |
191 | $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout | |
192 | ||
b9b2ae8b NC |
193 | check_SCRIPTS += pr14265.sh |
194 | check_DATA += pr14265.stdout | |
195 | MOSTLYCLEANFILES += pr14265 | |
196 | pr14265.o: pr14265.c | |
197 | $(COMPILE) -O0 -c -o $@ $< | |
198 | pr14265: pr14265.o | |
199 | $(LINK) -Bgcctestdir/ -Wl,--gc-sections -T $(srcdir)/pr14265.t -o $@ $< | |
200 | pr14265.stdout: pr14265 | |
201 | $(TEST_NM) --format=bsd --numeric-sort $< > $@ | |
202 | ||
ef15dade ST |
203 | check_SCRIPTS += icf_test.sh |
204 | check_DATA += icf_test.stdout | |
72fef11a | 205 | MOSTLYCLEANFILES += icf_test |
ef15dade ST |
206 | icf_test.o: icf_test.cc |
207 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
208 | icf_test: icf_test.o gcctestdir/ld | |
032ce4e9 | 209 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_test.o |
ef15dade ST |
210 | icf_test.stdout: icf_test |
211 | $(TEST_NM) -C icf_test > icf_test.stdout | |
212 | ||
48c187ce ST |
213 | check_SCRIPTS += icf_keep_unique_test.sh |
214 | check_DATA += icf_keep_unique_test.stdout | |
72fef11a | 215 | MOSTLYCLEANFILES += icf_keep_unique_test |
48c187ce ST |
216 | icf_keep_unique_test.o: icf_keep_unique_test.cc |
217 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
218 | icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld | |
032ce4e9 | 219 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o |
48c187ce ST |
220 | icf_keep_unique_test.stdout: icf_keep_unique_test |
221 | $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout | |
531813ad | 222 | |
032ce4e9 | 223 | check_SCRIPTS += icf_safe_test.sh |
21bb3914 | 224 | check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout |
032ce4e9 | 225 | MOSTLYCLEANFILES += icf_safe_test |
21bb3914 | 226 | icf_safe_test.o: icf_safe_test.cc |
032ce4e9 ST |
227 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
228 | icf_safe_test: icf_safe_test.o gcctestdir/ld | |
229 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_test.o | |
21bb3914 ST |
230 | icf_safe_test_1.stdout: icf_safe_test |
231 | $(TEST_NM) icf_safe_test > icf_safe_test_1.stdout | |
232 | icf_safe_test_2.stdout: icf_safe_test | |
233 | $(TEST_READELF) -h icf_safe_test > icf_safe_test_2.stdout | |
234 | ||
235 | check_SCRIPTS += icf_safe_so_test.sh | |
236 | check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout | |
237 | MOSTLYCLEANFILES += icf_safe_so_test | |
238 | icf_safe_so_test.o: icf_safe_so_test.cc | |
239 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
240 | icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld | |
241 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_so_test.o -fPIC -shared | |
242 | icf_safe_so_test_1.stdout: icf_safe_so_test | |
243 | $(TEST_NM) icf_safe_so_test > icf_safe_so_test_1.stdout | |
244 | icf_safe_so_test_2.stdout: icf_safe_so_test | |
245 | $(TEST_READELF) -h icf_safe_so_test > icf_safe_so_test_2.stdout | |
032ce4e9 | 246 | |
6e9ba2ca ST |
247 | check_SCRIPTS += final_layout.sh |
248 | check_DATA += final_layout.stdout | |
9e9143bc | 249 | MOSTLYCLEANFILES += final_layout final_layout_sequence.txt final_layout_script.lds |
6e9ba2ca ST |
250 | final_layout.o: final_layout.cc |
251 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< | |
252 | final_layout_sequence.txt: | |
253 | (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt | |
9e9143bc ST |
254 | final_layout_script.lds: |
255 | (echo "SECTIONS { .text : { *(.text*) } .bss : { *(.bss*) } }") > final_layout_script.lds | |
256 | final_layout: final_layout.o final_layout_sequence.txt final_layout_script.lds gcctestdir/ld | |
257 | $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt -Wl,-T,final_layout_script.lds final_layout.o | |
6e9ba2ca | 258 | final_layout.stdout: final_layout |
864a1b56 | 259 | $(TEST_NM) -n --synthetic final_layout > final_layout.stdout |
6e9ba2ca | 260 | |
28f2a4ac ST |
261 | check_SCRIPTS += text_section_grouping.sh |
262 | check_DATA += text_section_grouping.stdout | |
263 | MOSTLYCLEANFILES += text_section_grouping | |
264 | text_section_grouping.o: text_section_grouping.cc | |
265 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
266 | text_section_grouping: text_section_grouping.o gcctestdir/ld | |
267 | $(CXXLINK) -Bgcctestdir/ text_section_grouping.o | |
268 | text_section_grouping.stdout: text_section_grouping | |
269 | $(TEST_NM) -n --synthetic text_section_grouping > text_section_grouping.stdout | |
270 | ||
2253bfba | 271 | check_PROGRAMS += icf_virtual_function_folding_test |
ce97fa81 ST |
272 | MOSTLYCLEANFILES += icf_virtual_function_folding_test |
273 | icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc | |
274 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $< | |
275 | icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld | |
276 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie | |
277 | ||
278 | check_SCRIPTS += icf_preemptible_functions_test.sh | |
279 | check_DATA += icf_preemptible_functions_test.stdout | |
280 | MOSTLYCLEANFILES += icf_preemptible_functions_test | |
281 | icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc | |
282 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
283 | icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld | |
284 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared | |
285 | icf_preemptible_functions_test.stdout: icf_preemptible_functions_test | |
286 | $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout | |
287 | ||
288 | check_SCRIPTS += icf_string_merge_test.sh | |
289 | check_DATA += icf_string_merge_test.stdout | |
290 | MOSTLYCLEANFILES += icf_string_merge_test | |
291 | icf_string_merge_test.o: icf_string_merge_test.cc | |
292 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
293 | icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld | |
294 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o | |
295 | icf_string_merge_test.stdout: icf_string_merge_test | |
296 | $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout | |
297 | ||
41cbeecc ST |
298 | check_SCRIPTS += icf_sht_rel_addend_test.sh |
299 | check_DATA += icf_sht_rel_addend_test.stdout | |
300 | MOSTLYCLEANFILES += icf_sht_rel_addend_test | |
301 | icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc | |
302 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
303 | icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc | |
304 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
305 | icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld | |
306 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o | |
307 | icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test | |
308 | $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout | |
309 | ||
351a8000 | 310 | check_PROGRAMS += basic_test |
351a8000 | 311 | check_PROGRAMS += basic_pic_test |
56ba9a23 | 312 | basic_test.o: basic_test.cc |
22dc1b09 | 313 | $(CXXCOMPILE) -O0 -c -o $@ $< |
56ba9a23 ILT |
314 | basic_test: basic_test.o gcctestdir/ld |
315 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
328c7c2f ILT |
316 | |
317 | if HAVE_STATIC | |
318 | check_PROGRAMS += basic_static_test | |
56ba9a23 ILT |
319 | basic_static_test: basic_test.o gcctestdir/ld |
320 | $(CXXLINK) -Bgcctestdir/ -static basic_test.o | |
328c7c2f | 321 | endif |
22dc1b09 | 322 | |
56ba9a23 | 323 | basic_pic_test.o: basic_test.cc |
22dc1b09 | 324 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
56ba9a23 ILT |
325 | basic_pic_test: basic_pic_test.o gcctestdir/ld |
326 | $(CXXLINK) -Bgcctestdir/ basic_pic_test.o | |
328c7c2f ILT |
327 | |
328 | if HAVE_STATIC | |
329 | check_PROGRAMS += basic_static_pic_test | |
56ba9a23 ILT |
330 | basic_static_pic_test: basic_pic_test.o gcctestdir/ld |
331 | $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o | |
328c7c2f | 332 | endif |
22dc1b09 | 333 | |
374ad285 ILT |
334 | check_PROGRAMS += basic_pie_test |
335 | basic_pie_test.o: basic_test.cc | |
336 | $(CXXCOMPILE) -O0 -c -fpie -o $@ $< | |
337 | basic_pie_test: basic_pie_test.o gcctestdir/ld | |
338 | $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o | |
351a8000 ILT |
339 | |
340 | check_PROGRAMS += constructor_test | |
d5026652 ILT |
341 | constructor_test_SOURCES = constructor_test.cc |
342 | constructor_test_DEPENDENCIES = gcctestdir/ld | |
343 | constructor_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 344 | constructor_test_LDADD = |
d5026652 | 345 | |
328c7c2f ILT |
346 | if HAVE_STATIC |
347 | check_PROGRAMS += constructor_static_test | |
351a8000 ILT |
348 | constructor_static_test_SOURCES = $(constructor_test_SOURCES) |
349 | constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) | |
350 | constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static | |
1abce4a6 | 351 | constructor_static_test_LDADD = $(constructor_test_LDADD) |
328c7c2f | 352 | endif |
351a8000 ILT |
353 | |
354 | check_PROGRAMS += two_file_test | |
351a8000 | 355 | check_PROGRAMS += two_file_pic_test |
3bd52c28 ILT |
356 | two_file_test_SOURCES = \ |
357 | two_file_test_1.cc \ | |
03e8f2b2 | 358 | two_file_test_1b.cc \ |
3bd52c28 ILT |
359 | two_file_test_2.cc \ |
360 | two_file_test_main.cc \ | |
361 | two_file_test.h | |
362 | two_file_test_DEPENDENCIES = gcctestdir/ld | |
363 | two_file_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 364 | two_file_test_LDADD = |
3bd52c28 | 365 | |
328c7c2f ILT |
366 | if HAVE_STATIC |
367 | check_PROGRAMS += two_file_static_test | |
351a8000 ILT |
368 | two_file_static_test_SOURCES = $(two_file_test_SOURCES) |
369 | two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) | |
370 | two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static | |
1abce4a6 | 371 | two_file_static_test_LDADD = $(two_file_test_LDADD) |
328c7c2f | 372 | endif |
f958d5fc ILT |
373 | |
374 | two_file_pic_test_SOURCES = two_file_test_main.cc | |
375 | two_file_pic_test_DEPENDENCIES = \ | |
03e8f2b2 | 376 | gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 377 | two_file_pic_test_LDFLAGS = -Bgcctestdir/ |
03e8f2b2 | 378 | two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 379 | |
351a8000 ILT |
380 | |
381 | check_PROGRAMS += two_file_shared_1_test | |
382 | check_PROGRAMS += two_file_shared_2_test | |
383 | check_PROGRAMS += two_file_shared_1_pic_2_test | |
384 | check_PROGRAMS += two_file_shared_2_pic_1_test | |
385 | check_PROGRAMS += two_file_same_shared_test | |
386 | check_PROGRAMS += two_file_separate_shared_12_test | |
387 | check_PROGRAMS += two_file_separate_shared_21_test | |
388 | two_file_test_1_pic.o: two_file_test_1.cc | |
389 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
390 | two_file_test_1b_pic.o: two_file_test_1b.cc |
391 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 ILT |
392 | two_file_test_2_pic.o: two_file_test_2.cc |
393 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
394 | two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld |
395 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o | |
351a8000 ILT |
396 | two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld |
397 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o | |
03e8f2b2 ILT |
398 | two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld |
399 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o | |
351a8000 | 400 | |
3bd52c28 ILT |
401 | two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc |
402 | two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so | |
403 | two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
404 | two_file_shared_1_test_LDADD = two_file_shared_1.so | |
405 | ||
03e8f2b2 | 406 | two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
407 | two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so |
408 | two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
409 | two_file_shared_2_test_LDADD = two_file_shared_2.so | |
410 | ||
386c048c ILT |
411 | two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc |
412 | two_file_shared_1_pic_2_test_DEPENDENCIES = \ | |
2f2de248 | 413 | gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o |
386c048c | 414 | two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
03e8f2b2 | 415 | 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 |
416 | |
417 | two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc | |
418 | two_file_shared_2_pic_1_test_DEPENDENCIES = \ | |
419 | gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o | |
420 | two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
421 | two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so | |
422 | ||
3bd52c28 ILT |
423 | two_file_same_shared_test_SOURCES = two_file_test_main.cc |
424 | two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so | |
425 | two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
426 | two_file_same_shared_test_LDADD = two_file_shared.so | |
427 | ||
428 | two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc | |
429 | two_file_separate_shared_12_test_DEPENDENCIES = \ | |
430 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
431 | two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
432 | two_file_separate_shared_12_test_LDADD = \ | |
433 | two_file_shared_1.so two_file_shared_2.so | |
434 | ||
435 | two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc | |
436 | two_file_separate_shared_21_test_DEPENDENCIES = \ | |
437 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
438 | two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
439 | two_file_separate_shared_21_test_LDADD = \ | |
440 | two_file_shared_2.so two_file_shared_1.so | |
441 | ||
6a74a719 ILT |
442 | check_PROGRAMS += two_file_relocatable_test |
443 | two_file_relocatable_test_SOURCES = two_file_test_main.cc | |
444 | two_file_relocatable_test_DEPENDENCIES = \ | |
445 | gcctestdir/ld two_file_relocatable.o | |
446 | two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
447 | two_file_relocatable_test_LDADD = two_file_relocatable.o | |
448 | two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
449 | gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
450 | ||
374ad285 ILT |
451 | check_PROGRAMS += two_file_pie_test |
452 | two_file_test_1_pie.o: two_file_test_1.cc | |
453 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
454 | two_file_test_1b_pie.o: two_file_test_1b.cc | |
455 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
456 | two_file_test_2_pie.o: two_file_test_2.cc | |
457 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
458 | two_file_test_main_pie.o: two_file_test_main.cc | |
459 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
460 | two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \ | |
461 | two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld | |
462 | $(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 | |
463 | ||
031cdbed ILT |
464 | check_SCRIPTS += two_file_shared.sh |
465 | check_DATA += two_file_shared.dbg | |
72fef11a | 466 | MOSTLYCLEANFILES += two_file_shared.dbg |
031cdbed ILT |
467 | two_file_shared.dbg: two_file_shared.so |
468 | $(TEST_READELF) -w $< >$@ 2>/dev/null | |
469 | ||
63402fe4 ILT |
470 | # The nonpic tests will fail on platforms which can not put non-PIC |
471 | # code into shared libraries, so we just don't run them in that case. | |
63402fe4 | 472 | if FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 473 | |
351a8000 ILT |
474 | check_PROGRAMS += two_file_shared_1_nonpic_test |
475 | check_PROGRAMS += two_file_shared_2_nonpic_test | |
476 | check_PROGRAMS += two_file_same_shared_nonpic_test | |
477 | check_PROGRAMS += two_file_separate_shared_12_nonpic_test | |
478 | check_PROGRAMS += two_file_separate_shared_21_nonpic_test | |
03e8f2b2 ILT |
479 | check_PROGRAMS += two_file_mixed_shared_test |
480 | check_PROGRAMS += two_file_mixed_2_shared_test | |
351a8000 | 481 | two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld |
611062c0 | 482 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext |
351a8000 ILT |
483 | two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld |
484 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o | |
03e8f2b2 | 485 | two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld |
611062c0 | 486 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext |
03e8f2b2 | 487 | two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld |
611062c0 | 488 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext |
03e8f2b2 | 489 | two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld |
611062c0 | 490 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext |
351a8000 | 491 | |
3bd52c28 ILT |
492 | two_file_shared_1_nonpic_test_SOURCES = \ |
493 | two_file_test_2.cc two_file_test_main.cc | |
494 | two_file_shared_1_nonpic_test_DEPENDENCIES = \ | |
495 | gcctestdir/ld two_file_shared_1_nonpic.so | |
496 | two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
497 | two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so | |
498 | ||
499 | two_file_shared_2_nonpic_test_SOURCES = \ | |
03e8f2b2 | 500 | two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
501 | two_file_shared_2_nonpic_test_DEPENDENCIES = \ |
502 | gcctestdir/ld two_file_shared_2_nonpic.so | |
503 | two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
504 | two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so | |
505 | ||
506 | two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc | |
507 | two_file_same_shared_nonpic_test_DEPENDENCIES = \ | |
508 | gcctestdir/ld two_file_shared_nonpic.so | |
509 | two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
510 | two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so | |
511 | ||
512 | two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc | |
513 | two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \ | |
514 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
515 | two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
516 | two_file_separate_shared_12_nonpic_test_LDADD = \ | |
517 | two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
518 | ||
519 | two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc | |
520 | two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \ | |
521 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
522 | two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
523 | two_file_separate_shared_21_nonpic_test_LDADD = \ | |
524 | two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so | |
525 | ||
03e8f2b2 ILT |
526 | two_file_mixed_shared_test_SOURCES = two_file_test_main.cc |
527 | two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so | |
528 | two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
529 | two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so | |
530 | ||
531 | two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc | |
532 | two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so | |
533 | two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
534 | two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so | |
535 | ||
d89051bd CC |
536 | check_PROGRAMS += two_file_mixed_pie_test |
537 | two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \ | |
538 | two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld | |
539 | $(CXXLINK) -Bgcctestdir/ -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so | |
540 | ||
351a8000 | 541 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 542 | |
6835af53 ILT |
543 | check_PROGRAMS += two_file_strip_test |
544 | two_file_strip_test: two_file_test | |
545 | $(TEST_STRIP) -o two_file_strip_test two_file_test | |
546 | ||
547 | check_PROGRAMS += two_file_same_shared_strip_test | |
548 | two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc | |
549 | two_file_same_shared_strip_test_DEPENDENCIES = \ | |
550 | gcctestdir/ld two_file_shared_strip.so | |
551 | two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R. | |
552 | two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so | |
553 | two_file_shared_strip.so: two_file_shared.so | |
554 | $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so | |
555 | ||
49bdd526 ILT |
556 | check_PROGRAMS += common_test_1 |
557 | common_test_1_SOURCES = common_test_1.c | |
558 | common_test_1_DEPENDENCIES = gcctestdir/ld | |
559 | common_test_1_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 560 | common_test_1_LDADD = |
351a8000 | 561 | |
eda294df ILT |
562 | check_PROGRAMS += common_test_2 |
563 | common_test_2_SOURCES = common_test_1.c | |
564 | common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld | |
565 | common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
566 | common_test_2_LDADD = common_test_2.so common_test_3.so | |
567 | common_test_2_pic.o: common_test_2.c | |
568 | $(COMPILE) -c -fpic -o $@ $< | |
569 | common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld | |
570 | $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so | |
571 | common_test_3_pic.o: common_test_3.c | |
572 | $(COMPILE) -c -fpic -o $@ $< | |
573 | common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld | |
574 | $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script | |
575 | ||
351a8000 | 576 | check_PROGRAMS += exception_test |
351a8000 ILT |
577 | check_PROGRAMS += exception_shared_1_test |
578 | check_PROGRAMS += exception_shared_2_test | |
579 | check_PROGRAMS += exception_same_shared_test | |
580 | check_PROGRAMS += exception_separate_shared_12_test | |
581 | check_PROGRAMS += exception_separate_shared_21_test | |
582 | exception_test_1_pic.o: exception_test_1.cc | |
583 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
584 | exception_test_2_pic.o: exception_test_2.cc | |
585 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
586 | exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld | |
587 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o | |
588 | exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld | |
589 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o | |
590 | exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld | |
591 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o | |
63402fe4 | 592 | |
3151305a ILT |
593 | exception_test_SOURCES = \ |
594 | exception_test_main.cc \ | |
595 | exception_test_1.cc \ | |
596 | exception_test_2.cc \ | |
597 | exception_test.h | |
598 | exception_test_DEPENDENCIES = gcctestdir/ld | |
599 | exception_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 600 | exception_test_LDADD = |
3151305a | 601 | |
328c7c2f ILT |
602 | if HAVE_STATIC |
603 | check_PROGRAMS += exception_static_test | |
351a8000 ILT |
604 | exception_static_test_SOURCES = $(exception_test_SOURCES) |
605 | exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) | |
606 | exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static | |
1abce4a6 | 607 | exception_static_test_LDADD = $(exception_test_LDADD) |
328c7c2f | 608 | endif |
3151305a ILT |
609 | |
610 | exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc | |
611 | exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so | |
612 | exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
613 | exception_shared_1_test_LDADD = exception_shared_1.so | |
614 | ||
615 | exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc | |
616 | exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so | |
617 | exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
618 | exception_shared_2_test_LDADD = exception_shared_2.so | |
619 | ||
620 | exception_same_shared_test_SOURCES = exception_test_main.cc | |
621 | exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so | |
622 | exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
623 | exception_same_shared_test_LDADD = exception_shared.so | |
624 | ||
625 | exception_separate_shared_12_test_SOURCES = exception_test_main.cc | |
626 | exception_separate_shared_12_test_DEPENDENCIES = \ | |
627 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
59965708 CC |
628 | exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \ |
629 | -Wl,--no-as-needed | |
3151305a ILT |
630 | exception_separate_shared_12_test_LDADD = \ |
631 | exception_shared_1.so exception_shared_2.so | |
632 | ||
633 | exception_separate_shared_21_test_SOURCES = exception_test_main.cc | |
634 | exception_separate_shared_21_test_DEPENDENCIES = \ | |
635 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
59965708 CC |
636 | exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \ |
637 | -Wl,--no-as-needed | |
3151305a ILT |
638 | exception_separate_shared_21_test_LDADD = \ |
639 | exception_shared_2.so exception_shared_1.so | |
640 | ||
3151305a | 641 | |
351a8000 | 642 | check_PROGRAMS += weak_test |
a360aedd | 643 | weak_test_SOURCES = weak_test.cc |
0e470e5c | 644 | weak_test_DEPENDENCIES = gcctestdir/ld |
a360aedd | 645 | weak_test_LDFLAGS = -Bgcctestdir/ |
1abce4a6 | 646 | weak_test_LDADD = |
a360aedd | 647 | |
86925eef | 648 | check_PROGRAMS += weak_undef_test |
72fef11a | 649 | MOSTLYCLEANFILES += alt/weak_undef_lib.so |
86925eef CC |
650 | weak_undef_test_SOURCES = weak_undef_test.cc |
651 | weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so | |
652 | weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
653 | weak_undef_test_LDADD = -L . weak_undef_lib.so | |
654 | weak_undef_file1.o: weak_undef_file1.cc | |
655 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
656 | weak_undef_file2.o: weak_undef_file2.cc | |
657 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
658 | weak_undef_lib.so: weak_undef_file1.o | |
659 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o | |
660 | alt/weak_undef_lib.so: weak_undef_file2.o | |
661 | test -d alt || mkdir -p alt | |
662 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o | |
351a8000 | 663 | |
f3c69fca CC |
664 | if FN_PTRS_IN_SO_WITHOUT_PIC |
665 | check_PROGRAMS += weak_undef_nonpic_test | |
72fef11a | 666 | MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so |
f3c69fca CC |
667 | weak_undef_nonpic_test_SOURCES = weak_undef_test.cc |
668 | weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so | |
669 | weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
670 | weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so | |
671 | weak_undef_file1_nonpic.o: weak_undef_file1.cc | |
672 | $(CXXCOMPILE) -c -o $@ $< | |
673 | weak_undef_file2_nonpic.o: weak_undef_file2.cc | |
674 | $(CXXCOMPILE) -c -o $@ $< | |
675 | weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o | |
611062c0 | 676 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext |
f3c69fca CC |
677 | alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o |
678 | test -d alt || mkdir -p alt | |
611062c0 | 679 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext |
f3c69fca CC |
680 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
681 | ||
682 | ||
99a37bfd ILT |
683 | check_PROGRAMS += weak_alias_test |
684 | weak_alias_test_SOURCES = weak_alias_test_main.cc | |
685 | weak_alias_test_DEPENDENCIES = \ | |
686 | gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \ | |
21131061 | 687 | weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so |
99a37bfd ILT |
688 | weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
689 | weak_alias_test_LDADD = \ | |
690 | weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \ | |
21131061 | 691 | weak_alias_test_4.so weak_alias_test_5.so |
99a37bfd ILT |
692 | weak_alias_test_1_pic.o: weak_alias_test_1.cc |
693 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 694 | weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld |
99a37bfd ILT |
695 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o |
696 | weak_alias_test_2_pic.o: weak_alias_test_2.cc | |
697 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 698 | weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld |
99a37bfd ILT |
699 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o |
700 | weak_alias_test_3.o: weak_alias_test_3.cc | |
701 | $(CXXCOMPILE) -c -o $@ $< | |
702 | weak_alias_test_4_pic.o: weak_alias_test_4.cc | |
703 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 704 | weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld |
99a37bfd | 705 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o |
21131061 ILT |
706 | weak_alias_test_5_pic.o: weak_alias_test_5.cc |
707 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
708 | weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld | |
709 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \ | |
710 | -Wl,--version-script,$(srcdir)/weak_alias_test.script | |
99a37bfd | 711 | |
de4c45bd ILT |
712 | check_SCRIPTS += weak_plt.sh |
713 | check_PROGRAMS += weak_plt | |
714 | check_DATA += weak_plt_shared.so | |
715 | weak_plt_main_pic.o: weak_plt_main.cc | |
716 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
717 | weak_plt: weak_plt_main_pic.o gcctestdir/ld | |
718 | $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o | |
719 | weak_plt_shared_pic.o: weak_plt_shared.cc | |
720 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
721 | weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld | |
722 | $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o | |
723 | ||
f34787f8 ILT |
724 | check_PROGRAMS += copy_test |
725 | copy_test_SOURCES = copy_test.cc | |
726 | copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so | |
727 | copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
728 | copy_test_LDADD = copy_test_1.so copy_test_2.so | |
729 | copy_test_1_pic.o: copy_test_1.cc | |
730 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
731 | copy_test_1.so: gcctestdir/ld copy_test_1_pic.o | |
732 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o | |
733 | copy_test_2_pic.o: copy_test_2.cc | |
734 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
735 | copy_test_2.so: gcctestdir/ld copy_test_2_pic.o | |
736 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o | |
737 | ||
6eee141f ILT |
738 | if TLS |
739 | ||
351a8000 ILT |
740 | check_PROGRAMS += tls_test |
741 | check_PROGRAMS += tls_pic_test | |
c7177d31 | 742 | check_PROGRAMS += tls_pie_test |
b3705d2a | 743 | check_PROGRAMS += tls_pie_pic_test |
351a8000 | 744 | check_PROGRAMS += tls_shared_test |
c03c7692 | 745 | check_PROGRAMS += tls_shared_ie_test |
c2b45e22 | 746 | check_PROGRAMS += tls_shared_gd_to_ie_test |
351a8000 ILT |
747 | tls_test_pic.o: tls_test.cc |
748 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
749 | tls_test_file2_pic.o: tls_test_file2.cc | |
750 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
155a0dd7 ILT |
751 | tls_test_c_pic.o: tls_test_c.c |
752 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
753 | tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld | |
9c2d0ef9 | 754 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs |
c2b45e22 CC |
755 | tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld |
756 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o | |
351a8000 | 757 | |
c03c7692 ILT |
758 | tls_test_pic_ie.o: tls_test.cc |
759 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
760 | tls_test_file2_pic_ie.o: tls_test_file2.cc | |
761 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
155a0dd7 ILT |
762 | tls_test_c_pic_ie.o: tls_test_c.c |
763 | $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $< | |
764 | tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld | |
765 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o | |
c03c7692 | 766 | |
e0374858 | 767 | tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h |
155a0dd7 | 768 | tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o |
6eee141f | 769 | tls_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
770 | tls_test_LDADD = tls_test_c.o -lpthread |
771 | tls_test_c.o: tls_test_c.c | |
772 | $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $< | |
6eee141f ILT |
773 | |
774 | tls_pic_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
775 | tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \ |
776 | tls_test_c_pic.o | |
6eee141f | 777 | tls_pic_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
778 | tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \ |
779 | -lpthread | |
6eee141f | 780 | |
c7177d31 ILT |
781 | tls_test_main_pie.o: tls_test_main.cc tls_test.h |
782 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
783 | tls_test_pie.o: tls_test.cc tls_test.h | |
784 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
785 | tls_test_file2_pie.o: tls_test_file2.cc tls_test.h | |
786 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
787 | tls_test_c_pie.o: tls_test_c.c | |
788 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
789 | tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \ | |
790 | tls_test_c_pie.o gcctestdir/ld | |
791 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread | |
792 | ||
b3705d2a ILT |
793 | tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \ |
794 | tls_test_c_pic.o gcctestdir/ld | |
795 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread | |
796 | ||
6eee141f ILT |
797 | tls_shared_test_SOURCES = tls_test_main.cc |
798 | tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so | |
799 | tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
800 | tls_shared_test_LDADD = tls_test_shared.so -lpthread | |
801 | ||
c03c7692 ILT |
802 | tls_shared_ie_test_SOURCES = tls_test_main.cc |
803 | tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so | |
804 | tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
805 | tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread | |
806 | ||
c2b45e22 | 807 | tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc |
155a0dd7 ILT |
808 | tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \ |
809 | tls_test_c_pic.o tls_test_shared2.so | |
c2b45e22 | 810 | tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
811 | tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \ |
812 | tls_test_shared2.so -lpthread | |
c2b45e22 CC |
813 | |
814 | if TLS_GNU2_DIALECT | |
815 | ||
816 | check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test | |
817 | ||
818 | tls_test_gnu2.o: tls_test.cc | |
819 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
820 | tls_test_file2_gnu2.o: tls_test_file2.cc | |
821 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
155a0dd7 ILT |
822 | tls_test_c_gnu2.o: tls_test_c.c |
823 | $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $< | |
c2b45e22 CC |
824 | tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld |
825 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o | |
826 | ||
827 | tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
828 | tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \ |
829 | tls_test_c_gnu2.o tls_test_gnu2_shared2.so | |
c2b45e22 | 830 | tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
831 | tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \ |
832 | tls_test_gnu2_shared2.so -lpthread | |
c2b45e22 CC |
833 | |
834 | if TLS_DESCRIPTORS | |
835 | ||
836 | check_PROGRAMS += tls_shared_gnu2_test | |
837 | ||
155a0dd7 ILT |
838 | tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld |
839 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o | |
c2b45e22 CC |
840 | |
841 | tls_shared_gnu2_test_SOURCES = tls_test_main.cc | |
842 | tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so | |
843 | tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
844 | tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread | |
845 | ||
846 | endif TLS_DESCRIPTORS | |
847 | ||
848 | endif TLS_GNU2_DIALECT | |
849 | ||
328c7c2f | 850 | if HAVE_STATIC |
351a8000 ILT |
851 | if STATIC_TLS |
852 | check_PROGRAMS += tls_static_test | |
853 | check_PROGRAMS += tls_static_pic_test | |
854 | ||
855 | tls_static_test_SOURCES = $(tls_test_SOURCES) | |
856 | tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) | |
857 | tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static | |
858 | tls_static_test_LDADD = $(tls_test_LDADD) | |
859 | ||
860 | tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES) | |
861 | tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) | |
862 | tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static | |
863 | tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) | |
864 | endif | |
328c7c2f | 865 | endif |
6eee141f ILT |
866 | |
867 | if FN_PTRS_IN_SO_WITHOUT_PIC | |
351a8000 | 868 | check_PROGRAMS += tls_shared_nonpic_test |
155a0dd7 | 869 | tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld |
611062c0 | 870 | $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext |
6eee141f ILT |
871 | |
872 | tls_shared_nonpic_test_SOURCES = tls_test_main.cc | |
873 | tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so | |
874 | tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
875 | tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread | |
351a8000 | 876 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
6eee141f | 877 | |
351a8000 | 878 | endif TLS |
6eee141f | 879 | |
d491d34e ILT |
880 | check_PROGRAMS += many_sections_test |
881 | many_sections_test_SOURCES = many_sections_test.cc | |
882 | many_sections_test_DEPENDENCIES = gcctestdir/ld | |
883 | many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic | |
1abce4a6 | 884 | many_sections_test_LDADD = |
d491d34e ILT |
885 | |
886 | BUILT_SOURCES += many_sections_define.h | |
72fef11a | 887 | MOSTLYCLEANFILES += many_sections_define.h |
d491d34e ILT |
888 | many_sections_define.h: |
889 | (for i in `seq 1 70000`; do \ | |
890 | echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \ | |
891 | done) > $@.tmp | |
892 | mv -f $@.tmp $@ | |
893 | ||
894 | BUILT_SOURCES += many_sections_check.h | |
72fef11a | 895 | MOSTLYCLEANFILES += many_sections_check.h |
d491d34e | 896 | many_sections_check.h: |
4c94d6ae | 897 | (for i in `seq 1 1000 70000`; do \ |
d491d34e ILT |
898 | echo "assert(var_$$i == $$i);"; \ |
899 | done) > $@.tmp | |
900 | mv -f $@.tmp $@ | |
901 | ||
902 | check_PROGRAMS += many_sections_r_test | |
d491d34e ILT |
903 | many_sections_r_test.o: many_sections_test.o gcctestdir/ld |
904 | gcctestdir/ld -r -o $@ many_sections_test.o | |
7bc3e21a ILT |
905 | many_sections_r_test: many_sections_r_test.o gcctestdir/ld |
906 | $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS) | |
6eee141f | 907 | |
2fd32231 ILT |
908 | check_PROGRAMS += initpri1 |
909 | initpri1_SOURCES = initpri1.c | |
910 | initpri1_DEPENDENCIES = gcctestdir/ld | |
911 | initpri1_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 912 | initpri1_LDADD = |
2fd32231 | 913 | |
5393d741 ILT |
914 | check_PROGRAMS += initpri2 |
915 | initpri2_SOURCES = initpri2.c | |
916 | initpri2_DEPENDENCIES = gcctestdir/ld | |
7b5de7ee | 917 | initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array |
5393d741 | 918 | initpri2_LDADD = |
2fd32231 | 919 | |
487b39df ILT |
920 | check_PROGRAMS += initpri3a |
921 | initpri3a_SOURCES = initpri3.c | |
922 | initpri3a_DEPENDENCIES = gcctestdir/ld | |
923 | initpri3a_LDFLAGS = -Bgcctestdir/ | |
924 | initpri3a_LDADD = | |
925 | ||
7c6109da DK |
926 | # This test fails on targets not using .ctors and .dtors sections (e.g. ARM |
927 | # EABI). Given that gcc is moving towards using .init_array in all cases, | |
928 | # this test is commented out. A better fix would be checking whether gcc | |
929 | # uses .ctors or .init_array sections in configure. | |
930 | ||
931 | # check_PROGRAMS += initpri3b | |
932 | # initpri3b_SOURCES = initpri3.c | |
933 | # initpri3b_DEPENDENCIES = gcctestdir/ld | |
934 | # initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array | |
935 | # initpri3b_LDADD = | |
487b39df | 936 | |
351a8000 ILT |
937 | # Test --detect-odr-violations |
938 | check_SCRIPTS += debug_msg.sh | |
6eee141f | 939 | |
351a8000 ILT |
940 | # Create the data files that debug_msg.sh analyzes. |
941 | check_DATA += debug_msg.err | |
942 | MOSTLYCLEANFILES += debug_msg.err | |
943 | debug_msg.o: debug_msg.cc | |
944 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc | |
945 | odr_violation1.o: odr_violation1.cc | |
946 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc | |
71ff8986 ILT |
947 | # Compile with different optimization flags to check that rearranged |
948 | # instructions don't cause a false positive. | |
351a8000 | 949 | odr_violation2.o: odr_violation2.cc |
71ff8986 | 950 | $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 ILT |
951 | debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld |
952 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" | |
953 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ | |
954 | then \ | |
955 | echo 1>&2 "Link of debug_msg should have failed"; \ | |
956 | rm -f $@; \ | |
957 | exit 1; \ | |
958 | fi | |
959 | ||
472076e4 CC |
960 | |
961 | if HAVE_ZLIB | |
962 | ||
963 | # Check that --detect-odr-violations works with compressed debug sections. | |
964 | check_DATA += debug_msg_cdebug.err | |
965 | MOSTLYCLEANFILES += debug_msg_cdebug.err | |
966 | debug_msg_cdebug.o: debug_msg.cc gcctestdir/as | |
967 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc | |
968 | odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as | |
969 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc | |
970 | odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as | |
971 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc | |
972 | debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld | |
973 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@" | |
974 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \ | |
975 | then \ | |
976 | echo 1>&2 "Link of debug_msg_cdebug should have failed"; \ | |
977 | rm -f $@; \ | |
978 | exit 1; \ | |
979 | fi | |
980 | ||
981 | endif HAVE_ZLIB | |
982 | ||
351a8000 ILT |
983 | # See if we can also detect problems when we're linking .so's, not .o's. |
984 | check_DATA += debug_msg_so.err | |
985 | MOSTLYCLEANFILES += debug_msg_so.err | |
986 | debug_msg.so: debug_msg.cc gcctestdir/ld | |
987 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
988 | odr_violation1.so: odr_violation1.cc gcctestdir/ld | |
989 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
990 | odr_violation2.so: odr_violation2.cc gcctestdir/ld | |
71ff8986 | 991 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 | 992 | debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld |
3d587466 CC |
993 | @echo $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" |
994 | @if $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ | |
351a8000 ILT |
995 | then \ |
996 | echo 1>&2 "Link of debug_msg_so should have failed"; \ | |
997 | rm -f $@; \ | |
998 | exit 1; \ | |
999 | fi | |
1000 | ||
1001 | # We also want to make sure we do something reasonable when there's no | |
1002 | # debug info available. For the best test, we use .so's. | |
1003 | check_DATA += debug_msg_ndebug.err | |
1004 | MOSTLYCLEANFILES += debug_msg_ndebug.err | |
1005 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld | |
1006 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
1007 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld | |
1008 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
1009 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld | |
71ff8986 | 1010 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 | 1011 | debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld |
3d587466 CC |
1012 | @echo $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ "2>$@" |
1013 | @if $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ 2>$@; \ | |
351a8000 ILT |
1014 | then \ |
1015 | echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ | |
1016 | rm -f $@; \ | |
1017 | exit 1; \ | |
1018 | fi | |
1019 | ||
1020 | ||
1021 | # Similar to --detect-odr-violations: check for undefined symbols in .so's | |
1022 | check_SCRIPTS += undef_symbol.sh | |
1023 | check_DATA += undef_symbol.err | |
1024 | MOSTLYCLEANFILES += undef_symbol.err | |
1025 | undef_symbol.o: undef_symbol.cc | |
1026 | $(CXXCOMPILE) -O0 -g -c -fPIC $< | |
1027 | undef_symbol.so: undef_symbol.o gcctestdir/ld | |
1028 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o | |
1029 | undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld | |
1030 | @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@" | |
1031 | @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \ | |
1032 | then \ | |
1033 | echo 1>&2 "Link of undef_symbol_test should have failed"; \ | |
1034 | rm -f $@; \ | |
1035 | exit 1; \ | |
1036 | fi | |
1037 | ||
1038 | ||
351a8000 ILT |
1039 | # Test -o when emitting to a special file (such as something in /dev). |
1040 | check_PROGRAMS += flagstest_o_specialfile | |
0e470e5c | 1041 | flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld |
351a8000 ILT |
1042 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@ |
1043 | chmod a+x $@ | |
1044 | test -s $@ | |
1045 | ||
7fcd0256 ILT |
1046 | if HAVE_ZLIB |
1047 | ||
1048 | # Test --compress-debug-sections. FIXME: check we actually compress. | |
1049 | check_PROGRAMS += flagstest_compress_debug_sections | |
1050 | flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld | |
1051 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib | |
1052 | test -s $@ | |
1053 | ||
1054 | ||
351a8000 ILT |
1055 | # The specialfile output has a tricky case when we also compress debug |
1056 | # sections, because it requires output-file resizing. | |
1057 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections | |
0e470e5c ILT |
1058 | flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \ |
1059 | gcctestdir/ld | |
126f3ece | 1060 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@ |
351a8000 ILT |
1061 | chmod a+x $@ |
1062 | test -s $@ | |
1063 | ||
7fcd0256 ILT |
1064 | endif HAVE_ZLIB |
1065 | ||
d12a5ea8 ILT |
1066 | # Test -TText and -Tdata. |
1067 | check_PROGRAMS += flagstest_o_ttext_1 | |
1068 | flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld | |
1069 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000 | |
1070 | ||
1071 | # This version won't be runnable, because there is no way to put the | |
1072 | # PT_PHDR segment at file offset 0. We just make sure that we can | |
1073 | # build it without error. | |
1074 | check_DATA += flagstest_o_ttext_2 | |
1075 | flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld | |
1076 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010 | |
1077 | ||
99f8faca ILT |
1078 | # Test symbol versioning. |
1079 | check_PROGRAMS += ver_test | |
1080 | ver_test_SOURCES = ver_test_main.cc | |
1081 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
1082 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1083 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
1084 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld | |
1085 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so | |
09124467 | 1086 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
41d0ab5f | 1087 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so |
09124467 ILT |
1088 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld |
1089 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o | |
99f8faca ILT |
1090 | ver_test_1.o: ver_test_1.cc |
1091 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1092 | ver_test_2.o: ver_test_2.cc | |
1093 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1094 | ver_test_3.o: ver_test_3.cc | |
1095 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1096 | ver_test_4.o: ver_test_4.cc | |
1097 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 1098 | |
0602e05a ILT |
1099 | check_SCRIPTS += ver_test_1.sh |
1100 | check_DATA += ver_test_1.syms | |
1101 | ver_test_1.syms: ver_test_1.so | |
1102 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1103 | ||
be3e6201 ILT |
1104 | check_PROGRAMS += ver_test_2 |
1105 | ver_test_2_SOURCES = ver_test_main_2.cc | |
1106 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
1107 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1108 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
1109 | ||
be3e6201 ILT |
1110 | check_SCRIPTS += ver_test_2.sh |
1111 | check_DATA += ver_test_2.syms | |
1112 | ver_test_2.syms: ver_test_2 | |
6835af53 | 1113 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 1114 | |
686c8caf ILT |
1115 | check_SCRIPTS += ver_test_4.sh |
1116 | check_DATA += ver_test_4.syms | |
1117 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 1118 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
1119 | |
1120 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld | |
1121 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so | |
1122 | ver_test_5.o: ver_test_5.cc | |
1123 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1124 | check_SCRIPTS += ver_test_5.sh | |
1125 | check_DATA += ver_test_5.syms | |
1126 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 1127 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 1128 | |
18e6b24e ILT |
1129 | check_PROGRAMS += ver_test_6 |
1130 | ver_test_6_SOURCES = ver_test_6.c | |
1131 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
1132 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1133 | ver_test_6_LDADD = ver_test_2.so | |
1134 | ||
479f6503 ILT |
1135 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
1136 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o | |
1137 | ver_test_7.o: ver_test_7.cc | |
1138 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1139 | check_SCRIPTS += ver_test_7.sh | |
1140 | check_DATA += ver_test_7.syms | |
1141 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 1142 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 1143 | |
75517b77 ILT |
1144 | check_PROGRAMS += ver_test_8 |
1145 | ver_test_8_SOURCES = two_file_test_main.cc | |
1146 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so | |
1147 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1148 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so | |
1149 | ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld | |
1150 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so | |
1151 | ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld | |
1152 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o | |
1153 | ||
95d14cd3 ILT |
1154 | check_PROGRAMS += ver_test_9 |
1155 | ver_test_9_SOURCES = ver_test_main.cc | |
1156 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so | |
1157 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1158 | ver_test_9_LDADD = ver_test_9.so | |
1159 | ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld | |
41d0ab5f | 1160 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so |
95d14cd3 ILT |
1161 | ver_test_9.o: ver_test_9.cc |
1162 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1163 | ||
057ead22 ILT |
1164 | check_SCRIPTS += ver_test_10.sh |
1165 | check_DATA += ver_test_10.syms | |
1166 | ver_test_10.syms: ver_test_10.so | |
1167 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1168 | ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script | |
1169 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o | |
1170 | ||
9c5b8369 | 1171 | check_PROGRAMS += ver_test_11 |
72fef11a | 1172 | MOSTLYCLEANFILES += ver_test_11.a |
9c5b8369 ILT |
1173 | ver_test_11_SOURCES = ver_test_main_2.cc |
1174 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a | |
1175 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1176 | ver_test_11_LDADD = ver_test_11.a | |
1177 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o | |
1178 | $(TEST_AR) rc $@ $^ | |
1179 | ||
6d1c4efb ILT |
1180 | check_PROGRAMS += ver_test_12 |
1181 | ver_test_12_SOURCES = ver_test_main_2.cc | |
1182 | ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o | |
1183 | ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1184 | ver_test_12_LDADD = ver_test_12.o | |
1185 | ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o | |
1186 | gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o | |
1187 | ||
8bdcdf2c ILT |
1188 | check_PROGRAMS += protected_1 |
1189 | protected_1_SOURCES = \ | |
1190 | protected_main_1.cc protected_main_2.cc protected_main_3.cc | |
1191 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1192 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1193 | protected_1_LDADD = protected_1.so | |
1194 | ||
1195 | protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1196 | $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1197 | protected_1_pic.o: protected_1.cc | |
1198 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1199 | protected_2_pic.o: protected_2.cc | |
1200 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1201 | protected_3_pic.o: protected_3.cc | |
1202 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1203 | ||
1204 | check_PROGRAMS += protected_2 | |
1205 | protected_2_SOURCES = protected_main_1.cc protected_3.cc | |
1206 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1207 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1208 | protected_2_LDADD = protected_1.so | |
1209 | ||
837504c4 ILT |
1210 | check_DATA += protected_3.err |
1211 | MOSTLYCLEANFILES += protected_3.err | |
1212 | protected_4_pic.o: protected_4.cc | |
1213 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1214 | protected_3.err: protected_4_pic.o gcctestdir/ld | |
1215 | @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@" | |
1216 | @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \ | |
1217 | echo 1>&2 "Link of protected_4.so should have failed"; \ | |
1218 | rm -f $@; \ | |
1219 | exit 1; \ | |
1220 | fi | |
1221 | ||
9f1d377b | 1222 | check_PROGRAMS += relro_test |
fc497986 CC |
1223 | check_SCRIPTS += relro_test.sh |
1224 | check_DATA += relro_test.stdout | |
9f1d377b ILT |
1225 | relro_test_SOURCES = relro_test_main.cc |
1226 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so | |
1227 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1228 | relro_test_LDADD = relro_test.so | |
1229 | relro_test.so: gcctestdir/ld relro_test_pic.o | |
1230 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o | |
1231 | relro_test_pic.o: relro_test.cc | |
1232 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
fc497986 CC |
1233 | relro_test.stdout: relro_test.so |
1234 | $(TEST_READELF) -SlW relro_test.so > relro_test.stdout | |
9f1d377b | 1235 | |
9446efde ILT |
1236 | check_PROGRAMS += relro_now_test |
1237 | relro_now_test_SOURCES = relro_test_main.cc | |
1238 | relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so | |
1239 | relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now | |
1240 | relro_now_test_LDADD = relro_now_test.so | |
1241 | relro_now_test.so: gcctestdir/ld relro_test_pic.o | |
1242 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o | |
1243 | ||
5f1ab67a ILT |
1244 | check_PROGRAMS += relro_strip_test |
1245 | relro_strip_test_SOURCES = relro_test_main.cc | |
1246 | relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so | |
1247 | relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1248 | relro_strip_test_LDADD = relro_strip_test.so | |
1249 | relro_strip_test.so: relro_test.so | |
1250 | $(TEST_STRIP) -o $@ $< | |
1251 | ||
2d924fd9 ILT |
1252 | check_PROGRAMS += relro_script_test |
1253 | relro_script_test_SOURCES = relro_test_main.cc | |
1254 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so | |
1255 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1256 | relro_script_test_LDADD = relro_script_test.so | |
1257 | relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o | |
1258 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o | |
1259 | ||
e5756efb ILT |
1260 | check_PROGRAMS += script_test_1 |
1261 | script_test_1_SOURCES = script_test_1.cc | |
1262 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t | |
1263 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t | |
1abce4a6 | 1264 | script_test_1_LDADD = |
e5756efb | 1265 | |
a445fddf ILT |
1266 | check_PROGRAMS += script_test_2 |
1267 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
1268 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
1269 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t | |
1abce4a6 | 1270 | script_test_2_LDADD = |
a445fddf | 1271 | |
88dd47ac ILT |
1272 | check_PROGRAMS += justsyms |
1273 | justsyms_SOURCES = justsyms_1.cc | |
1274 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
1275 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
1abce4a6 | 1276 | justsyms_LDADD = |
88dd47ac ILT |
1277 | justsyms_2.o: justsyms_2.cc |
1278 | $(CXXCOMPILE) -c -o $@ $< | |
83bfb6b7 | 1279 | justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t |
88dd47ac ILT |
1280 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o |
1281 | ||
c3f7b0e5 CC |
1282 | check_PROGRAMS += justsyms_exec |
1283 | justsyms_exec_SOURCES = justsyms_exec.c | |
1284 | justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib | |
1285 | justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib | |
1286 | justsyms_exec_LDADD = | |
1287 | justsyms_lib.o: justsyms_lib.c | |
1288 | $(COMPILE) -c -o $@ $< | |
1289 | justsyms_lib: justsyms_lib.o gcctestdir/ld | |
1290 | gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o | |
1291 | ||
bc644c6c | 1292 | check_PROGRAMS += binary_test |
72fef11a | 1293 | MOSTLYCLEANFILES += binary.txt |
bc644c6c ILT |
1294 | binary_test_SOURCES = binary_test.cc |
1295 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
1296 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf | |
1abce4a6 | 1297 | binary_test_LDADD = |
bc644c6c ILT |
1298 | # Copy the file to the build directory to avoid worrying about the |
1299 | # full pathname in the generated symbols. | |
1300 | binary.txt: $(srcdir)/binary.in | |
1301 | rm -f $@ | |
1302 | $(LN_S) $< $@ | |
1303 | ||
09124467 ILT |
1304 | check_SCRIPTS += ver_matching_test.sh |
1305 | check_DATA += ver_matching_test.stdout | |
1306 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
2fbb4320 ILT |
1307 | ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld |
1308 | $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map | |
1309 | ver_matching_def_pic.o: ver_matching_def.cc | |
1310 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< | |
09124467 | 1311 | ver_matching_test.stdout: ver_matching_def.so |
6835af53 | 1312 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
1c4f3631 ILT |
1313 | |
1314 | check_PROGRAMS += script_test_3 | |
1315 | check_SCRIPTS += script_test_3.sh | |
1316 | check_DATA += script_test_3.stdout | |
1317 | MOSTLYCLEANFILES += script_test_3.stdout | |
1318 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
1319 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t | |
1320 | script_test_3.stdout: script_test_3 | |
2cefc357 | 1321 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
09124467 | 1322 | |
4ebf39db ILT |
1323 | check_PROGRAMS += tls_phdrs_script_test |
1324 | tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) | |
1325 | tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t | |
1326 | tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t | |
1327 | tls_phdrs_script_test_LDADD = $(tls_test_LDADD) | |
1328 | ||
e6188289 ILT |
1329 | check_SCRIPTS += script_test_4.sh |
1330 | check_DATA += script_test_4.stdout | |
72fef11a | 1331 | MOSTLYCLEANFILES += script_test_4 |
e6188289 ILT |
1332 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t |
1333 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t | |
1334 | script_test_4.stdout: script_test_4 | |
1335 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout | |
1336 | ||
6c93b22c ILT |
1337 | check_PROGRAMS += tls_script_test |
1338 | tls_script_test_SOURCES = $(tls_test_SOURCES) | |
1339 | tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t | |
1340 | tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t | |
1341 | tls_script_test_LDADD = $(tls_test_LDADD) | |
1342 | ||
401a9a73 CC |
1343 | check_SCRIPTS += script_test_5.sh |
1344 | check_DATA += script_test_5.stdout | |
72fef11a | 1345 | MOSTLYCLEANFILES += script_test_5 |
401a9a73 CC |
1346 | script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t |
1347 | $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t | |
1348 | script_test_5.stdout: script_test_5 | |
1349 | $(TEST_READELF) -SW script_test_5 > script_test_5.stdout | |
1350 | ||
3c12dcdb DK |
1351 | check_SCRIPTS += script_test_6.sh |
1352 | check_DATA += script_test_6.stdout | |
1353 | MOSTLYCLEANFILES += script_test_6 | |
1354 | script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t | |
1355 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \ | |
1356 | -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000 | |
1357 | script_test_6.stdout: script_test_6 | |
1358 | $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout | |
1359 | ||
1360 | check_SCRIPTS += script_test_7.sh | |
1361 | check_DATA += script_test_7.stdout | |
1362 | MOSTLYCLEANFILES += script_test_7 | |
1363 | script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1364 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t | |
1365 | script_test_7.stdout: script_test_7 | |
1366 | $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout | |
1367 | ||
1368 | check_SCRIPTS += script_test_8.sh | |
1369 | check_DATA += script_test_8.stdout | |
1370 | MOSTLYCLEANFILES += script_test_8 | |
1371 | script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1372 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \ | |
1373 | -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000 | |
1374 | script_test_8.stdout: script_test_8 | |
1375 | $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout | |
1376 | ||
d103a984 RÁE |
1377 | |
1378 | check_SCRIPTS += script_test_9.sh | |
1379 | check_DATA += script_test_9.stdout | |
1380 | script_test_9.o: script_test_9.cc | |
1381 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
1382 | script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o | |
1383 | $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t | |
1384 | script_test_9.stdout: script_test_9 | |
1385 | $(TEST_READELF) -lW script_test_9 > script_test_9.stdout | |
1386 | ||
1387 | ||
c82fbeee CS |
1388 | # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, |
1389 | # and --dynamic-list-cpp-typeinfo | |
1390 | ||
1391 | check_SCRIPTS += dynamic_list.sh | |
1392 | check_DATA += dynamic_list.stdout | |
72fef11a | 1393 | MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout |
c82fbeee CS |
1394 | dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t |
1395 | $(CXXLINK) -Bgcctestdir/ basic_test.o \ | |
1396 | -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ | |
1397 | -Wl,--dynamic-list-data \ | |
1398 | -Wl,--dynamic-list-cpp-new \ | |
1399 | -Wl,--dynamic-list-cpp-typeinfo | |
1400 | dynamic_list.stdout: dynamic_list | |
94e6ee91 | 1401 | $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout |
c82fbeee | 1402 | |
fbd8a257 | 1403 | check_PROGRAMS += thin_archive_test_1 |
72fef11a CC |
1404 | MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \ |
1405 | alt/thin_archive_test_2.o alt/thin_archive_test_4.o \ | |
1406 | alt/libthin2.a alt/libthin4.a | |
fbd8a257 CC |
1407 | thin_archive_test_1_SOURCES = thin_archive_main.cc |
1408 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a | |
1409 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt | |
1410 | thin_archive_test_1_LDADD = libthin1.a -lthin2 | |
1411 | ||
1412 | check_PROGRAMS += thin_archive_test_2 | |
1413 | thin_archive_test_2_SOURCES = thin_archive_main.cc | |
1414 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a | |
1415 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. | |
1416 | thin_archive_test_2_LDADD = -lthinall | |
1417 | ||
1418 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o | |
1419 | rm -f $@ | |
1420 | $(TEST_AR) crT $@ $^ | |
1421 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o | |
1422 | rm -f $@ | |
1423 | $(TEST_AR) crT $@ $^ | |
1424 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o | |
1425 | rm -f $@ | |
1426 | $(TEST_AR) crT $@ $^ | |
1427 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o | |
1428 | rm -f $@ | |
1429 | $(TEST_AR) crT $@ $^ | |
1430 | libthinall.a: libthin3.a alt/libthin4.a | |
1431 | rm -f $@ | |
1432 | $(TEST_AR) crT $@ $^ | |
1433 | alt/thin_archive_test_2.o: thin_archive_test_2.cc | |
1434 | test -d alt || mkdir -p alt | |
1435 | $(CXXCOMPILE) -c -o $@ $< | |
1436 | alt/thin_archive_test_4.o: thin_archive_test_4.cc | |
1437 | test -d alt || mkdir -p alt | |
1438 | $(CXXCOMPILE) -c -o $@ $< | |
1439 | ||
89fc3421 CC |
1440 | if PLUGINS |
1441 | ||
1442 | check_PROGRAMS += plugin_test_1 | |
1443 | check_SCRIPTS += plugin_test_1.sh | |
1444 | check_DATA += plugin_test_1.err | |
1445 | MOSTLYCLEANFILES += plugin_test_1.err | |
abc8dcba CC |
1446 | 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 |
1447 | $(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 |
1448 | plugin_test_1.err: plugin_test_1 |
1449 | @touch plugin_test_1.err | |
1450 | ||
1451 | check_PROGRAMS += plugin_test_2 | |
1452 | check_SCRIPTS += plugin_test_2.sh | |
1453 | check_DATA += plugin_test_2.err | |
1454 | MOSTLYCLEANFILES += plugin_test_2.err | |
1455 | 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 | |
1456 | $(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 | |
1457 | plugin_test_2.err: plugin_test_2 | |
1458 | @touch plugin_test_2.err | |
1459 | ||
d66a9eb3 CC |
1460 | check_PROGRAMS += plugin_test_3 |
1461 | check_SCRIPTS += plugin_test_3.sh | |
1462 | check_DATA += plugin_test_3.err | |
1463 | MOSTLYCLEANFILES += plugin_test_3.err | |
1464 | 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 | |
1465 | $(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 | |
1466 | plugin_test_3.err: plugin_test_3 | |
1467 | @touch plugin_test_3.err | |
1468 | ||
0f7c0701 CC |
1469 | check_PROGRAMS += plugin_test_4 |
1470 | check_SCRIPTS += plugin_test_4.sh | |
1471 | check_DATA += plugin_test_4.err | |
72fef11a | 1472 | MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err |
0f7c0701 CC |
1473 | plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so |
1474 | $(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 | |
1475 | plugin_test_4.err: plugin_test_4 | |
1476 | @touch plugin_test_4.err | |
1477 | ||
1478 | plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms | |
1479 | $(TEST_AR) cr $@ $^ | |
1480 | ||
24998053 CC |
1481 | check_PROGRAMS += plugin_test_5 |
1482 | 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 | |
1483 | $(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 | |
1484 | ||
be234d88 CC |
1485 | check_PROGRAMS += plugin_test_6 |
1486 | check_SCRIPTS += plugin_test_6.sh | |
1487 | check_DATA += plugin_test_6.err | |
1488 | MOSTLYCLEANFILES += plugin_test_6.err | |
1489 | plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so | |
1490 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err | |
1491 | plugin_test_6.err: plugin_test_6 | |
1492 | @touch plugin_test_6.err | |
1493 | ||
5e0f337e RÁE |
1494 | check_PROGRAMS += plugin_test_7 |
1495 | check_SCRIPTS += plugin_test_7.sh | |
1496 | check_DATA += plugin_test_7.err plugin_test_7.syms | |
1497 | MOSTLYCLEANFILES += plugin_test_7.err | |
1498 | plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so | |
1499 | $(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 | |
1500 | plugin_test_7.syms: plugin_test_7 | |
1501 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1502 | plugin_test_7_1.o: plugin_test_7_1.c | |
1503 | $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1504 | plugin_test_7_1_orig.o: plugin_test_7_1.c | |
1505 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1506 | plugin_test_7_1.syms: plugin_test_7_1_orig.o | |
1507 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1508 | plugin_test_7_2.o: plugin_test_7_2.c | |
1509 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1510 | plugin_test_7.err: plugin_test_7 | |
1511 | ||
f3a2388f CC |
1512 | # Test plugins with -r. |
1513 | check_PROGRAMS += plugin_test_8 | |
1514 | 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 | |
1515 | ../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 | |
1516 | plugin_test_8: plugin_test_8.o gcctestdir/ld | |
1517 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o | |
1518 | ||
1519 | # Test that symbols known in the IR file but not in the replacement file | |
1520 | # produce an unresolved symbol error. | |
1521 | check_DATA += plugin_test_9.err | |
1522 | MOSTLYCLEANFILES += plugin_test_9.err | |
1523 | plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so | |
1524 | @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>$@" | |
1525 | @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 \ | |
1526 | echo 1>&2 "Link of plugin_test_9 should have failed"; \ | |
1527 | rm -f $@; \ | |
1528 | exit 1; \ | |
1529 | fi | |
1530 | # Make a .syms file that claims to define the symbol _Z4t16av. | |
1531 | two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o | |
1532 | cp two_file_test_1.syms $@.tmp | |
1533 | grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp | |
1534 | mv -f $@.tmp $@ | |
1535 | # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. | |
1536 | MOSTLYCLEANFILES += two_file_test_1c.o | |
1537 | two_file_test_1c.o: two_file_test_1.o | |
1538 | cp two_file_test_1.o $@ | |
1539 | ||
89fc3421 CC |
1540 | plugin_test.so: plugin_test.o |
1541 | $(LINK) -Bgcctestdir/ -shared plugin_test.o | |
1542 | plugin_test.o: plugin_test.c | |
1543 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1544 | ||
1545 | two_file_test_main.syms: two_file_test_main.o | |
1546 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1547 | two_file_test_1.syms: two_file_test_1.o | |
1548 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1549 | two_file_test_1b.syms: two_file_test_1b.o | |
1550 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1551 | two_file_test_2.syms: two_file_test_2.o | |
1552 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
be234d88 CC |
1553 | plugin_common_test_1.syms: plugin_common_test_1.o |
1554 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1555 | plugin_common_test_2.syms: plugin_common_test_2.o | |
1556 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
24998053 | 1557 | |
abc8dcba | 1558 | empty.syms: |
24998053 CC |
1559 | @echo "" >$@ |
1560 | @echo "Symbol table" >>$@ | |
1561 | ||
1562 | MOSTLYCLEANFILES += unused.c | |
1563 | unused.syms: unused.o | |
1564 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1565 | @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ | |
1566 | unused.o: unused.c | |
1567 | $(COMPILE) -c -o $@ $< | |
1568 | unused.c: | |
1569 | @cp /dev/null $@ | |
89fc3421 | 1570 | |
f0558624 | 1571 | check_SCRIPTS += plugin_final_layout.sh |
16164a6b | 1572 | check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout |
f0558624 ST |
1573 | plugin_final_layout.o: plugin_final_layout.cc |
1574 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< | |
1575 | plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld | |
1576 | $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o | |
1577 | plugin_final_layout.stdout: plugin_final_layout | |
864a1b56 | 1578 | $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout |
16164a6b ST |
1579 | plugin_final_layout_readelf.stdout: plugin_final_layout |
1580 | $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout | |
f0558624 ST |
1581 | |
1582 | plugin_section_order.so: plugin_section_order.o | |
1583 | $(LINK) -Bgcctestdir/ -shared plugin_section_order.o | |
1584 | plugin_section_order.o: plugin_section_order.c | |
1585 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1586 | ||
89fc3421 CC |
1587 | endif PLUGINS |
1588 | ||
65514900 CC |
1589 | check_PROGRAMS += exclude_libs_test |
1590 | check_SCRIPTS += exclude_libs_test.sh | |
1591 | check_DATA += exclude_libs_test.syms | |
1592 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ | |
2fdd743f | 1593 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
65514900 CC |
1594 | exclude_libs_test_SOURCES = exclude_libs_test.c |
1595 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ | |
2fdd743f DK |
1596 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
1597 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ | |
1598 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ | |
1599 | -Wl,--exclude-libs,libexclude_libs_test_3 | |
1600 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ | |
1601 | alt/libexclude_libs_test_3.a | |
65514900 CC |
1602 | exclude_libs_test.syms: exclude_libs_test |
1603 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1604 | libexclude_libs_test_1.a: exclude_libs_test_1.o | |
1605 | $(TEST_AR) rc $@ $^ | |
1606 | libexclude_libs_test_2.a: exclude_libs_test_2.o | |
1607 | $(TEST_AR) rc $@ $^ | |
2fdd743f DK |
1608 | alt/libexclude_libs_test_3.a: exclude_libs_test_3.o |
1609 | test -d alt || mkdir -p alt | |
1610 | $(TEST_AR) rc $@ $^ | |
65514900 | 1611 | |
805bb01c DK |
1612 | check_PROGRAMS += local_labels_test |
1613 | local_labels_test.o: ver_test_6.c | |
1614 | $(COMPILE) -g -c -Wa,-L -o $@ $< | |
1615 | local_labels_test: local_labels_test.o | |
1616 | $(LINK) -Bgcctestdir/ local_labels_test.o | |
1617 | ||
bb04269c DK |
1618 | check_PROGRAMS += discard_locals_test |
1619 | check_SCRIPTS += discard_locals_test.sh | |
d3bbad62 ILT |
1620 | check_DATA += discard_locals_test.syms \ |
1621 | discard_locals_relocatable_test1.syms \ | |
1622 | discard_locals_relocatable_test2.syms | |
1623 | MOSTLYCLEANFILES += discard_locals_test.syms \ | |
1624 | discard_locals_relocatable_test1.syms \ | |
1625 | discard_locals_relocatable_test2.syms \ | |
1626 | discard_locals_relocatable_test1.out \ | |
1627 | discard_locals_relocatable_test2.out | |
bb04269c DK |
1628 | discard_locals_test_SOURCES = discard_locals_test.c |
1629 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals | |
1630 | discard_locals_test.syms: discard_locals_test | |
1631 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1632 | # '-Wa,-L' is required to preserve the local label used for testing. | |
1633 | discard_locals_test.o: discard_locals_test.c | |
1634 | $(COMPILE) -c -Wa,-L -o $@ $< | |
1635 | ||
d3bbad62 ILT |
1636 | discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out |
1637 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1638 | discard_locals_relocatable_test.o: discard_locals_relocatable_test.c | |
1639 | $(COMPILE) -c -Wa,-L -fPIC -o $@ $< | |
1640 | discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new | |
1641 | ../ld-new --discard-locals -relocatable -o $@ $< | |
1642 | ||
1643 | discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out | |
1644 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1645 | discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new | |
1646 | ../ld-new --discard-all -relocatable -o $@ $< | |
1647 | ||
8a5e3e08 ILT |
1648 | if MCMODEL_MEDIUM |
1649 | check_PROGRAMS += large | |
1650 | large_SOURCES = large.c | |
1651 | large_CFLAGS = -mcmodel=medium | |
1652 | large_DEPENDENCIES = gcctestdir/ld | |
1653 | large_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 1654 | large_LDADD = |
8a5e3e08 ILT |
1655 | endif MCMODEL_MEDIUM |
1656 | ||
645afe0c CC |
1657 | # Test that hidden and internal symbols in the main program cannot be |
1658 | # referenced by a shared library. | |
1659 | check_SCRIPTS += hidden_test.sh | |
1660 | check_DATA += hidden_test.err | |
1661 | MOSTLYCLEANFILES += hidden_test hidden_test.err | |
1662 | libhidden.so: hidden_test_1.c gcctestdir/ld | |
1663 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c | |
1664 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld | |
1665 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err | |
1666 | hidden_test.err: hidden_test | |
1667 | @touch hidden_test.err | |
1668 | ||
8c604651 CS |
1669 | # Test -retain-symbols-file. |
1670 | check_SCRIPTS += retain_symbols_file_test.sh | |
1671 | check_DATA += retain_symbols_file_test.stdout | |
1672 | MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \ | |
1673 | retain_symbols_file_test.stdout | |
1674 | retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld | |
1675 | echo 'main' > retain_symbols_file_test.in | |
1676 | echo 't1' >> retain_symbols_file_test.in | |
1677 | echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in | |
1678 | echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in | |
1679 | echo '_Z3t18v' >> retain_symbols_file_test.in | |
1680 | echo '__tcf_0' >> retain_symbols_file_test.in | |
1681 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o | |
1682 | retain_symbols_file_test.stdout: retain_symbols_file_test.so | |
1683 | $(TEST_NM) -C retain_symbols_file_test.so > $@ | |
1684 | ||
1685 | ||
6a89f575 CC |
1686 | # Test that if the output file already exists and is empty, |
1687 | # it will get execute permission. | |
1688 | check_PROGRAMS += permission_test | |
1689 | permission_test: basic_test.o gcctestdir/ld | |
1690 | umask 022; \ | |
1691 | rm -f $@; \ | |
1692 | touch $@; \ | |
1693 | chmod 600 $@; \ | |
1694 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
1695 | ||
ae3b5189 CD |
1696 | # Check -l:foo.a |
1697 | check_PROGRAMS += searched_file_test | |
1698 | MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \ | |
1699 | alt/searched_file_test_lib.a | |
1700 | searched_file_test_SOURCES = searched_file_test.cc | |
1701 | searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a | |
1702 | searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt | |
1703 | searched_file_test_LDADD = -l:searched_file_test_lib.a | |
1704 | searched_file_test_lib.o: searched_file_test_lib.cc | |
1705 | $(CXXCOMPILE) -c -o $@ $< | |
1706 | alt/searched_file_test_lib.a: searched_file_test_lib.o | |
1707 | test -d alt || mkdir -p alt | |
1708 | $(TEST_AR) rc $@ $^ | |
1709 | ||
c5617f2f DK |
1710 | # Test that no .gnu.version sections are created when |
1711 | # symbol versioning is not used. | |
1712 | check_SCRIPTS += no_version_test.sh | |
1713 | check_DATA += no_version_test.stdout | |
1714 | MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout | |
1715 | # We invoke the linker directly since gcc may include additional objects that | |
1716 | # uses symbol versioning. | |
1717 | libno_version_test.so: no_version_test.o gcctestdir/ld | |
1718 | gcctestdir/ld -shared -o $@ no_version_test.o | |
1719 | no_version_test.o: no_version_test.c | |
1720 | $(COMPILE) -o $@ -c -fPIC $< | |
1721 | no_version_test.stdout: libno_version_test.so | |
1722 | $(TEST_OBJDUMP) -h $< > $@ | |
1723 | ||
7223e9ca ILT |
1724 | # Test STT_GNU_IFUNC symbols. |
1725 | if IFUNC | |
1726 | ||
1727 | ifuncmod1.o: ifuncmod1.c | |
661d7a80 | 1728 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1729 | ifuncmod1.so: ifuncmod1.o gcctestdir/ld |
1730 | $(LINK) -Bgcctestdir/ -shared ifuncmod1.o | |
1731 | ||
1732 | ifuncdep1.o: ifuncmod1.c | |
1733 | $(COMPILE) -c -o $@ $< | |
1734 | ||
1735 | ifuncmain1pic.o: ifuncmain1.c | |
661d7a80 | 1736 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 1737 | ifuncmain1pie.o: ifuncmain1.c |
661d7a80 | 1738 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca | 1739 | |
328c7c2f | 1740 | if HAVE_STATIC |
ebb300b2 | 1741 | if IFUNC_STATIC |
7223e9ca ILT |
1742 | check_PROGRAMS += ifuncmain1static |
1743 | ifuncmain1static_SOURCES = ifuncmain1.c | |
1744 | ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o | |
1745 | ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static | |
1746 | ifuncmain1static_LDADD = ifuncdep1.o | |
1747 | ||
1748 | check_PROGRAMS += ifuncmain1picstatic | |
1749 | ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
1750 | $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o | |
328c7c2f | 1751 | endif |
ebb300b2 | 1752 | endif |
7223e9ca ILT |
1753 | |
1754 | check_PROGRAMS += ifuncmain1 | |
1755 | ifuncmain1_SOURCES = ifuncmain1.c | |
1756 | ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
1757 | ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1758 | ifuncmain1_LDADD = ifuncmod1.so | |
1759 | ||
1760 | check_PROGRAMS += ifuncmain1pic | |
1761 | ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld | |
1762 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
1763 | ||
1764 | check_PROGRAMS += ifuncmain1vis | |
1765 | ifuncmain1vis_SOURCES = ifuncmain1vis.c | |
1766 | ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
1767 | ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1768 | ifuncmain1vis_LDADD = ifuncmod1.so | |
1769 | ||
1770 | check_PROGRAMS += ifuncmain1vispic | |
1771 | ifuncmain1vispic.o: ifuncmain1vis.c | |
661d7a80 | 1772 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1773 | ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld |
1774 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
1775 | ||
1776 | check_PROGRAMS += ifuncmain1staticpic | |
1777 | ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
1778 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o | |
1779 | ||
1780 | check_PROGRAMS += ifuncmain1pie | |
1781 | ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld | |
1782 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,. | |
1783 | ||
1784 | check_PROGRAMS += ifuncmain1vispie | |
1785 | ifuncmain1vispie.o: ifuncmain1vis.c | |
661d7a80 | 1786 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
1787 | ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld |
1788 | $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. | |
1789 | ||
1790 | check_PROGRAMS += ifuncmain1staticpie | |
1791 | ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld | |
1792 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o | |
1793 | ||
1794 | ifuncmain2pic.o: ifuncmain2.c | |
661d7a80 | 1795 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1796 | |
1797 | ifuncdep2pic.o: ifuncdep2.c | |
661d7a80 | 1798 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 1799 | |
328c7c2f | 1800 | if HAVE_STATIC |
ebb300b2 | 1801 | if IFUNC_STATIC |
7223e9ca ILT |
1802 | check_PROGRAMS += ifuncmain2static |
1803 | ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c | |
1804 | ifuncmain2static_DEPENDENCIES = gcctestdir/ld | |
1805 | ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1806 | ifuncmain2static_LDADD = |
7223e9ca ILT |
1807 | |
1808 | check_PROGRAMS += ifuncmain2picstatic | |
1809 | ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
1810 | $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o | |
328c7c2f | 1811 | endif |
ebb300b2 | 1812 | endif |
7223e9ca ILT |
1813 | |
1814 | check_PROGRAMS += ifuncmain2 | |
1815 | ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c | |
1816 | ifuncmain2_DEPENDENCIES = gcctestdir/ld | |
1817 | ifuncmain2_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1818 | ifuncmain2_LDADD = |
7223e9ca ILT |
1819 | |
1820 | check_PROGRAMS += ifuncmain2pic | |
1821 | ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
1822 | $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o | |
1823 | ||
1824 | ifuncmod3.o: ifuncmod3.c | |
661d7a80 | 1825 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1826 | ifuncmod3.so: ifuncmod3.o gcctestdir/ld |
1827 | $(LINK) -Bgcctestdir/ -shared ifuncmod3.o | |
1828 | ||
1829 | check_PROGRAMS += ifuncmain3 | |
1830 | ifuncmain3_SOURCES = ifuncmain3.c | |
1831 | ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so | |
1832 | ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,. | |
1833 | ifuncmain3_LDADD = -ldl | |
1834 | ||
1835 | ifuncmain4pic.o: ifuncmain4.c | |
661d7a80 | 1836 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 1837 | |
328c7c2f | 1838 | if HAVE_STATIC |
ebb300b2 | 1839 | if IFUNC_STATIC |
7223e9ca ILT |
1840 | check_PROGRAMS += ifuncmain4static |
1841 | ifuncmain4static_SOURCES = ifuncmain4.c | |
1842 | ifuncmain4static_DEPENDENCIES = gcctestdir/ld | |
1843 | ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1844 | ifuncmain4static_LDADD = |
7223e9ca ILT |
1845 | |
1846 | check_PROGRAMS += ifuncmain4picstatic | |
1847 | ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld | |
1848 | $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o | |
328c7c2f | 1849 | endif |
ebb300b2 | 1850 | endif |
7223e9ca ILT |
1851 | |
1852 | check_PROGRAMS += ifuncmain4 | |
1853 | ifuncmain4_SOURCES = ifuncmain4.c | |
1854 | ifuncmain4_DEPENDENCIES = gcctestdir/ld | |
1855 | ifuncmain4_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1856 | ifuncmain4_LDADD = |
7223e9ca ILT |
1857 | |
1858 | ifuncmain5pic.o: ifuncmain5.c | |
661d7a80 | 1859 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1860 | |
1861 | ifuncmain5pie.o: ifuncmain5.c | |
661d7a80 | 1862 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
1863 | |
1864 | ifuncmod5.o: ifuncmod5.c | |
661d7a80 | 1865 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1866 | ifuncmod5.so: ifuncmod5.o gcctestdir/ld |
1867 | $(LINK) -Bgcctestdir/ -shared ifuncmod5.o | |
1868 | ||
1869 | ifuncdep5.o: ifuncmod5.c | |
1870 | $(COMPILE) -c -o $@ $< | |
1871 | ||
328c7c2f | 1872 | if HAVE_STATIC |
ebb300b2 | 1873 | if IFUNC_STATIC |
7223e9ca ILT |
1874 | check_PROGRAMS += ifuncmain5static |
1875 | ifuncmain5static_SOURCES = ifuncmain5.c | |
1876 | ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o | |
1877 | ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static | |
1878 | ifuncmain5static_LDADD = ifuncdep5.o | |
1879 | ||
1880 | check_PROGRAMS += ifuncmain5picstatic | |
1881 | ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
1882 | $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o | |
328c7c2f | 1883 | endif |
ebb300b2 | 1884 | endif |
7223e9ca ILT |
1885 | |
1886 | check_PROGRAMS += ifuncmain5 | |
1887 | ifuncmain5_SOURCES = ifuncmain5.c | |
1888 | ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so | |
1889 | ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1890 | ifuncmain5_LDADD = ifuncmod5.so | |
1891 | ||
1892 | check_PROGRAMS += ifuncmain5pic | |
1893 | ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld | |
1894 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,. | |
1895 | ||
1896 | check_PROGRAMS += ifuncmain5staticpic | |
1897 | ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
1898 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o | |
1899 | ||
1900 | check_PROGRAMS += ifuncmain5pie | |
1901 | ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld | |
1902 | $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. | |
1903 | ||
1904 | ifuncmain6pie.o: ifuncmain6pie.c | |
661d7a80 | 1905 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
1906 | |
1907 | ifuncmod6.o: ifuncmod6.c | |
661d7a80 | 1908 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1909 | ifuncmod6.so: ifuncmod6.o gcctestdir/ld |
1910 | $(LINK) -Bgcctestdir/ -shared ifuncmod6.o | |
1911 | ||
1912 | check_PROGRAMS += ifuncmain6pie | |
1913 | ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld | |
1914 | $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. | |
1915 | ||
1916 | ifuncmain7pic.o: ifuncmain7.c | |
661d7a80 | 1917 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1918 | |
1919 | ifuncmain7pie.o: ifuncmain7.c | |
661d7a80 | 1920 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca | 1921 | |
328c7c2f | 1922 | if HAVE_STATIC |
ebb300b2 | 1923 | if IFUNC_STATIC |
7223e9ca ILT |
1924 | check_PROGRAMS += ifuncmain7static |
1925 | ifuncmain7static_SOURCES = ifuncmain7.c | |
1926 | ifuncmain7static_DEPENDENCIES = gcctestdir/ld | |
1927 | ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1928 | ifuncmain7static_LDADD = |
7223e9ca ILT |
1929 | |
1930 | check_PROGRAMS += ifuncmain7picstatic | |
1931 | ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld | |
1932 | $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o | |
328c7c2f | 1933 | endif |
ebb300b2 | 1934 | endif |
7223e9ca ILT |
1935 | |
1936 | check_PROGRAMS += ifuncmain7 | |
1937 | ifuncmain7_SOURCES = ifuncmain7.c | |
1938 | ifuncmain7_DEPENDENCIES = gcctestdir/ld | |
1939 | ifuncmain7_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1940 | ifuncmain7_LDADD = |
7223e9ca ILT |
1941 | |
1942 | check_PROGRAMS += ifuncmain7pic | |
1943 | ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld | |
1944 | $(LINK) -Bgcctestdir/ ifuncmain7pic.o | |
1945 | ||
1946 | check_PROGRAMS += ifuncmain7pie | |
1947 | ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld | |
1948 | $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o | |
1949 | ||
67181c72 ILT |
1950 | check_PROGRAMS += ifuncvar |
1951 | ifuncvar1_pic.o: ifuncvar1.c | |
661d7a80 | 1952 | $(COMPILE) -c -fPIC -o $@ $< |
67181c72 | 1953 | ifuncvar2_pic.o: ifuncvar2.c |
661d7a80 | 1954 | $(COMPILE) -c -fPIC -o $@ $< |
67181c72 ILT |
1955 | ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld |
1956 | $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o | |
1957 | ifuncvar_SOURCES = ifuncvar3.c | |
1958 | ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so | |
1959 | ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1960 | ifuncvar_LDADD = ifuncvar.so | |
1961 | ||
7223e9ca ILT |
1962 | endif IFUNC |
1963 | ||
74f67560 DK |
1964 | # Test that strong reference to a weak symbol in a DSO remains strong. |
1965 | check_SCRIPTS += strong_ref_weak_def.sh | |
1966 | check_DATA += strong_ref_weak_def.stdout | |
1967 | MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \ | |
1968 | strong_ref_weak_def.stdout | |
1969 | strong_ref_weak_def_2.o: strong_ref_weak_def_2.c | |
1970 | $(COMPILE) -o $@ -c -fPIC $< | |
1971 | strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld | |
1972 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o | |
1973 | strong_ref_weak_def_1.o: strong_ref_weak_def_1.c | |
1974 | $(COMPILE) -o $@ -c -fPIC $< | |
1975 | strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \ | |
1976 | gcctestdir/ld | |
1977 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \ | |
1978 | strong_ref_weak_def_2.so | |
1979 | strong_ref_weak_def.stdout: strong_ref_weak_def_1.so | |
1980 | $(TEST_READELF) -sWD $< > $@ | |
1981 | ||
a4649286 DK |
1982 | # Test that a strong weak reference remains strong if there is another |
1983 | # weak reference in a DSO. | |
1984 | check_SCRIPTS += dyn_weak_ref.sh | |
1985 | check_DATA += dyn_weak_ref.stdout | |
1986 | MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \ | |
1987 | dyn_weak_ref.stdout | |
1988 | dyn_weak_ref_2.o: dyn_weak_ref_2.c | |
1989 | $(COMPILE) -o $@ -c -fPIC $< | |
1990 | dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld | |
1991 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o | |
1992 | dyn_weak_ref_1.o: dyn_weak_ref_1.c | |
1993 | $(COMPILE) -o $@ -c -fPIC $< | |
1994 | # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o | |
1995 | # so that the weak ref there goes to gold's symbol table first. | |
1996 | dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld | |
1997 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o | |
1998 | dyn_weak_ref.stdout: dyn_weak_ref_1.so | |
1999 | $(TEST_READELF) -sWD $< > $@ | |
2000 | ||
2001 | ||
97b4be1c CC |
2002 | # Test that --start-lib and --end-lib function correctly. |
2003 | check_PROGRAMS += start_lib_test | |
2004 | start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \ | |
2005 | gcctestdir/ld | |
2006 | $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \ | |
2007 | -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib | |
2008 | libstart_lib_test.a: start_lib_test_1.o | |
2009 | $(TEST_AR) rc $@ $^ | |
2010 | ||
7f8cd844 NC |
2011 | # Test that MEMORY region support works. |
2012 | check_SCRIPTS += memory_test.sh | |
2013 | check_DATA += memory_test.stdout | |
2014 | MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o | |
d4d91489 ILT |
2015 | memory_test.o: memory_test.s |
2016 | $(COMPILE) -o $@ -c $< | |
2017 | memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t | |
864a1b56 | 2018 | $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -T $(srcdir)/memory_test.t -o $@ memory_test.o |
7f8cd844 | 2019 | memory_test.stdout: memory_test |
41a8542a | 2020 | $(TEST_READELF) -lWS $< > $@ |
7f8cd844 | 2021 | |
f1415016 CC |
2022 | if HAVE_PUBNAMES |
2023 | ||
2024 | # Test that --gdb-index functions correctly without gcc-generated pubnames. | |
c1027032 CC |
2025 | check_SCRIPTS += gdb_index_test_1.sh |
2026 | check_DATA += gdb_index_test_1.stdout | |
2027 | MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1 | |
2028 | gdb_index_test.o: gdb_index_test.cc | |
f1415016 | 2029 | $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $< |
c1027032 CC |
2030 | gdb_index_test_1: gdb_index_test.o gcctestdir/ld |
2031 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2032 | gdb_index_test_1.stdout: gdb_index_test_1 | |
2033 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2034 | ||
2035 | if HAVE_ZLIB | |
2036 | ||
f1415016 | 2037 | # Test that --gdb-index functions correctly with compressed debug sections. |
c1027032 CC |
2038 | check_SCRIPTS += gdb_index_test_2.sh |
2039 | check_DATA += gdb_index_test_2.stdout | |
2040 | MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 | |
2041 | gdb_index_test_cdebug.o: gdb_index_test.cc | |
2042 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $< | |
2043 | gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld | |
2044 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2045 | gdb_index_test_2.stdout: gdb_index_test_2 | |
2046 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2047 | ||
2048 | endif HAVE_ZLIB | |
2049 | ||
f1415016 | 2050 | # Another simple C test (DW_AT_high_pc encoding) for --gdb-index. |
57923f48 MW |
2051 | check_SCRIPTS += gdb_index_test_3.sh |
2052 | check_DATA += gdb_index_test_3.stdout | |
2053 | MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3 | |
2054 | gdb_index_test_3.o: gdb_index_test_3.c | |
2055 | $(COMPILE) -O0 -g -c -o $@ $< | |
2056 | gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld | |
2057 | $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $< | |
2058 | gdb_index_test_3.stdout: gdb_index_test_3 | |
2059 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2060 | ||
f1415016 CC |
2061 | # Test that --gdb-index functions correctly with gcc-generated pubnames. |
2062 | check_SCRIPTS += gdb_index_test_4.sh | |
2063 | check_DATA += gdb_index_test_4.stdout | |
2064 | MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4 | |
2065 | gdb_index_test_pub.o: gdb_index_test.cc | |
2066 | $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $< | |
2067 | gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld | |
2068 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2069 | gdb_index_test_4.stdout: gdb_index_test_4 | |
2070 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2071 | ||
2072 | endif HAVE_PUBNAMES | |
57923f48 | 2073 | |
2eedd706 CC |
2074 | # End-to-end incremental linking tests. |
2075 | # Incremental linking is currently supported only on the x86_64 target. | |
2076 | ||
2077 | if DEFAULT_TARGET_X86_64 | |
2078 | ||
33c15b45 CC |
2079 | two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc |
2080 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2081 | two_file_test_1_ndebug.o: two_file_test_1.cc | |
2082 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2083 | two_file_test_1b_ndebug.o: two_file_test_1b.cc | |
2084 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2085 | two_file_test_2_ndebug.o: two_file_test_2.cc | |
2086 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2087 | two_file_test_main_ndebug.o: two_file_test_main.cc | |
2088 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2089 | ||
2eedd706 | 2090 | check_PROGRAMS += incremental_test_2 |
c49875be | 2091 | MOSTLYCLEANFILES += two_file_test_tmp_2.o |
33c15b45 CC |
2092 | incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \ |
2093 | two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld | |
2094 | cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o | |
2095 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o | |
2eedd706 | 2096 | @sleep 1 |
33c15b45 CC |
2097 | cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o |
2098 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o | |
2eedd706 CC |
2099 | |
2100 | check_PROGRAMS += incremental_test_3 | |
c49875be | 2101 | MOSTLYCLEANFILES += two_file_test_tmp_3.o |
2eedd706 CC |
2102 | incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ |
2103 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
c49875be | 2104 | cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o |
8ea8cd50 | 2105 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o |
2eedd706 | 2106 | @sleep 1 |
c49875be ILT |
2107 | cp -f two_file_test_1b.o two_file_test_tmp_3.o |
2108 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o | |
2eedd706 CC |
2109 | |
2110 | check_PROGRAMS += incremental_test_4 | |
c49875be | 2111 | MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o |
2eedd706 CC |
2112 | incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ |
2113 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
c49875be | 2114 | cp -f two_file_test_2_v1.o two_file_test_tmp_4.o |
8ea8cd50 | 2115 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o |
aa92d6ed | 2116 | mv -f incremental_test_4 incremental_test_4.base |
2eedd706 | 2117 | @sleep 1 |
c49875be ILT |
2118 | cp -f two_file_test_2.o two_file_test_tmp_4.o |
2119 | $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o | |
2eedd706 | 2120 | |
e24719f6 CC |
2121 | check_PROGRAMS += incremental_test_5 |
2122 | MOSTLYCLEANFILES += two_file_test_5.a | |
2123 | incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
2124 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
2125 | cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o | |
2126 | $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o | |
8ea8cd50 | 2127 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a |
e24719f6 CC |
2128 | @sleep 1 |
2129 | cp -f two_file_test_1b.o two_file_test_tmp_5.o | |
2130 | $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o | |
2131 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o two_file_test_5.a | |
2132 | ||
2133 | # Test the --incremental-unchanged flag with an archive library. | |
2134 | # The second link should not update the library. | |
2135 | check_PROGRAMS += incremental_test_6 | |
2136 | MOSTLYCLEANFILES += two_file_test_6.a | |
2137 | incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
2138 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
2139 | cp -f two_file_test_1b.o two_file_test_tmp_6.o | |
2140 | $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o | |
8ea8cd50 | 2141 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a |
e24719f6 CC |
2142 | @sleep 1 |
2143 | cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o | |
2144 | $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o | |
2145 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown | |
2146 | ||
a5ee4d5d CC |
2147 | check_PROGRAMS += incremental_copy_test |
2148 | incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so | |
2149 | cp -f copy_test_v1.o copy_test_tmp.o | |
59965708 | 2150 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so |
a5ee4d5d CC |
2151 | @sleep 1 |
2152 | cp -f copy_test.o copy_test_tmp.o | |
59965708 | 2153 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so |
a5ee4d5d CC |
2154 | |
2155 | check_PROGRAMS += incremental_common_test_1 | |
2156 | incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld | |
2157 | cp -f common_test_1_v1.o common_test_1_tmp.o | |
8ea8cd50 | 2158 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o |
a5ee4d5d CC |
2159 | @sleep 1 |
2160 | cp -f common_test_1_v2.o common_test_1_tmp.o | |
2161 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o | |
2162 | ||
1206d0d5 CC |
2163 | check_PROGRAMS += incremental_comdat_test_1 |
2164 | incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld | |
2165 | cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o | |
2166 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o | |
2167 | @sleep 1 | |
2168 | cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o | |
2169 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o | |
2170 | @sleep 1 | |
2171 | cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o | |
2172 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o | |
2173 | ||
2eedd706 CC |
2174 | endif DEFAULT_TARGET_X86_64 |
2175 | ||
351a8000 ILT |
2176 | endif GCC |
2177 | endif NATIVE_LINKER | |
364c7fa5 | 2178 | |
eb373049 ILT |
2179 | # These tests work with native and cross linkers. |
2180 | ||
2181 | if NATIVE_OR_CROSS_LINKER | |
2182 | ||
2183 | # Test script section order. | |
2184 | check_SCRIPTS += script_test_10.sh | |
2185 | check_DATA += script_test_10.stdout | |
2186 | script_test_10.o: script_test_10.s | |
2187 | $(TEST_AS) -o $@ $< | |
2188 | script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld | |
2189 | gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t | |
2190 | script_test_10.stdout: script_test_10 | |
2191 | $(TEST_READELF) -SW script_test_10 > $@ | |
2192 | ||
2193 | # These tests work with cross linkers only. | |
364c7fa5 ILT |
2194 | |
2195 | if DEFAULT_TARGET_I386 | |
2196 | ||
2197 | check_SCRIPTS += split_i386.sh | |
2198 | check_DATA += split_i386_1.stdout split_i386_2.stdout \ | |
2199 | split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout | |
2200 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
2201 | split_i386_1.o: split_i386_1.s | |
2202 | $(TEST_AS) -o $@ $< | |
2203 | split_i386_2.o: split_i386_2.s | |
2204 | $(TEST_AS) -o $@ $< | |
2205 | split_i386_3.o: split_i386_3.s | |
2206 | $(TEST_AS) -o $@ $< | |
2207 | split_i386_4.o: split_i386_4.s | |
2208 | $(TEST_AS) -o $@ $< | |
2209 | split_i386_n.o: split_i386_n.s | |
2210 | $(TEST_AS) -o $@ $< | |
2211 | split_i386_1: split_i386_1.o split_i386_n.o ../ld-new | |
2212 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o | |
2213 | split_i386_1.stdout: split_i386_1 | |
2214 | $(TEST_OBJDUMP) -d $< > $@ | |
2215 | split_i386_2: split_i386_2.o split_i386_n.o ../ld-new | |
2216 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o | |
2217 | split_i386_2.stdout: split_i386_2 | |
2218 | $(TEST_OBJDUMP) -d $< > $@ | |
2219 | split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new | |
2220 | ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0 | |
2221 | split_i386_4: split_i386_4.o split_i386_n.o ../ld-new | |
2222 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o | |
2223 | split_i386_4.stdout: split_i386_4 | |
2224 | $(TEST_OBJDUMP) -d $< > $@ | |
2225 | split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new | |
2226 | ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0 | |
2227 | MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \ | |
2228 | split_i386_4 split_i386_r | |
2229 | ||
2230 | endif DEFAULT_TARGET_I386 | |
2231 | ||
2232 | if DEFAULT_TARGET_X86_64 | |
2233 | ||
2234 | check_SCRIPTS += split_x86_64.sh | |
2235 | check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \ | |
2236 | split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout | |
2237 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
2238 | split_x86_64_1.o: split_x86_64_1.s | |
2239 | $(TEST_AS) -o $@ $< | |
2240 | split_x86_64_2.o: split_x86_64_2.s | |
2241 | $(TEST_AS) -o $@ $< | |
2242 | split_x86_64_3.o: split_x86_64_3.s | |
2243 | $(TEST_AS) -o $@ $< | |
2244 | split_x86_64_4.o: split_x86_64_4.s | |
2245 | $(TEST_AS) -o $@ $< | |
2246 | split_x86_64_n.o: split_x86_64_n.s | |
2247 | $(TEST_AS) -o $@ $< | |
2248 | split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
2249 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o | |
2250 | split_x86_64_1.stdout: split_x86_64_1 | |
2251 | $(TEST_OBJDUMP) -d $< > $@ | |
2252 | split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new | |
2253 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o | |
2254 | split_x86_64_2.stdout: split_x86_64_2 | |
2255 | $(TEST_OBJDUMP) -d $< > $@ | |
2256 | split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new | |
2257 | ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0 | |
2258 | split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new | |
2259 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o | |
2260 | split_x86_64_4.stdout: split_x86_64_4 | |
2261 | $(TEST_OBJDUMP) -d $< > $@ | |
2262 | split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
2263 | ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 | |
2264 | MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ | |
2265 | split_x86_64_4 split_x86_64_r | |
2266 | ||
2267 | endif DEFAULT_TARGET_X86_64 | |
e4782e83 DK |
2268 | |
2269 | if DEFAULT_TARGET_ARM | |
2270 | ||
2271 | check_SCRIPTS += arm_abs_global.sh | |
2272 | check_DATA += arm_abs_global.stdout | |
2273 | arm_abs_lib.o: arm_abs_lib.s | |
2274 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 2275 | libarm_abs.so: arm_abs_lib.o ../ld-new |
e4782e83 DK |
2276 | ../ld-new -shared -o $@ arm_abs_lib.o |
2277 | arm_abs_global.o: arm_abs_global.s | |
2278 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 2279 | arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new |
e4782e83 DK |
2280 | ../ld-new -o $@ arm_abs_global.o -L. -larm_abs |
2281 | arm_abs_global.stdout: arm_abs_global | |
2282 | $(TEST_READELF) -r $< > $@ | |
2283 | ||
2284 | MOSTLYCLEANFILES += arm_abs_global | |
2285 | ||
aa98ff75 | 2286 | check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh |
2a2b6d42 DK |
2287 | check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \ |
2288 | thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \ | |
a2c7281b DK |
2289 | thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \ |
2290 | thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \ | |
aa98ff75 | 2291 | thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \ |
57eb9b50 DK |
2292 | thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \ |
2293 | arm_thm_jump8.stdout | |
2a2b6d42 DK |
2294 | |
2295 | arm_bl_in_range.stdout: arm_bl_in_range | |
2296 | $(TEST_OBJDUMP) -D $< > $@ | |
2297 | ||
d3bbad62 | 2298 | arm_bl_in_range: arm_bl_in_range.o ../ld-new |
2a2b6d42 DK |
2299 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
2300 | ||
2301 | arm_bl_in_range.o: arm_bl_in_range.s | |
2302 | $(TEST_AS) -o $@ $< | |
2303 | ||
2304 | arm_bl_out_of_range.stdout: arm_bl_out_of_range | |
2305 | $(TEST_OBJDUMP) -S $< > $@ | |
2306 | ||
d3bbad62 | 2307 | arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
2308 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
2309 | ||
2310 | arm_bl_out_of_range.o: arm_bl_out_of_range.s | |
2311 | $(TEST_AS) -o $@ $< | |
2312 | ||
2313 | thumb_bl_in_range.stdout: thumb_bl_in_range | |
2314 | $(TEST_OBJDUMP) -D $< > $@ | |
2315 | ||
d3bbad62 | 2316 | thumb_bl_in_range: thumb_bl_in_range.o ../ld-new |
a8e2273b | 2317 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2a2b6d42 DK |
2318 | |
2319 | thumb_bl_in_range.o: thumb_bl_in_range.s | |
2320 | $(TEST_AS) -o $@ -march=armv5te $< | |
2321 | ||
2322 | thumb_bl_out_of_range.stdout: thumb_bl_out_of_range | |
2323 | $(TEST_OBJDUMP) -D $< > $@ | |
2324 | ||
a2c7281b | 2325 | thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new |
a8e2273b | 2326 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2a2b6d42 | 2327 | |
a2c7281b | 2328 | thumb_bl_out_of_range.o: thumb_bl_out_of_range.s |
2a2b6d42 DK |
2329 | $(TEST_AS) -o $@ -march=armv5te $< |
2330 | ||
2331 | thumb2_bl_in_range.stdout: thumb2_bl_in_range | |
2332 | $(TEST_OBJDUMP) -D $< > $@ | |
2333 | ||
d3bbad62 | 2334 | thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new |
2a2b6d42 DK |
2335 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2336 | ||
2337 | thumb2_bl_in_range.o: thumb_bl_in_range.s | |
2338 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2339 | ||
2340 | thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range | |
2341 | $(TEST_OBJDUMP) -D $< > $@ | |
2342 | ||
a2c7281b | 2343 | thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
2344 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2345 | ||
a2c7281b DK |
2346 | thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s |
2347 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2348 | ||
2349 | thumb_blx_in_range.stdout: thumb_blx_in_range | |
2350 | $(TEST_OBJDUMP) -D $< > $@ | |
2351 | ||
2352 | thumb_blx_in_range: thumb_blx_in_range.o ../ld-new | |
a8e2273b | 2353 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
a2c7281b DK |
2354 | |
2355 | thumb_blx_in_range.o: thumb_blx_in_range.s | |
2356 | $(TEST_AS) -o $@ -march=armv5te $< | |
2357 | ||
2358 | thumb_blx_out_of_range.stdout: thumb_blx_out_of_range | |
2359 | $(TEST_OBJDUMP) -D $< > $@ | |
2360 | ||
2361 | thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new | |
a8e2273b | 2362 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
a2c7281b DK |
2363 | |
2364 | thumb_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2365 | $(TEST_AS) -o $@ -march=armv5te $< | |
2366 | ||
2367 | thumb2_blx_in_range.stdout: thumb2_blx_in_range | |
2368 | $(TEST_OBJDUMP) -D $< > $@ | |
2369 | ||
2370 | thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new | |
2371 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
2372 | ||
2373 | thumb2_blx_in_range.o: thumb_blx_in_range.s | |
2374 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2375 | ||
2376 | thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range | |
2377 | $(TEST_OBJDUMP) -D $< > $@ | |
2378 | ||
2379 | thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new | |
2380 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
2381 | ||
2382 | thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2a2b6d42 DK |
2383 | $(TEST_AS) -o $@ -march=armv7-a $< |
2384 | ||
aa98ff75 DK |
2385 | thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local |
2386 | $(TEST_OBJDUMP) -D $< > $@ | |
2387 | ||
2388 | thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new | |
a8e2273b | 2389 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
aa98ff75 DK |
2390 | |
2391 | thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s | |
2392 | $(TEST_AS) -o $@ -march=armv5te $< | |
2393 | ||
57eb9b50 DK |
2394 | arm_thm_jump11.stdout: arm_thm_jump11 |
2395 | $(TEST_OBJDUMP) -D $< > $@ | |
2396 | ||
2397 | arm_thm_jump11: arm_thm_jump11.o ../ld-new | |
2398 | ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $< | |
2399 | ||
2400 | arm_thm_jump11.o: arm_thm_jump11.s | |
2401 | $(TEST_AS) -o $@ $< | |
2402 | ||
2403 | arm_thm_jump8.stdout: arm_thm_jump8 | |
2404 | $(TEST_OBJDUMP) -D $< > $@ | |
2405 | ||
2406 | arm_thm_jump8: arm_thm_jump8.o ../ld-new | |
2407 | ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $< | |
2408 | ||
2409 | arm_thm_jump8.o: arm_thm_jump8.s | |
2410 | $(TEST_AS) -o $@ $< | |
2411 | ||
2a2b6d42 | 2412 | MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \ |
a2c7281b DK |
2413 | thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \ |
2414 | thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \ | |
57eb9b50 DK |
2415 | thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \ |
2416 | arm_thm_jump8 | |
2a2b6d42 | 2417 | |
2fd9ae7a DK |
2418 | check_SCRIPTS += arm_fix_v4bx.sh |
2419 | check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \ | |
2420 | arm_no_fix_v4bx.stdout | |
2421 | ||
2422 | arm_fix_v4bx.stdout: arm_fix_v4bx | |
2423 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2424 | ||
d3bbad62 | 2425 | arm_fix_v4bx: arm_fix_v4bx.o ../ld-new |
a8e2273b | 2426 | ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $< |
2fd9ae7a DK |
2427 | |
2428 | arm_fix_v4bx.o: arm_fix_v4bx.s | |
2429 | $(TEST_AS) -o $@ $< | |
2430 | ||
2431 | arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking | |
2432 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2433 | ||
d3bbad62 | 2434 | arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new |
a8e2273b | 2435 | ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $< |
2fd9ae7a DK |
2436 | |
2437 | arm_no_fix_v4bx.stdout: arm_no_fix_v4bx | |
2438 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2439 | ||
d3bbad62 | 2440 | arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new |
a8e2273b | 2441 | ../ld-new --no-fix-arm1176 -o $@ $< |
2fd9ae7a DK |
2442 | |
2443 | MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx | |
2444 | ||
da59ad79 DK |
2445 | check_SCRIPTS += arm_attr_merge.sh |
2446 | check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \ | |
2447 | arm_attr_merge_7.stdout | |
2448 | ||
2449 | arm_attr_merge_6.stdout: arm_attr_merge_6 | |
2450 | $(TEST_READELF) -A $< > $@ | |
2451 | ||
2452 | arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o | |
2453 | ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o | |
2454 | ||
2455 | arm_attr_merge_6a.o: arm_attr_merge_6a.s | |
2456 | $(TEST_AS) -o $@ $< | |
2457 | ||
2458 | arm_attr_merge_6b.o: arm_attr_merge_6b.s | |
2459 | $(TEST_AS) -o $@ $< | |
2460 | ||
2461 | arm_attr_merge_6r.stdout: arm_attr_merge_6r | |
2462 | $(TEST_READELF) -A $< > $@ | |
2463 | ||
2464 | arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o | |
2465 | ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o | |
2466 | ||
2467 | arm_attr_merge_7.stdout: arm_attr_merge_7 | |
2468 | $(TEST_READELF) -A $< > $@ | |
2469 | ||
2470 | arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o | |
2471 | ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o | |
2472 | ||
2473 | arm_attr_merge_7a.o: arm_attr_merge_7a.s | |
2474 | $(TEST_AS) -o $@ $< | |
2475 | ||
2476 | arm_attr_merge_7b.o: arm_attr_merge_7b.s | |
2477 | $(TEST_AS) -o $@ $< | |
2478 | ||
2479 | MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7 | |
2480 | ||
a8e2273b ILT |
2481 | # ARM1176 workaround test. |
2482 | check_SCRIPTS += arm_fix_1176.sh | |
2483 | check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \ | |
2484 | arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \ | |
2485 | arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout | |
2486 | ||
2487 | arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z | |
2488 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2489 | ||
2490 | arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new | |
2491 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2492 | ||
2493 | arm_fix_1176_default_v6z.o: arm_fix_1176.s | |
2494 | $(TEST_AS) -march=armv6z -o $@ $< | |
2495 | ||
2496 | arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z | |
2497 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2498 | ||
2499 | arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new | |
2500 | ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $< | |
2501 | ||
2502 | arm_fix_1176_on_v6z.o: arm_fix_1176.s | |
2503 | $(TEST_AS) -march=armv6z -o $@ $< | |
2504 | ||
2505 | arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z | |
2506 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2507 | ||
2508 | arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new | |
2509 | ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $< | |
2510 | ||
2511 | arm_fix_1176_off_v6z.o: arm_fix_1176.s | |
2512 | $(TEST_AS) -march=armv6z -o $@ $< | |
2513 | ||
2514 | arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te | |
2515 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2516 | ||
2517 | arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new | |
2518 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2519 | ||
2520 | arm_fix_1176_default_v5te.o: arm_fix_1176.s | |
2521 | $(TEST_AS) -march=armv5te -o $@ $< | |
2522 | ||
2523 | arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a | |
2524 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2525 | ||
2526 | arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new | |
2527 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2528 | ||
2529 | arm_fix_1176_default_v7a.o: arm_fix_1176.s | |
2530 | $(TEST_AS) -march=armv7-a -o $@ $< | |
2531 | ||
2532 | arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s | |
2533 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2534 | ||
2535 | arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new | |
2536 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2537 | ||
2538 | arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s | |
2539 | $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $< | |
2540 | ||
2541 | MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \ | |
2542 | arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s | |
2543 | ||
aa98ff75 DK |
2544 | # Cortex-A8 workaround test. |
2545 | ||
2546 | check_SCRIPTS += arm_cortex_a8.sh | |
2547 | check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \ | |
2548 | arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \ | |
2549 | arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout | |
2550 | ||
2551 | arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond | |
2552 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2553 | ||
2554 | arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new | |
2555 | ../ld-new -o $@ $< | |
2556 | ||
2557 | arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s | |
2558 | $(TEST_AS) -o $@ $< | |
2559 | ||
2560 | arm_cortex_a8_b.stdout: arm_cortex_a8_b | |
2561 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2562 | ||
2563 | arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new | |
2564 | ../ld-new --fix-cortex-a8 -o $@ $< | |
2565 | ||
2566 | arm_cortex_a8_b.o: arm_cortex_a8_b.s | |
2567 | $(TEST_AS) -o $@ $< | |
2568 | ||
2569 | arm_cortex_a8_bl.stdout: arm_cortex_a8_bl | |
2570 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2571 | ||
2572 | arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new | |
2573 | ../ld-new -o $@ $< | |
2574 | ||
2575 | arm_cortex_a8_bl.o: arm_cortex_a8_bl.s | |
2576 | $(TEST_AS) -o $@ $< | |
2577 | ||
2578 | arm_cortex_a8_blx.stdout: arm_cortex_a8_blx | |
2579 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2580 | ||
2581 | arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new | |
2582 | ../ld-new -o $@ $< | |
2583 | ||
2584 | arm_cortex_a8_blx.o: arm_cortex_a8_blx.s | |
2585 | $(TEST_AS) -o $@ $< | |
2586 | ||
2587 | arm_cortex_a8_local.stdout: arm_cortex_a8_local | |
2588 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2589 | ||
2590 | arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new | |
2591 | ../ld-new -o $@ $< | |
2592 | ||
2593 | arm_cortex_a8_local.o: arm_cortex_a8_local.s | |
2594 | $(TEST_AS) -o $@ $< | |
2595 | ||
2596 | arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc | |
2597 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2598 | ||
2599 | arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new | |
2600 | ../ld-new -o $@ $< | |
2601 | ||
2602 | arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s | |
2603 | $(TEST_AS) -o $@ $< | |
2604 | ||
2605 | MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \ | |
2606 | arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc | |
2607 | ||
c87e4302 DK |
2608 | check_SCRIPTS += arm_exidx_test.sh |
2609 | check_DATA += arm_exidx_test.stdout | |
2610 | ||
2611 | arm_exidx_test.stdout: arm_exidx_test.so | |
647f1574 | 2612 | $(TEST_READELF) -Sr $< > $@ |
c87e4302 DK |
2613 | |
2614 | arm_exidx_test.so: arm_exidx_test.o ../ld-new | |
2615 | ../ld-new -shared -o $@ $< | |
2616 | ||
2617 | arm_exidx_test.o: arm_exidx_test.s | |
2618 | $(TEST_AS) -o $@ $< | |
2619 | ||
f62a3ca7 DK |
2620 | check_SCRIPTS += pr12826.sh |
2621 | check_DATA += pr12826.stdout | |
2622 | ||
2623 | pr12826.stdout: pr12826.so | |
2624 | $(TEST_READELF) -A $< > $@ | |
2625 | ||
2626 | pr12826.so: pr12826_1.o pr12826_2.o ../ld-new | |
2627 | ../ld-new -shared -o $@ $< | |
2628 | ||
2629 | pr12826_1.o: pr12826_1.s | |
2630 | $(TEST_AS) -o $@ $< | |
2631 | ||
2632 | pr12826_2.o: pr12826_2.s | |
2633 | $(TEST_AS) -o $@ $< | |
c87e4302 | 2634 | |
f6cccc2c | 2635 | check_SCRIPTS += arm_unaligned_reloc.sh |
2c339f71 | 2636 | check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout |
f6cccc2c DK |
2637 | |
2638 | arm_unaligned_reloc.stdout: arm_unaligned_reloc | |
2639 | $(TEST_OBJDUMP) -D $< > $@ | |
2640 | ||
2c339f71 DK |
2641 | arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r |
2642 | $(TEST_OBJDUMP) -Dr $< > $@ | |
2643 | ||
f6cccc2c DK |
2644 | arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new |
2645 | ../ld-new -o $@ $< | |
2646 | ||
2c339f71 DK |
2647 | arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new |
2648 | ../ld-new -r -o $@ $< | |
2649 | ||
f6cccc2c DK |
2650 | arm_unaligned_reloc.o: arm_unaligned_reloc.s |
2651 | $(TEST_AS) -o $@ $< | |
2652 | ||
2c339f71 | 2653 | MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r |
f6cccc2c | 2654 | |
cd6eab1c ILT |
2655 | # Check ARM to ARM farcall veneers |
2656 | ||
2657 | check_SCRIPTS += arm_farcall_arm_arm.sh | |
2658 | check_DATA += arm_farcall_arm_arm.stdout | |
2659 | ||
2660 | arm_farcall_arm_arm.stdout: arm_farcall_arm_arm | |
2661 | $(TEST_OBJDUMP) -d $< > $@ | |
2662 | ||
2663 | arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new | |
a8e2273b | 2664 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $< |
cd6eab1c ILT |
2665 | |
2666 | arm_farcall_arm_arm.o: arm_farcall_arm_arm.s | |
2667 | $(TEST_AS) -o $@ $< | |
2668 | ||
2669 | MOSTLYCLEANFILES += arm_farcall_arm_arm | |
2670 | ||
2671 | # Check ARM to Thumb farcall veneers | |
2672 | ||
2673 | check_SCRIPTS += arm_farcall_arm_thumb.sh | |
2674 | check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout | |
2675 | ||
2676 | arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb | |
2677 | $(TEST_OBJDUMP) -D $< > $@ | |
2678 | ||
2679 | arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new | |
2680 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2681 | ||
2682 | arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s | |
2683 | $(TEST_AS) -o $@ $< | |
2684 | ||
2685 | arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t | |
2686 | $(TEST_OBJDUMP) -D $< > $@ | |
2687 | ||
2688 | arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new | |
a8e2273b | 2689 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
2690 | |
2691 | arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s | |
2692 | $(TEST_AS) -march=armv5t -o $@ $< | |
2693 | ||
2694 | MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t | |
2695 | ||
2696 | # Check Thumb to Thumb farcall veneers | |
2697 | ||
2698 | check_SCRIPTS += arm_farcall_thumb_thumb.sh | |
2699 | check_DATA += arm_farcall_thumb_thumb.stdout \ | |
2700 | arm_farcall_thumb_thumb_5t.stdout \ | |
2701 | arm_farcall_thumb_thumb_7m.stdout \ | |
2702 | arm_farcall_thumb_thumb_6m.stdout | |
2703 | ||
2704 | arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb | |
2705 | $(TEST_OBJDUMP) -D $< > $@ | |
2706 | ||
2707 | arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new | |
2708 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2709 | ||
2710 | arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s | |
2711 | $(TEST_AS) -march=armv4t -o $@ $< | |
2712 | ||
2713 | arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t | |
2714 | $(TEST_OBJDUMP) -D $< > $@ | |
2715 | ||
2716 | arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new | |
a8e2273b | 2717 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
2718 | |
2719 | arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s | |
2720 | $(TEST_AS) -march=armv5t -o $@ $< | |
2721 | ||
2722 | arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m | |
2723 | $(TEST_OBJDUMP) -D $< > $@ | |
2724 | ||
2725 | arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new | |
2726 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2727 | ||
2728 | arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s | |
2729 | $(TEST_AS) -march=armv7-m -o $@ $< | |
2730 | ||
2731 | arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m | |
2732 | $(TEST_OBJDUMP) -D $< > $@ | |
2733 | ||
2734 | arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new | |
2735 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2736 | ||
2737 | arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s | |
2738 | $(TEST_AS) -march=armv6-m -o $@ $< | |
2739 | ||
2740 | MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \ | |
2741 | arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m | |
2742 | ||
2743 | # Check Thumb to ARM farcall veneers | |
2744 | ||
2745 | check_SCRIPTS += arm_farcall_thumb_arm.sh | |
2746 | check_DATA += arm_farcall_thumb_arm.stdout \ | |
2747 | arm_farcall_thumb_arm_5t.stdout | |
2748 | ||
2749 | arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm | |
2750 | $(TEST_OBJDUMP) -D $< > $@ | |
2751 | ||
2752 | arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new | |
2753 | ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< | |
2754 | ||
2755 | arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s | |
2756 | $(TEST_AS) -o $@ $< | |
2757 | ||
2758 | arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t | |
2759 | $(TEST_OBJDUMP) -D $< > $@ | |
2760 | ||
2761 | arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new | |
a8e2273b | 2762 | ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
2763 | |
2764 | arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s | |
2765 | $(TEST_AS) -march=armv5t -o $@ $< | |
2766 | ||
2767 | MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t | |
2768 | ||
e4782e83 | 2769 | endif DEFAULT_TARGET_ARM |
eb373049 ILT |
2770 | |
2771 | endif NATIVE_OR_CROSS_LINKER | |
2772 | ||
35c813e2 CC |
2773 | # Tests for the dwp tool. |
2774 | # We don't want to rely yet on GCC support for -gsplit-dwarf, | |
2775 | # so we use (for now) test cases in x86 assembly language, | |
2776 | # compiled from the dwp_test_*.cc sources. | |
2777 | ||
2778 | if DEFAULT_TARGET_X86_64 | |
2779 | ||
2780 | dwp_test_main.o: dwp_test_main.s | |
2781 | $(TEST_AS) -o $@ $< | |
2782 | dwp_test_1.o: dwp_test_1.s | |
2783 | $(TEST_AS) -o $@ $< | |
2784 | dwp_test_1b.o: dwp_test_1b.s | |
2785 | $(TEST_AS) -o $@ $< | |
2786 | dwp_test_2.o: dwp_test_2.s | |
2787 | $(TEST_AS) -o $@ $< | |
2788 | ||
2789 | dwp_test_main.dwo: dwp_test_main.o | |
2790 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2791 | dwp_test_1.dwo: dwp_test_1.o | |
2792 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2793 | dwp_test_1b.dwo: dwp_test_1b.o | |
2794 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2795 | dwp_test_2.dwo: dwp_test_2.o | |
2796 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2797 | ||
2798 | check_SCRIPTS += dwp_test_1.sh | |
2799 | check_DATA += dwp_test_1.stdout | |
2800 | dwp_test_1.stdout: dwp_test_1.dwp | |
2801 | $(TEST_READELF) -wi $< > $@ | |
2802 | dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo | |
2803 | ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo | |
2804 | ||
2805 | check_SCRIPTS += dwp_test_2.sh | |
2806 | check_DATA += dwp_test_2.stdout | |
2807 | dwp_test_2.stdout: dwp_test_2.dwp | |
2808 | $(TEST_READELF) -wi $< > $@ | |
2809 | dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp | |
2810 | ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp | |
2811 | dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo | |
2812 | ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo | |
2813 | dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo | |
2814 | ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo | |
2815 | ||
2816 | endif DEFAULT_TARGET_X86_64 |