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 | |
0ec6429b | 151 | MOSTLYCLEANFILES += incremental_test incremental_test.cmdline |
325e6408 RÁE |
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 | 254 | final_layout_script.lds: |
431ed302 | 255 | (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .bss : { *(.bss*) } }") > final_layout_script.lds |
9e9143bc ST |
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 |
0ec6429b | 272 | MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map |
ce97fa81 ST |
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 | |
0ec6429b | 1075 | MOSTLYCLEANFILES += flagstest_o_ttext_2 |
d12a5ea8 ILT |
1076 | flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld |
1077 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010 | |
1078 | ||
99f8faca ILT |
1079 | # Test symbol versioning. |
1080 | check_PROGRAMS += ver_test | |
1081 | ver_test_SOURCES = ver_test_main.cc | |
1082 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
1083 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1084 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
1085 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld | |
1086 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so | |
09124467 | 1087 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
41d0ab5f | 1088 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so |
09124467 ILT |
1089 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld |
1090 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o | |
99f8faca ILT |
1091 | ver_test_1.o: ver_test_1.cc |
1092 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1093 | ver_test_2.o: ver_test_2.cc | |
1094 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1095 | ver_test_3.o: ver_test_3.cc | |
1096 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1097 | ver_test_4.o: ver_test_4.cc | |
1098 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 1099 | |
0602e05a ILT |
1100 | check_SCRIPTS += ver_test_1.sh |
1101 | check_DATA += ver_test_1.syms | |
1102 | ver_test_1.syms: ver_test_1.so | |
1103 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1104 | ||
be3e6201 ILT |
1105 | check_PROGRAMS += ver_test_2 |
1106 | ver_test_2_SOURCES = ver_test_main_2.cc | |
1107 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
1108 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1109 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
1110 | ||
be3e6201 ILT |
1111 | check_SCRIPTS += ver_test_2.sh |
1112 | check_DATA += ver_test_2.syms | |
1113 | ver_test_2.syms: ver_test_2 | |
6835af53 | 1114 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 1115 | |
686c8caf ILT |
1116 | check_SCRIPTS += ver_test_4.sh |
1117 | check_DATA += ver_test_4.syms | |
1118 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 1119 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
1120 | |
1121 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld | |
1122 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so | |
1123 | ver_test_5.o: ver_test_5.cc | |
1124 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1125 | check_SCRIPTS += ver_test_5.sh | |
1126 | check_DATA += ver_test_5.syms | |
1127 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 1128 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 1129 | |
18e6b24e ILT |
1130 | check_PROGRAMS += ver_test_6 |
1131 | ver_test_6_SOURCES = ver_test_6.c | |
1132 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
1133 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1134 | ver_test_6_LDADD = ver_test_2.so | |
1135 | ||
479f6503 ILT |
1136 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
1137 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o | |
1138 | ver_test_7.o: ver_test_7.cc | |
1139 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1140 | check_SCRIPTS += ver_test_7.sh | |
1141 | check_DATA += ver_test_7.syms | |
1142 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 1143 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 1144 | |
75517b77 ILT |
1145 | check_PROGRAMS += ver_test_8 |
1146 | ver_test_8_SOURCES = two_file_test_main.cc | |
1147 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so | |
1148 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1149 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so | |
1150 | ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld | |
1151 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so | |
1152 | ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld | |
1153 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o | |
1154 | ||
95d14cd3 ILT |
1155 | check_PROGRAMS += ver_test_9 |
1156 | ver_test_9_SOURCES = ver_test_main.cc | |
1157 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so | |
1158 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1159 | ver_test_9_LDADD = ver_test_9.so | |
1160 | ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld | |
41d0ab5f | 1161 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so |
95d14cd3 ILT |
1162 | ver_test_9.o: ver_test_9.cc |
1163 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1164 | ||
057ead22 ILT |
1165 | check_SCRIPTS += ver_test_10.sh |
1166 | check_DATA += ver_test_10.syms | |
1167 | ver_test_10.syms: ver_test_10.so | |
1168 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1169 | ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script | |
1170 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o | |
1171 | ||
9c5b8369 | 1172 | check_PROGRAMS += ver_test_11 |
72fef11a | 1173 | MOSTLYCLEANFILES += ver_test_11.a |
9c5b8369 ILT |
1174 | ver_test_11_SOURCES = ver_test_main_2.cc |
1175 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a | |
1176 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1177 | ver_test_11_LDADD = ver_test_11.a | |
1178 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o | |
1179 | $(TEST_AR) rc $@ $^ | |
1180 | ||
6d1c4efb ILT |
1181 | check_PROGRAMS += ver_test_12 |
1182 | ver_test_12_SOURCES = ver_test_main_2.cc | |
1183 | ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o | |
1184 | ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1185 | ver_test_12_LDADD = ver_test_12.o | |
1186 | ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o | |
1187 | gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o | |
1188 | ||
8bdcdf2c ILT |
1189 | check_PROGRAMS += protected_1 |
1190 | protected_1_SOURCES = \ | |
1191 | protected_main_1.cc protected_main_2.cc protected_main_3.cc | |
1192 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1193 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1194 | protected_1_LDADD = protected_1.so | |
1195 | ||
1196 | protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1197 | $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1198 | protected_1_pic.o: protected_1.cc | |
1199 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1200 | protected_2_pic.o: protected_2.cc | |
1201 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1202 | protected_3_pic.o: protected_3.cc | |
1203 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1204 | ||
1205 | check_PROGRAMS += protected_2 | |
1206 | protected_2_SOURCES = protected_main_1.cc protected_3.cc | |
1207 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1208 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1209 | protected_2_LDADD = protected_1.so | |
1210 | ||
837504c4 ILT |
1211 | check_DATA += protected_3.err |
1212 | MOSTLYCLEANFILES += protected_3.err | |
1213 | protected_4_pic.o: protected_4.cc | |
1214 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1215 | protected_3.err: protected_4_pic.o gcctestdir/ld | |
1216 | @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@" | |
1217 | @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \ | |
1218 | echo 1>&2 "Link of protected_4.so should have failed"; \ | |
1219 | rm -f $@; \ | |
1220 | exit 1; \ | |
1221 | fi | |
1222 | ||
9f1d377b | 1223 | check_PROGRAMS += relro_test |
fc497986 CC |
1224 | check_SCRIPTS += relro_test.sh |
1225 | check_DATA += relro_test.stdout | |
9f1d377b ILT |
1226 | relro_test_SOURCES = relro_test_main.cc |
1227 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so | |
1228 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1229 | relro_test_LDADD = relro_test.so | |
1230 | relro_test.so: gcctestdir/ld relro_test_pic.o | |
1231 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o | |
1232 | relro_test_pic.o: relro_test.cc | |
1233 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
fc497986 CC |
1234 | relro_test.stdout: relro_test.so |
1235 | $(TEST_READELF) -SlW relro_test.so > relro_test.stdout | |
9f1d377b | 1236 | |
9446efde ILT |
1237 | check_PROGRAMS += relro_now_test |
1238 | relro_now_test_SOURCES = relro_test_main.cc | |
1239 | relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so | |
1240 | relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now | |
1241 | relro_now_test_LDADD = relro_now_test.so | |
1242 | relro_now_test.so: gcctestdir/ld relro_test_pic.o | |
1243 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o | |
1244 | ||
5f1ab67a ILT |
1245 | check_PROGRAMS += relro_strip_test |
1246 | relro_strip_test_SOURCES = relro_test_main.cc | |
1247 | relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so | |
1248 | relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1249 | relro_strip_test_LDADD = relro_strip_test.so | |
1250 | relro_strip_test.so: relro_test.so | |
1251 | $(TEST_STRIP) -o $@ $< | |
1252 | ||
2d924fd9 ILT |
1253 | check_PROGRAMS += relro_script_test |
1254 | relro_script_test_SOURCES = relro_test_main.cc | |
1255 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so | |
1256 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1257 | relro_script_test_LDADD = relro_script_test.so | |
1258 | relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o | |
1259 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o | |
1260 | ||
e5756efb ILT |
1261 | check_PROGRAMS += script_test_1 |
1262 | script_test_1_SOURCES = script_test_1.cc | |
1263 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t | |
1264 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t | |
1abce4a6 | 1265 | script_test_1_LDADD = |
e5756efb | 1266 | |
a445fddf ILT |
1267 | check_PROGRAMS += script_test_2 |
1268 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
1269 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
1270 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t | |
1abce4a6 | 1271 | script_test_2_LDADD = |
a445fddf | 1272 | |
88dd47ac ILT |
1273 | check_PROGRAMS += justsyms |
1274 | justsyms_SOURCES = justsyms_1.cc | |
1275 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
1276 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
1abce4a6 | 1277 | justsyms_LDADD = |
88dd47ac ILT |
1278 | justsyms_2.o: justsyms_2.cc |
1279 | $(CXXCOMPILE) -c -o $@ $< | |
83bfb6b7 | 1280 | justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t |
88dd47ac ILT |
1281 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o |
1282 | ||
c3f7b0e5 CC |
1283 | check_PROGRAMS += justsyms_exec |
1284 | justsyms_exec_SOURCES = justsyms_exec.c | |
1285 | justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib | |
1286 | justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib | |
1287 | justsyms_exec_LDADD = | |
0ec6429b | 1288 | MOSTLYCLEANFILES += justsyms_lib |
c3f7b0e5 CC |
1289 | justsyms_lib.o: justsyms_lib.c |
1290 | $(COMPILE) -c -o $@ $< | |
1291 | justsyms_lib: justsyms_lib.o gcctestdir/ld | |
1292 | gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o | |
1293 | ||
bc644c6c | 1294 | check_PROGRAMS += binary_test |
72fef11a | 1295 | MOSTLYCLEANFILES += binary.txt |
bc644c6c ILT |
1296 | binary_test_SOURCES = binary_test.cc |
1297 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
1298 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf | |
1abce4a6 | 1299 | binary_test_LDADD = |
bc644c6c ILT |
1300 | # Copy the file to the build directory to avoid worrying about the |
1301 | # full pathname in the generated symbols. | |
1302 | binary.txt: $(srcdir)/binary.in | |
1303 | rm -f $@ | |
1304 | $(LN_S) $< $@ | |
1305 | ||
09124467 ILT |
1306 | check_SCRIPTS += ver_matching_test.sh |
1307 | check_DATA += ver_matching_test.stdout | |
1308 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
2fbb4320 ILT |
1309 | ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld |
1310 | $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map | |
1311 | ver_matching_def_pic.o: ver_matching_def.cc | |
1312 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< | |
09124467 | 1313 | ver_matching_test.stdout: ver_matching_def.so |
6835af53 | 1314 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
1c4f3631 ILT |
1315 | |
1316 | check_PROGRAMS += script_test_3 | |
1317 | check_SCRIPTS += script_test_3.sh | |
1318 | check_DATA += script_test_3.stdout | |
1319 | MOSTLYCLEANFILES += script_test_3.stdout | |
1320 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
1321 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t | |
1322 | script_test_3.stdout: script_test_3 | |
2cefc357 | 1323 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
09124467 | 1324 | |
4ebf39db ILT |
1325 | check_PROGRAMS += tls_phdrs_script_test |
1326 | tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) | |
1327 | tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t | |
1328 | tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t | |
1329 | tls_phdrs_script_test_LDADD = $(tls_test_LDADD) | |
1330 | ||
e6188289 ILT |
1331 | check_SCRIPTS += script_test_4.sh |
1332 | check_DATA += script_test_4.stdout | |
72fef11a | 1333 | MOSTLYCLEANFILES += script_test_4 |
e6188289 ILT |
1334 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t |
1335 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t | |
1336 | script_test_4.stdout: script_test_4 | |
1337 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout | |
1338 | ||
6c93b22c ILT |
1339 | check_PROGRAMS += tls_script_test |
1340 | tls_script_test_SOURCES = $(tls_test_SOURCES) | |
1341 | tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t | |
1342 | tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t | |
1343 | tls_script_test_LDADD = $(tls_test_LDADD) | |
1344 | ||
401a9a73 CC |
1345 | check_SCRIPTS += script_test_5.sh |
1346 | check_DATA += script_test_5.stdout | |
72fef11a | 1347 | MOSTLYCLEANFILES += script_test_5 |
401a9a73 CC |
1348 | script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t |
1349 | $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t | |
1350 | script_test_5.stdout: script_test_5 | |
1351 | $(TEST_READELF) -SW script_test_5 > script_test_5.stdout | |
1352 | ||
3c12dcdb DK |
1353 | check_SCRIPTS += script_test_6.sh |
1354 | check_DATA += script_test_6.stdout | |
1355 | MOSTLYCLEANFILES += script_test_6 | |
1356 | script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t | |
1357 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \ | |
1358 | -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000 | |
1359 | script_test_6.stdout: script_test_6 | |
1360 | $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout | |
1361 | ||
1362 | check_SCRIPTS += script_test_7.sh | |
1363 | check_DATA += script_test_7.stdout | |
1364 | MOSTLYCLEANFILES += script_test_7 | |
1365 | script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1366 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t | |
1367 | script_test_7.stdout: script_test_7 | |
1368 | $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout | |
1369 | ||
1370 | check_SCRIPTS += script_test_8.sh | |
1371 | check_DATA += script_test_8.stdout | |
1372 | MOSTLYCLEANFILES += script_test_8 | |
1373 | script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1374 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \ | |
1375 | -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000 | |
1376 | script_test_8.stdout: script_test_8 | |
1377 | $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout | |
1378 | ||
d103a984 RÁE |
1379 | |
1380 | check_SCRIPTS += script_test_9.sh | |
1381 | check_DATA += script_test_9.stdout | |
0ec6429b | 1382 | MOSTLYCLEANFILES += script_test_9 |
d103a984 RÁE |
1383 | script_test_9.o: script_test_9.cc |
1384 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
1385 | script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o | |
1386 | $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t | |
1387 | script_test_9.stdout: script_test_9 | |
1388 | $(TEST_READELF) -lW script_test_9 > script_test_9.stdout | |
1389 | ||
1390 | ||
c82fbeee CS |
1391 | # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, |
1392 | # and --dynamic-list-cpp-typeinfo | |
1393 | ||
1394 | check_SCRIPTS += dynamic_list.sh | |
1395 | check_DATA += dynamic_list.stdout | |
72fef11a | 1396 | MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout |
c82fbeee CS |
1397 | dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t |
1398 | $(CXXLINK) -Bgcctestdir/ basic_test.o \ | |
1399 | -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ | |
1400 | -Wl,--dynamic-list-data \ | |
1401 | -Wl,--dynamic-list-cpp-new \ | |
1402 | -Wl,--dynamic-list-cpp-typeinfo | |
1403 | dynamic_list.stdout: dynamic_list | |
94e6ee91 | 1404 | $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout |
c82fbeee | 1405 | |
fbd8a257 | 1406 | check_PROGRAMS += thin_archive_test_1 |
72fef11a CC |
1407 | MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \ |
1408 | alt/thin_archive_test_2.o alt/thin_archive_test_4.o \ | |
1409 | alt/libthin2.a alt/libthin4.a | |
fbd8a257 CC |
1410 | thin_archive_test_1_SOURCES = thin_archive_main.cc |
1411 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a | |
1412 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt | |
1413 | thin_archive_test_1_LDADD = libthin1.a -lthin2 | |
1414 | ||
1415 | check_PROGRAMS += thin_archive_test_2 | |
1416 | thin_archive_test_2_SOURCES = thin_archive_main.cc | |
1417 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a | |
1418 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. | |
1419 | thin_archive_test_2_LDADD = -lthinall | |
1420 | ||
1421 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o | |
1422 | rm -f $@ | |
1423 | $(TEST_AR) crT $@ $^ | |
1424 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o | |
1425 | rm -f $@ | |
1426 | $(TEST_AR) crT $@ $^ | |
1427 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o | |
1428 | rm -f $@ | |
1429 | $(TEST_AR) crT $@ $^ | |
1430 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o | |
1431 | rm -f $@ | |
1432 | $(TEST_AR) crT $@ $^ | |
1433 | libthinall.a: libthin3.a alt/libthin4.a | |
1434 | rm -f $@ | |
1435 | $(TEST_AR) crT $@ $^ | |
1436 | alt/thin_archive_test_2.o: thin_archive_test_2.cc | |
1437 | test -d alt || mkdir -p alt | |
1438 | $(CXXCOMPILE) -c -o $@ $< | |
1439 | alt/thin_archive_test_4.o: thin_archive_test_4.cc | |
1440 | test -d alt || mkdir -p alt | |
1441 | $(CXXCOMPILE) -c -o $@ $< | |
1442 | ||
89fc3421 CC |
1443 | if PLUGINS |
1444 | ||
1445 | check_PROGRAMS += plugin_test_1 | |
1446 | check_SCRIPTS += plugin_test_1.sh | |
1447 | check_DATA += plugin_test_1.err | |
1448 | MOSTLYCLEANFILES += plugin_test_1.err | |
abc8dcba CC |
1449 | 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 |
1450 | $(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 |
1451 | plugin_test_1.err: plugin_test_1 |
1452 | @touch plugin_test_1.err | |
1453 | ||
1454 | check_PROGRAMS += plugin_test_2 | |
1455 | check_SCRIPTS += plugin_test_2.sh | |
1456 | check_DATA += plugin_test_2.err | |
1457 | MOSTLYCLEANFILES += plugin_test_2.err | |
1458 | 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 | |
1459 | $(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 | |
1460 | plugin_test_2.err: plugin_test_2 | |
1461 | @touch plugin_test_2.err | |
1462 | ||
d66a9eb3 CC |
1463 | check_PROGRAMS += plugin_test_3 |
1464 | check_SCRIPTS += plugin_test_3.sh | |
1465 | check_DATA += plugin_test_3.err | |
1466 | MOSTLYCLEANFILES += plugin_test_3.err | |
1467 | 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 | |
1468 | $(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 | |
1469 | plugin_test_3.err: plugin_test_3 | |
1470 | @touch plugin_test_3.err | |
1471 | ||
0f7c0701 CC |
1472 | check_PROGRAMS += plugin_test_4 |
1473 | check_SCRIPTS += plugin_test_4.sh | |
1474 | check_DATA += plugin_test_4.err | |
72fef11a | 1475 | MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err |
0f7c0701 CC |
1476 | plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so |
1477 | $(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 | |
1478 | plugin_test_4.err: plugin_test_4 | |
1479 | @touch plugin_test_4.err | |
1480 | ||
1481 | plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms | |
1482 | $(TEST_AR) cr $@ $^ | |
1483 | ||
24998053 CC |
1484 | check_PROGRAMS += plugin_test_5 |
1485 | 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 | |
1486 | $(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 | |
1487 | ||
be234d88 CC |
1488 | check_PROGRAMS += plugin_test_6 |
1489 | check_SCRIPTS += plugin_test_6.sh | |
1490 | check_DATA += plugin_test_6.err | |
1491 | MOSTLYCLEANFILES += plugin_test_6.err | |
1492 | plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so | |
1493 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err | |
1494 | plugin_test_6.err: plugin_test_6 | |
1495 | @touch plugin_test_6.err | |
1496 | ||
5e0f337e RÁE |
1497 | check_PROGRAMS += plugin_test_7 |
1498 | check_SCRIPTS += plugin_test_7.sh | |
1499 | check_DATA += plugin_test_7.err plugin_test_7.syms | |
1500 | MOSTLYCLEANFILES += plugin_test_7.err | |
1501 | plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so | |
1502 | $(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 | |
1503 | plugin_test_7.syms: plugin_test_7 | |
1504 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1505 | plugin_test_7_1.o: plugin_test_7_1.c | |
1506 | $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1507 | plugin_test_7_1_orig.o: plugin_test_7_1.c | |
1508 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1509 | plugin_test_7_1.syms: plugin_test_7_1_orig.o | |
1510 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1511 | plugin_test_7_2.o: plugin_test_7_2.c | |
1512 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
1513 | plugin_test_7.err: plugin_test_7 | |
1514 | ||
f3a2388f CC |
1515 | # Test plugins with -r. |
1516 | check_PROGRAMS += plugin_test_8 | |
1517 | 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 | |
1518 | ../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 | |
1519 | plugin_test_8: plugin_test_8.o gcctestdir/ld | |
1520 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o | |
1521 | ||
1522 | # Test that symbols known in the IR file but not in the replacement file | |
1523 | # produce an unresolved symbol error. | |
1524 | check_DATA += plugin_test_9.err | |
1525 | MOSTLYCLEANFILES += plugin_test_9.err | |
1526 | plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so | |
1527 | @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>$@" | |
1528 | @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 \ | |
1529 | echo 1>&2 "Link of plugin_test_9 should have failed"; \ | |
1530 | rm -f $@; \ | |
1531 | exit 1; \ | |
1532 | fi | |
1533 | # Make a .syms file that claims to define the symbol _Z4t16av. | |
1534 | two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o | |
1535 | cp two_file_test_1.syms $@.tmp | |
1536 | grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp | |
1537 | mv -f $@.tmp $@ | |
1538 | # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. | |
1539 | MOSTLYCLEANFILES += two_file_test_1c.o | |
1540 | two_file_test_1c.o: two_file_test_1.o | |
1541 | cp two_file_test_1.o $@ | |
1542 | ||
89fc3421 CC |
1543 | plugin_test.so: plugin_test.o |
1544 | $(LINK) -Bgcctestdir/ -shared plugin_test.o | |
1545 | plugin_test.o: plugin_test.c | |
1546 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1547 | ||
1548 | two_file_test_main.syms: two_file_test_main.o | |
1549 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1550 | two_file_test_1.syms: two_file_test_1.o | |
1551 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1552 | two_file_test_1b.syms: two_file_test_1b.o | |
1553 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1554 | two_file_test_2.syms: two_file_test_2.o | |
1555 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
be234d88 CC |
1556 | plugin_common_test_1.syms: plugin_common_test_1.o |
1557 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1558 | plugin_common_test_2.syms: plugin_common_test_2.o | |
1559 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
24998053 | 1560 | |
abc8dcba | 1561 | empty.syms: |
24998053 CC |
1562 | @echo "" >$@ |
1563 | @echo "Symbol table" >>$@ | |
1564 | ||
1565 | MOSTLYCLEANFILES += unused.c | |
1566 | unused.syms: unused.o | |
1567 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1568 | @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ | |
1569 | unused.o: unused.c | |
1570 | $(COMPILE) -c -o $@ $< | |
1571 | unused.c: | |
1572 | @cp /dev/null $@ | |
89fc3421 | 1573 | |
f0558624 | 1574 | check_SCRIPTS += plugin_final_layout.sh |
16164a6b | 1575 | check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout |
0ec6429b | 1576 | MOSTLYCLEANFILES += plugin_final_layout |
f0558624 ST |
1577 | plugin_final_layout.o: plugin_final_layout.cc |
1578 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< | |
1579 | plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld | |
1580 | $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o | |
1581 | plugin_final_layout.stdout: plugin_final_layout | |
864a1b56 | 1582 | $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout |
16164a6b ST |
1583 | plugin_final_layout_readelf.stdout: plugin_final_layout |
1584 | $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout | |
f0558624 ST |
1585 | |
1586 | plugin_section_order.so: plugin_section_order.o | |
1587 | $(LINK) -Bgcctestdir/ -shared plugin_section_order.o | |
1588 | plugin_section_order.o: plugin_section_order.c | |
1589 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1590 | ||
89fc3421 CC |
1591 | endif PLUGINS |
1592 | ||
65514900 CC |
1593 | check_PROGRAMS += exclude_libs_test |
1594 | check_SCRIPTS += exclude_libs_test.sh | |
1595 | check_DATA += exclude_libs_test.syms | |
1596 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ | |
2fdd743f | 1597 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
65514900 CC |
1598 | exclude_libs_test_SOURCES = exclude_libs_test.c |
1599 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ | |
2fdd743f DK |
1600 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
1601 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ | |
1602 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ | |
1603 | -Wl,--exclude-libs,libexclude_libs_test_3 | |
1604 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ | |
1605 | alt/libexclude_libs_test_3.a | |
65514900 CC |
1606 | exclude_libs_test.syms: exclude_libs_test |
1607 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1608 | libexclude_libs_test_1.a: exclude_libs_test_1.o | |
1609 | $(TEST_AR) rc $@ $^ | |
1610 | libexclude_libs_test_2.a: exclude_libs_test_2.o | |
1611 | $(TEST_AR) rc $@ $^ | |
2fdd743f DK |
1612 | alt/libexclude_libs_test_3.a: exclude_libs_test_3.o |
1613 | test -d alt || mkdir -p alt | |
1614 | $(TEST_AR) rc $@ $^ | |
65514900 | 1615 | |
805bb01c DK |
1616 | check_PROGRAMS += local_labels_test |
1617 | local_labels_test.o: ver_test_6.c | |
1618 | $(COMPILE) -g -c -Wa,-L -o $@ $< | |
1619 | local_labels_test: local_labels_test.o | |
1620 | $(LINK) -Bgcctestdir/ local_labels_test.o | |
1621 | ||
bb04269c DK |
1622 | check_PROGRAMS += discard_locals_test |
1623 | check_SCRIPTS += discard_locals_test.sh | |
d3bbad62 ILT |
1624 | check_DATA += discard_locals_test.syms \ |
1625 | discard_locals_relocatable_test1.syms \ | |
1626 | discard_locals_relocatable_test2.syms | |
1627 | MOSTLYCLEANFILES += discard_locals_test.syms \ | |
1628 | discard_locals_relocatable_test1.syms \ | |
1629 | discard_locals_relocatable_test2.syms \ | |
1630 | discard_locals_relocatable_test1.out \ | |
1631 | discard_locals_relocatable_test2.out | |
bb04269c DK |
1632 | discard_locals_test_SOURCES = discard_locals_test.c |
1633 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals | |
1634 | discard_locals_test.syms: discard_locals_test | |
1635 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1636 | # '-Wa,-L' is required to preserve the local label used for testing. | |
1637 | discard_locals_test.o: discard_locals_test.c | |
1638 | $(COMPILE) -c -Wa,-L -o $@ $< | |
1639 | ||
d3bbad62 ILT |
1640 | discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out |
1641 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1642 | discard_locals_relocatable_test.o: discard_locals_relocatable_test.c | |
1643 | $(COMPILE) -c -Wa,-L -fPIC -o $@ $< | |
1644 | discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new | |
1645 | ../ld-new --discard-locals -relocatable -o $@ $< | |
1646 | ||
1647 | discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out | |
1648 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1649 | discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new | |
1650 | ../ld-new --discard-all -relocatable -o $@ $< | |
1651 | ||
8a5e3e08 ILT |
1652 | if MCMODEL_MEDIUM |
1653 | check_PROGRAMS += large | |
1654 | large_SOURCES = large.c | |
1655 | large_CFLAGS = -mcmodel=medium | |
1656 | large_DEPENDENCIES = gcctestdir/ld | |
1657 | large_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 1658 | large_LDADD = |
8a5e3e08 ILT |
1659 | endif MCMODEL_MEDIUM |
1660 | ||
645afe0c CC |
1661 | # Test that hidden and internal symbols in the main program cannot be |
1662 | # referenced by a shared library. | |
1663 | check_SCRIPTS += hidden_test.sh | |
1664 | check_DATA += hidden_test.err | |
1665 | MOSTLYCLEANFILES += hidden_test hidden_test.err | |
1666 | libhidden.so: hidden_test_1.c gcctestdir/ld | |
1667 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c | |
1668 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld | |
1669 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err | |
1670 | hidden_test.err: hidden_test | |
1671 | @touch hidden_test.err | |
1672 | ||
8c604651 CS |
1673 | # Test -retain-symbols-file. |
1674 | check_SCRIPTS += retain_symbols_file_test.sh | |
1675 | check_DATA += retain_symbols_file_test.stdout | |
1676 | MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \ | |
1677 | retain_symbols_file_test.stdout | |
1678 | retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld | |
1679 | echo 'main' > retain_symbols_file_test.in | |
1680 | echo 't1' >> retain_symbols_file_test.in | |
1681 | echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in | |
1682 | echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in | |
1683 | echo '_Z3t18v' >> retain_symbols_file_test.in | |
1684 | echo '__tcf_0' >> retain_symbols_file_test.in | |
1685 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o | |
1686 | retain_symbols_file_test.stdout: retain_symbols_file_test.so | |
1687 | $(TEST_NM) -C retain_symbols_file_test.so > $@ | |
1688 | ||
1689 | ||
6a89f575 CC |
1690 | # Test that if the output file already exists and is empty, |
1691 | # it will get execute permission. | |
1692 | check_PROGRAMS += permission_test | |
1693 | permission_test: basic_test.o gcctestdir/ld | |
1694 | umask 022; \ | |
1695 | rm -f $@; \ | |
1696 | touch $@; \ | |
1697 | chmod 600 $@; \ | |
1698 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
1699 | ||
ae3b5189 CD |
1700 | # Check -l:foo.a |
1701 | check_PROGRAMS += searched_file_test | |
1702 | MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \ | |
1703 | alt/searched_file_test_lib.a | |
1704 | searched_file_test_SOURCES = searched_file_test.cc | |
1705 | searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a | |
1706 | searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt | |
1707 | searched_file_test_LDADD = -l:searched_file_test_lib.a | |
1708 | searched_file_test_lib.o: searched_file_test_lib.cc | |
1709 | $(CXXCOMPILE) -c -o $@ $< | |
1710 | alt/searched_file_test_lib.a: searched_file_test_lib.o | |
1711 | test -d alt || mkdir -p alt | |
1712 | $(TEST_AR) rc $@ $^ | |
1713 | ||
c5617f2f DK |
1714 | # Test that no .gnu.version sections are created when |
1715 | # symbol versioning is not used. | |
1716 | check_SCRIPTS += no_version_test.sh | |
1717 | check_DATA += no_version_test.stdout | |
1718 | MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout | |
1719 | # We invoke the linker directly since gcc may include additional objects that | |
1720 | # uses symbol versioning. | |
1721 | libno_version_test.so: no_version_test.o gcctestdir/ld | |
1722 | gcctestdir/ld -shared -o $@ no_version_test.o | |
1723 | no_version_test.o: no_version_test.c | |
1724 | $(COMPILE) -o $@ -c -fPIC $< | |
1725 | no_version_test.stdout: libno_version_test.so | |
1726 | $(TEST_OBJDUMP) -h $< > $@ | |
1727 | ||
7223e9ca ILT |
1728 | # Test STT_GNU_IFUNC symbols. |
1729 | if IFUNC | |
1730 | ||
1731 | ifuncmod1.o: ifuncmod1.c | |
661d7a80 | 1732 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1733 | ifuncmod1.so: ifuncmod1.o gcctestdir/ld |
1734 | $(LINK) -Bgcctestdir/ -shared ifuncmod1.o | |
1735 | ||
1736 | ifuncdep1.o: ifuncmod1.c | |
1737 | $(COMPILE) -c -o $@ $< | |
1738 | ||
1739 | ifuncmain1pic.o: ifuncmain1.c | |
661d7a80 | 1740 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 1741 | ifuncmain1pie.o: ifuncmain1.c |
661d7a80 | 1742 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca | 1743 | |
328c7c2f | 1744 | if HAVE_STATIC |
ebb300b2 | 1745 | if IFUNC_STATIC |
7223e9ca ILT |
1746 | check_PROGRAMS += ifuncmain1static |
1747 | ifuncmain1static_SOURCES = ifuncmain1.c | |
1748 | ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o | |
1749 | ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static | |
1750 | ifuncmain1static_LDADD = ifuncdep1.o | |
1751 | ||
1752 | check_PROGRAMS += ifuncmain1picstatic | |
1753 | ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
1754 | $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o | |
328c7c2f | 1755 | endif |
ebb300b2 | 1756 | endif |
7223e9ca ILT |
1757 | |
1758 | check_PROGRAMS += ifuncmain1 | |
1759 | ifuncmain1_SOURCES = ifuncmain1.c | |
1760 | ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
1761 | ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1762 | ifuncmain1_LDADD = ifuncmod1.so | |
1763 | ||
1764 | check_PROGRAMS += ifuncmain1pic | |
1765 | ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld | |
1766 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
1767 | ||
1768 | check_PROGRAMS += ifuncmain1vis | |
1769 | ifuncmain1vis_SOURCES = ifuncmain1vis.c | |
1770 | ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
1771 | ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1772 | ifuncmain1vis_LDADD = ifuncmod1.so | |
1773 | ||
1774 | check_PROGRAMS += ifuncmain1vispic | |
1775 | ifuncmain1vispic.o: ifuncmain1vis.c | |
661d7a80 | 1776 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1777 | ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld |
1778 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
1779 | ||
1780 | check_PROGRAMS += ifuncmain1staticpic | |
1781 | ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
1782 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o | |
1783 | ||
1784 | check_PROGRAMS += ifuncmain1pie | |
1785 | ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld | |
1786 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,. | |
1787 | ||
1788 | check_PROGRAMS += ifuncmain1vispie | |
1789 | ifuncmain1vispie.o: ifuncmain1vis.c | |
661d7a80 | 1790 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
1791 | ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld |
1792 | $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. | |
1793 | ||
1794 | check_PROGRAMS += ifuncmain1staticpie | |
1795 | ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld | |
1796 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o | |
1797 | ||
1798 | ifuncmain2pic.o: ifuncmain2.c | |
661d7a80 | 1799 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1800 | |
1801 | ifuncdep2pic.o: ifuncdep2.c | |
661d7a80 | 1802 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 1803 | |
328c7c2f | 1804 | if HAVE_STATIC |
ebb300b2 | 1805 | if IFUNC_STATIC |
7223e9ca ILT |
1806 | check_PROGRAMS += ifuncmain2static |
1807 | ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c | |
1808 | ifuncmain2static_DEPENDENCIES = gcctestdir/ld | |
1809 | ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1810 | ifuncmain2static_LDADD = |
7223e9ca ILT |
1811 | |
1812 | check_PROGRAMS += ifuncmain2picstatic | |
1813 | ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
1814 | $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o | |
328c7c2f | 1815 | endif |
ebb300b2 | 1816 | endif |
7223e9ca ILT |
1817 | |
1818 | check_PROGRAMS += ifuncmain2 | |
1819 | ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c | |
1820 | ifuncmain2_DEPENDENCIES = gcctestdir/ld | |
1821 | ifuncmain2_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1822 | ifuncmain2_LDADD = |
7223e9ca ILT |
1823 | |
1824 | check_PROGRAMS += ifuncmain2pic | |
1825 | ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
1826 | $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o | |
1827 | ||
1828 | ifuncmod3.o: ifuncmod3.c | |
661d7a80 | 1829 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1830 | ifuncmod3.so: ifuncmod3.o gcctestdir/ld |
1831 | $(LINK) -Bgcctestdir/ -shared ifuncmod3.o | |
1832 | ||
1833 | check_PROGRAMS += ifuncmain3 | |
1834 | ifuncmain3_SOURCES = ifuncmain3.c | |
1835 | ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so | |
1836 | ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,. | |
1837 | ifuncmain3_LDADD = -ldl | |
1838 | ||
1839 | ifuncmain4pic.o: ifuncmain4.c | |
661d7a80 | 1840 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 1841 | |
328c7c2f | 1842 | if HAVE_STATIC |
ebb300b2 | 1843 | if IFUNC_STATIC |
7223e9ca ILT |
1844 | check_PROGRAMS += ifuncmain4static |
1845 | ifuncmain4static_SOURCES = ifuncmain4.c | |
1846 | ifuncmain4static_DEPENDENCIES = gcctestdir/ld | |
1847 | ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1848 | ifuncmain4static_LDADD = |
7223e9ca ILT |
1849 | |
1850 | check_PROGRAMS += ifuncmain4picstatic | |
1851 | ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld | |
1852 | $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o | |
328c7c2f | 1853 | endif |
ebb300b2 | 1854 | endif |
7223e9ca ILT |
1855 | |
1856 | check_PROGRAMS += ifuncmain4 | |
1857 | ifuncmain4_SOURCES = ifuncmain4.c | |
1858 | ifuncmain4_DEPENDENCIES = gcctestdir/ld | |
1859 | ifuncmain4_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1860 | ifuncmain4_LDADD = |
7223e9ca ILT |
1861 | |
1862 | ifuncmain5pic.o: ifuncmain5.c | |
661d7a80 | 1863 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1864 | |
1865 | ifuncmain5pie.o: ifuncmain5.c | |
661d7a80 | 1866 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
1867 | |
1868 | ifuncmod5.o: ifuncmod5.c | |
661d7a80 | 1869 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1870 | ifuncmod5.so: ifuncmod5.o gcctestdir/ld |
1871 | $(LINK) -Bgcctestdir/ -shared ifuncmod5.o | |
1872 | ||
1873 | ifuncdep5.o: ifuncmod5.c | |
1874 | $(COMPILE) -c -o $@ $< | |
1875 | ||
328c7c2f | 1876 | if HAVE_STATIC |
ebb300b2 | 1877 | if IFUNC_STATIC |
7223e9ca ILT |
1878 | check_PROGRAMS += ifuncmain5static |
1879 | ifuncmain5static_SOURCES = ifuncmain5.c | |
1880 | ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o | |
1881 | ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static | |
1882 | ifuncmain5static_LDADD = ifuncdep5.o | |
1883 | ||
1884 | check_PROGRAMS += ifuncmain5picstatic | |
1885 | ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
1886 | $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o | |
328c7c2f | 1887 | endif |
ebb300b2 | 1888 | endif |
7223e9ca ILT |
1889 | |
1890 | check_PROGRAMS += ifuncmain5 | |
1891 | ifuncmain5_SOURCES = ifuncmain5.c | |
1892 | ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so | |
1893 | ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1894 | ifuncmain5_LDADD = ifuncmod5.so | |
1895 | ||
1896 | check_PROGRAMS += ifuncmain5pic | |
1897 | ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld | |
1898 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,. | |
1899 | ||
1900 | check_PROGRAMS += ifuncmain5staticpic | |
1901 | ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
1902 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o | |
1903 | ||
1904 | check_PROGRAMS += ifuncmain5pie | |
1905 | ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld | |
1906 | $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. | |
1907 | ||
1908 | ifuncmain6pie.o: ifuncmain6pie.c | |
661d7a80 | 1909 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
1910 | |
1911 | ifuncmod6.o: ifuncmod6.c | |
661d7a80 | 1912 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1913 | ifuncmod6.so: ifuncmod6.o gcctestdir/ld |
1914 | $(LINK) -Bgcctestdir/ -shared ifuncmod6.o | |
1915 | ||
1916 | check_PROGRAMS += ifuncmain6pie | |
1917 | ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld | |
1918 | $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. | |
1919 | ||
1920 | ifuncmain7pic.o: ifuncmain7.c | |
661d7a80 | 1921 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
1922 | |
1923 | ifuncmain7pie.o: ifuncmain7.c | |
661d7a80 | 1924 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca | 1925 | |
328c7c2f | 1926 | if HAVE_STATIC |
ebb300b2 | 1927 | if IFUNC_STATIC |
7223e9ca ILT |
1928 | check_PROGRAMS += ifuncmain7static |
1929 | ifuncmain7static_SOURCES = ifuncmain7.c | |
1930 | ifuncmain7static_DEPENDENCIES = gcctestdir/ld | |
1931 | ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 1932 | ifuncmain7static_LDADD = |
7223e9ca ILT |
1933 | |
1934 | check_PROGRAMS += ifuncmain7picstatic | |
1935 | ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld | |
1936 | $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o | |
328c7c2f | 1937 | endif |
ebb300b2 | 1938 | endif |
7223e9ca ILT |
1939 | |
1940 | check_PROGRAMS += ifuncmain7 | |
1941 | ifuncmain7_SOURCES = ifuncmain7.c | |
1942 | ifuncmain7_DEPENDENCIES = gcctestdir/ld | |
1943 | ifuncmain7_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 1944 | ifuncmain7_LDADD = |
7223e9ca ILT |
1945 | |
1946 | check_PROGRAMS += ifuncmain7pic | |
1947 | ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld | |
1948 | $(LINK) -Bgcctestdir/ ifuncmain7pic.o | |
1949 | ||
1950 | check_PROGRAMS += ifuncmain7pie | |
1951 | ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld | |
1952 | $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o | |
1953 | ||
67181c72 ILT |
1954 | check_PROGRAMS += ifuncvar |
1955 | ifuncvar1_pic.o: ifuncvar1.c | |
661d7a80 | 1956 | $(COMPILE) -c -fPIC -o $@ $< |
67181c72 | 1957 | ifuncvar2_pic.o: ifuncvar2.c |
661d7a80 | 1958 | $(COMPILE) -c -fPIC -o $@ $< |
67181c72 ILT |
1959 | ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld |
1960 | $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o | |
1961 | ifuncvar_SOURCES = ifuncvar3.c | |
1962 | ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so | |
1963 | ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1964 | ifuncvar_LDADD = ifuncvar.so | |
1965 | ||
7223e9ca ILT |
1966 | endif IFUNC |
1967 | ||
74f67560 DK |
1968 | # Test that strong reference to a weak symbol in a DSO remains strong. |
1969 | check_SCRIPTS += strong_ref_weak_def.sh | |
1970 | check_DATA += strong_ref_weak_def.stdout | |
1971 | MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \ | |
1972 | strong_ref_weak_def.stdout | |
1973 | strong_ref_weak_def_2.o: strong_ref_weak_def_2.c | |
1974 | $(COMPILE) -o $@ -c -fPIC $< | |
1975 | strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld | |
1976 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o | |
1977 | strong_ref_weak_def_1.o: strong_ref_weak_def_1.c | |
1978 | $(COMPILE) -o $@ -c -fPIC $< | |
1979 | strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \ | |
1980 | gcctestdir/ld | |
1981 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \ | |
1982 | strong_ref_weak_def_2.so | |
1983 | strong_ref_weak_def.stdout: strong_ref_weak_def_1.so | |
1984 | $(TEST_READELF) -sWD $< > $@ | |
1985 | ||
a4649286 DK |
1986 | # Test that a strong weak reference remains strong if there is another |
1987 | # weak reference in a DSO. | |
1988 | check_SCRIPTS += dyn_weak_ref.sh | |
1989 | check_DATA += dyn_weak_ref.stdout | |
1990 | MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \ | |
1991 | dyn_weak_ref.stdout | |
1992 | dyn_weak_ref_2.o: dyn_weak_ref_2.c | |
1993 | $(COMPILE) -o $@ -c -fPIC $< | |
1994 | dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld | |
1995 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o | |
1996 | dyn_weak_ref_1.o: dyn_weak_ref_1.c | |
1997 | $(COMPILE) -o $@ -c -fPIC $< | |
1998 | # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o | |
1999 | # so that the weak ref there goes to gold's symbol table first. | |
2000 | dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld | |
2001 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o | |
2002 | dyn_weak_ref.stdout: dyn_weak_ref_1.so | |
2003 | $(TEST_READELF) -sWD $< > $@ | |
2004 | ||
2005 | ||
97b4be1c CC |
2006 | # Test that --start-lib and --end-lib function correctly. |
2007 | check_PROGRAMS += start_lib_test | |
0ec6429b | 2008 | MOSTLYCLEANFILES += libstart_lib_test.a |
97b4be1c CC |
2009 | start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \ |
2010 | gcctestdir/ld | |
2011 | $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \ | |
2012 | -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib | |
2013 | libstart_lib_test.a: start_lib_test_1.o | |
2014 | $(TEST_AR) rc $@ $^ | |
2015 | ||
7f8cd844 NC |
2016 | # Test that MEMORY region support works. |
2017 | check_SCRIPTS += memory_test.sh | |
2018 | check_DATA += memory_test.stdout | |
2019 | MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o | |
d4d91489 ILT |
2020 | memory_test.o: memory_test.s |
2021 | $(COMPILE) -o $@ -c $< | |
2022 | memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t | |
864a1b56 | 2023 | $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -z max-page-size=0x1000 -z common-page-size=0x1000 -T $(srcdir)/memory_test.t -o $@ memory_test.o |
7f8cd844 | 2024 | memory_test.stdout: memory_test |
41a8542a | 2025 | $(TEST_READELF) -lWS $< > $@ |
7f8cd844 | 2026 | |
f1415016 CC |
2027 | if HAVE_PUBNAMES |
2028 | ||
2029 | # Test that --gdb-index functions correctly without gcc-generated pubnames. | |
c1027032 CC |
2030 | check_SCRIPTS += gdb_index_test_1.sh |
2031 | check_DATA += gdb_index_test_1.stdout | |
2032 | MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1 | |
2033 | gdb_index_test.o: gdb_index_test.cc | |
f1415016 | 2034 | $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $< |
c1027032 CC |
2035 | gdb_index_test_1: gdb_index_test.o gcctestdir/ld |
2036 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2037 | gdb_index_test_1.stdout: gdb_index_test_1 | |
2038 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2039 | ||
2040 | if HAVE_ZLIB | |
2041 | ||
f1415016 | 2042 | # Test that --gdb-index functions correctly with compressed debug sections. |
c1027032 CC |
2043 | check_SCRIPTS += gdb_index_test_2.sh |
2044 | check_DATA += gdb_index_test_2.stdout | |
2045 | MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 | |
2046 | gdb_index_test_cdebug.o: gdb_index_test.cc | |
2047 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $< | |
2048 | gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld | |
2049 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2050 | gdb_index_test_2.stdout: gdb_index_test_2 | |
2051 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2052 | ||
2053 | endif HAVE_ZLIB | |
2054 | ||
f1415016 | 2055 | # Another simple C test (DW_AT_high_pc encoding) for --gdb-index. |
57923f48 MW |
2056 | check_SCRIPTS += gdb_index_test_3.sh |
2057 | check_DATA += gdb_index_test_3.stdout | |
2058 | MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3 | |
2059 | gdb_index_test_3.o: gdb_index_test_3.c | |
2060 | $(COMPILE) -O0 -g -c -o $@ $< | |
2061 | gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld | |
2062 | $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $< | |
2063 | gdb_index_test_3.stdout: gdb_index_test_3 | |
2064 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2065 | ||
f1415016 CC |
2066 | # Test that --gdb-index functions correctly with gcc-generated pubnames. |
2067 | check_SCRIPTS += gdb_index_test_4.sh | |
2068 | check_DATA += gdb_index_test_4.stdout | |
2069 | MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4 | |
2070 | gdb_index_test_pub.o: gdb_index_test.cc | |
2071 | $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $< | |
2072 | gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld | |
2073 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2074 | gdb_index_test_4.stdout: gdb_index_test_4 | |
2075 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2076 | ||
2077 | endif HAVE_PUBNAMES | |
57923f48 | 2078 | |
2eedd706 CC |
2079 | # End-to-end incremental linking tests. |
2080 | # Incremental linking is currently supported only on the x86_64 target. | |
2081 | ||
2082 | if DEFAULT_TARGET_X86_64 | |
2083 | ||
33c15b45 CC |
2084 | two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc |
2085 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2086 | two_file_test_1_ndebug.o: two_file_test_1.cc | |
2087 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2088 | two_file_test_1b_ndebug.o: two_file_test_1b.cc | |
2089 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2090 | two_file_test_2_ndebug.o: two_file_test_2.cc | |
2091 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2092 | two_file_test_main_ndebug.o: two_file_test_main.cc | |
2093 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2094 | ||
2eedd706 | 2095 | check_PROGRAMS += incremental_test_2 |
c49875be | 2096 | MOSTLYCLEANFILES += two_file_test_tmp_2.o |
33c15b45 CC |
2097 | incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \ |
2098 | two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld | |
2099 | cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o | |
2100 | $(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 | 2101 | @sleep 1 |
33c15b45 CC |
2102 | cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o |
2103 | $(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 |
2104 | |
2105 | check_PROGRAMS += incremental_test_3 | |
c49875be | 2106 | MOSTLYCLEANFILES += two_file_test_tmp_3.o |
2eedd706 CC |
2107 | incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ |
2108 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
c49875be | 2109 | cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o |
8ea8cd50 | 2110 | $(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 | 2111 | @sleep 1 |
c49875be ILT |
2112 | cp -f two_file_test_1b.o two_file_test_tmp_3.o |
2113 | $(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 |
2114 | |
2115 | check_PROGRAMS += incremental_test_4 | |
c49875be | 2116 | MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o |
2eedd706 CC |
2117 | incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ |
2118 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
c49875be | 2119 | cp -f two_file_test_2_v1.o two_file_test_tmp_4.o |
8ea8cd50 | 2120 | $(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 | 2121 | mv -f incremental_test_4 incremental_test_4.base |
2eedd706 | 2122 | @sleep 1 |
c49875be ILT |
2123 | cp -f two_file_test_2.o two_file_test_tmp_4.o |
2124 | $(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 | 2125 | |
e24719f6 CC |
2126 | check_PROGRAMS += incremental_test_5 |
2127 | MOSTLYCLEANFILES += two_file_test_5.a | |
2128 | incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
2129 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
2130 | cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o | |
2131 | $(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 | 2132 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a |
e24719f6 CC |
2133 | @sleep 1 |
2134 | cp -f two_file_test_1b.o two_file_test_tmp_5.o | |
2135 | $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o | |
2136 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o two_file_test_5.a | |
2137 | ||
2138 | # Test the --incremental-unchanged flag with an archive library. | |
2139 | # The second link should not update the library. | |
2140 | check_PROGRAMS += incremental_test_6 | |
2141 | MOSTLYCLEANFILES += two_file_test_6.a | |
2142 | incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
2143 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
2144 | cp -f two_file_test_1b.o two_file_test_tmp_6.o | |
2145 | $(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 | 2146 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a |
e24719f6 CC |
2147 | @sleep 1 |
2148 | cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o | |
2149 | $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o | |
2150 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown | |
2151 | ||
a5ee4d5d CC |
2152 | check_PROGRAMS += incremental_copy_test |
2153 | incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so | |
2154 | cp -f copy_test_v1.o copy_test_tmp.o | |
59965708 | 2155 | $(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 |
2156 | @sleep 1 |
2157 | cp -f copy_test.o copy_test_tmp.o | |
59965708 | 2158 | $(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 |
2159 | |
2160 | check_PROGRAMS += incremental_common_test_1 | |
2161 | incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld | |
2162 | cp -f common_test_1_v1.o common_test_1_tmp.o | |
8ea8cd50 | 2163 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o |
a5ee4d5d CC |
2164 | @sleep 1 |
2165 | cp -f common_test_1_v2.o common_test_1_tmp.o | |
2166 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o | |
2167 | ||
1206d0d5 CC |
2168 | check_PROGRAMS += incremental_comdat_test_1 |
2169 | 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 | |
2170 | cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o | |
2171 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o | |
2172 | @sleep 1 | |
2173 | cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o | |
2174 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o | |
2175 | @sleep 1 | |
2176 | cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o | |
2177 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o | |
2178 | ||
2eedd706 CC |
2179 | endif DEFAULT_TARGET_X86_64 |
2180 | ||
351a8000 ILT |
2181 | endif GCC |
2182 | endif NATIVE_LINKER | |
364c7fa5 | 2183 | |
eb373049 ILT |
2184 | # These tests work with native and cross linkers. |
2185 | ||
2186 | if NATIVE_OR_CROSS_LINKER | |
2187 | ||
2188 | # Test script section order. | |
2189 | check_SCRIPTS += script_test_10.sh | |
2190 | check_DATA += script_test_10.stdout | |
0ec6429b | 2191 | MOSTLYCLEANFILES += script_test_10 |
eb373049 ILT |
2192 | script_test_10.o: script_test_10.s |
2193 | $(TEST_AS) -o $@ $< | |
2194 | script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld | |
2195 | gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t | |
2196 | script_test_10.stdout: script_test_10 | |
2197 | $(TEST_READELF) -SW script_test_10 > $@ | |
2198 | ||
2199 | # These tests work with cross linkers only. | |
364c7fa5 ILT |
2200 | |
2201 | if DEFAULT_TARGET_I386 | |
2202 | ||
2203 | check_SCRIPTS += split_i386.sh | |
2204 | check_DATA += split_i386_1.stdout split_i386_2.stdout \ | |
2205 | split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout | |
2206 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
2207 | split_i386_1.o: split_i386_1.s | |
2208 | $(TEST_AS) -o $@ $< | |
2209 | split_i386_2.o: split_i386_2.s | |
2210 | $(TEST_AS) -o $@ $< | |
2211 | split_i386_3.o: split_i386_3.s | |
2212 | $(TEST_AS) -o $@ $< | |
2213 | split_i386_4.o: split_i386_4.s | |
2214 | $(TEST_AS) -o $@ $< | |
2215 | split_i386_n.o: split_i386_n.s | |
2216 | $(TEST_AS) -o $@ $< | |
2217 | split_i386_1: split_i386_1.o split_i386_n.o ../ld-new | |
2218 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o | |
2219 | split_i386_1.stdout: split_i386_1 | |
2220 | $(TEST_OBJDUMP) -d $< > $@ | |
2221 | split_i386_2: split_i386_2.o split_i386_n.o ../ld-new | |
2222 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o | |
2223 | split_i386_2.stdout: split_i386_2 | |
2224 | $(TEST_OBJDUMP) -d $< > $@ | |
2225 | split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new | |
2226 | ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0 | |
2227 | split_i386_4: split_i386_4.o split_i386_n.o ../ld-new | |
2228 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o | |
2229 | split_i386_4.stdout: split_i386_4 | |
2230 | $(TEST_OBJDUMP) -d $< > $@ | |
2231 | split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new | |
2232 | ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0 | |
2233 | MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \ | |
2234 | split_i386_4 split_i386_r | |
2235 | ||
2236 | endif DEFAULT_TARGET_I386 | |
2237 | ||
2238 | if DEFAULT_TARGET_X86_64 | |
2239 | ||
2240 | check_SCRIPTS += split_x86_64.sh | |
2241 | check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \ | |
2242 | split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout | |
2243 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
2244 | split_x86_64_1.o: split_x86_64_1.s | |
2245 | $(TEST_AS) -o $@ $< | |
2246 | split_x86_64_2.o: split_x86_64_2.s | |
2247 | $(TEST_AS) -o $@ $< | |
2248 | split_x86_64_3.o: split_x86_64_3.s | |
2249 | $(TEST_AS) -o $@ $< | |
2250 | split_x86_64_4.o: split_x86_64_4.s | |
2251 | $(TEST_AS) -o $@ $< | |
2252 | split_x86_64_n.o: split_x86_64_n.s | |
2253 | $(TEST_AS) -o $@ $< | |
2254 | split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
2255 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o | |
2256 | split_x86_64_1.stdout: split_x86_64_1 | |
2257 | $(TEST_OBJDUMP) -d $< > $@ | |
2258 | split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new | |
2259 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o | |
2260 | split_x86_64_2.stdout: split_x86_64_2 | |
2261 | $(TEST_OBJDUMP) -d $< > $@ | |
2262 | split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new | |
2263 | ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0 | |
2264 | split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new | |
2265 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o | |
2266 | split_x86_64_4.stdout: split_x86_64_4 | |
2267 | $(TEST_OBJDUMP) -d $< > $@ | |
2268 | split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
2269 | ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 | |
2270 | MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ | |
2271 | split_x86_64_4 split_x86_64_r | |
2272 | ||
2273 | endif DEFAULT_TARGET_X86_64 | |
e4782e83 DK |
2274 | |
2275 | if DEFAULT_TARGET_ARM | |
2276 | ||
2277 | check_SCRIPTS += arm_abs_global.sh | |
2278 | check_DATA += arm_abs_global.stdout | |
2279 | arm_abs_lib.o: arm_abs_lib.s | |
2280 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 2281 | libarm_abs.so: arm_abs_lib.o ../ld-new |
e4782e83 DK |
2282 | ../ld-new -shared -o $@ arm_abs_lib.o |
2283 | arm_abs_global.o: arm_abs_global.s | |
2284 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 2285 | arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new |
e4782e83 DK |
2286 | ../ld-new -o $@ arm_abs_global.o -L. -larm_abs |
2287 | arm_abs_global.stdout: arm_abs_global | |
2288 | $(TEST_READELF) -r $< > $@ | |
2289 | ||
2290 | MOSTLYCLEANFILES += arm_abs_global | |
2291 | ||
aa98ff75 | 2292 | check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh |
2a2b6d42 DK |
2293 | check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \ |
2294 | thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \ | |
a2c7281b DK |
2295 | thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \ |
2296 | thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \ | |
aa98ff75 | 2297 | thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \ |
57eb9b50 DK |
2298 | thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \ |
2299 | arm_thm_jump8.stdout | |
2a2b6d42 DK |
2300 | |
2301 | arm_bl_in_range.stdout: arm_bl_in_range | |
2302 | $(TEST_OBJDUMP) -D $< > $@ | |
2303 | ||
d3bbad62 | 2304 | arm_bl_in_range: arm_bl_in_range.o ../ld-new |
2a2b6d42 DK |
2305 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
2306 | ||
2307 | arm_bl_in_range.o: arm_bl_in_range.s | |
2308 | $(TEST_AS) -o $@ $< | |
2309 | ||
2310 | arm_bl_out_of_range.stdout: arm_bl_out_of_range | |
2311 | $(TEST_OBJDUMP) -S $< > $@ | |
2312 | ||
d3bbad62 | 2313 | arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
2314 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
2315 | ||
2316 | arm_bl_out_of_range.o: arm_bl_out_of_range.s | |
2317 | $(TEST_AS) -o $@ $< | |
2318 | ||
2319 | thumb_bl_in_range.stdout: thumb_bl_in_range | |
2320 | $(TEST_OBJDUMP) -D $< > $@ | |
2321 | ||
d3bbad62 | 2322 | thumb_bl_in_range: thumb_bl_in_range.o ../ld-new |
a8e2273b | 2323 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2a2b6d42 DK |
2324 | |
2325 | thumb_bl_in_range.o: thumb_bl_in_range.s | |
2326 | $(TEST_AS) -o $@ -march=armv5te $< | |
2327 | ||
2328 | thumb_bl_out_of_range.stdout: thumb_bl_out_of_range | |
2329 | $(TEST_OBJDUMP) -D $< > $@ | |
2330 | ||
a2c7281b | 2331 | thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new |
a8e2273b | 2332 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2a2b6d42 | 2333 | |
a2c7281b | 2334 | thumb_bl_out_of_range.o: thumb_bl_out_of_range.s |
2a2b6d42 DK |
2335 | $(TEST_AS) -o $@ -march=armv5te $< |
2336 | ||
2337 | thumb2_bl_in_range.stdout: thumb2_bl_in_range | |
2338 | $(TEST_OBJDUMP) -D $< > $@ | |
2339 | ||
d3bbad62 | 2340 | thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new |
2a2b6d42 DK |
2341 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2342 | ||
2343 | thumb2_bl_in_range.o: thumb_bl_in_range.s | |
2344 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2345 | ||
2346 | thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range | |
2347 | $(TEST_OBJDUMP) -D $< > $@ | |
2348 | ||
a2c7281b | 2349 | thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new |
2a2b6d42 DK |
2350 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2351 | ||
a2c7281b DK |
2352 | thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s |
2353 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2354 | ||
2355 | thumb_blx_in_range.stdout: thumb_blx_in_range | |
2356 | $(TEST_OBJDUMP) -D $< > $@ | |
2357 | ||
2358 | thumb_blx_in_range: thumb_blx_in_range.o ../ld-new | |
a8e2273b | 2359 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
a2c7281b DK |
2360 | |
2361 | thumb_blx_in_range.o: thumb_blx_in_range.s | |
2362 | $(TEST_AS) -o $@ -march=armv5te $< | |
2363 | ||
2364 | thumb_blx_out_of_range.stdout: thumb_blx_out_of_range | |
2365 | $(TEST_OBJDUMP) -D $< > $@ | |
2366 | ||
2367 | thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new | |
a8e2273b | 2368 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
a2c7281b DK |
2369 | |
2370 | thumb_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2371 | $(TEST_AS) -o $@ -march=armv5te $< | |
2372 | ||
2373 | thumb2_blx_in_range.stdout: thumb2_blx_in_range | |
2374 | $(TEST_OBJDUMP) -D $< > $@ | |
2375 | ||
2376 | thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new | |
2377 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
2378 | ||
2379 | thumb2_blx_in_range.o: thumb_blx_in_range.s | |
2380 | $(TEST_AS) -o $@ -march=armv7-a $< | |
2381 | ||
2382 | thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range | |
2383 | $(TEST_OBJDUMP) -D $< > $@ | |
2384 | ||
2385 | thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new | |
2386 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< | |
2387 | ||
2388 | thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2a2b6d42 DK |
2389 | $(TEST_AS) -o $@ -march=armv7-a $< |
2390 | ||
aa98ff75 DK |
2391 | thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local |
2392 | $(TEST_OBJDUMP) -D $< > $@ | |
2393 | ||
2394 | thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new | |
a8e2273b | 2395 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
aa98ff75 DK |
2396 | |
2397 | thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s | |
2398 | $(TEST_AS) -o $@ -march=armv5te $< | |
2399 | ||
57eb9b50 DK |
2400 | arm_thm_jump11.stdout: arm_thm_jump11 |
2401 | $(TEST_OBJDUMP) -D $< > $@ | |
2402 | ||
2403 | arm_thm_jump11: arm_thm_jump11.o ../ld-new | |
2404 | ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $< | |
2405 | ||
2406 | arm_thm_jump11.o: arm_thm_jump11.s | |
2407 | $(TEST_AS) -o $@ $< | |
2408 | ||
2409 | arm_thm_jump8.stdout: arm_thm_jump8 | |
2410 | $(TEST_OBJDUMP) -D $< > $@ | |
2411 | ||
2412 | arm_thm_jump8: arm_thm_jump8.o ../ld-new | |
2413 | ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $< | |
2414 | ||
2415 | arm_thm_jump8.o: arm_thm_jump8.s | |
2416 | $(TEST_AS) -o $@ $< | |
2417 | ||
2a2b6d42 | 2418 | MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \ |
a2c7281b DK |
2419 | thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \ |
2420 | thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \ | |
57eb9b50 DK |
2421 | thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \ |
2422 | arm_thm_jump8 | |
2a2b6d42 | 2423 | |
2fd9ae7a DK |
2424 | check_SCRIPTS += arm_fix_v4bx.sh |
2425 | check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \ | |
2426 | arm_no_fix_v4bx.stdout | |
2427 | ||
2428 | arm_fix_v4bx.stdout: arm_fix_v4bx | |
2429 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2430 | ||
d3bbad62 | 2431 | arm_fix_v4bx: arm_fix_v4bx.o ../ld-new |
a8e2273b | 2432 | ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $< |
2fd9ae7a DK |
2433 | |
2434 | arm_fix_v4bx.o: arm_fix_v4bx.s | |
2435 | $(TEST_AS) -o $@ $< | |
2436 | ||
2437 | arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking | |
2438 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2439 | ||
d3bbad62 | 2440 | arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new |
a8e2273b | 2441 | ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $< |
2fd9ae7a DK |
2442 | |
2443 | arm_no_fix_v4bx.stdout: arm_no_fix_v4bx | |
2444 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2445 | ||
d3bbad62 | 2446 | arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new |
a8e2273b | 2447 | ../ld-new --no-fix-arm1176 -o $@ $< |
2fd9ae7a DK |
2448 | |
2449 | MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx | |
2450 | ||
da59ad79 DK |
2451 | check_SCRIPTS += arm_attr_merge.sh |
2452 | check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \ | |
2453 | arm_attr_merge_7.stdout | |
2454 | ||
2455 | arm_attr_merge_6.stdout: arm_attr_merge_6 | |
2456 | $(TEST_READELF) -A $< > $@ | |
2457 | ||
2458 | arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o | |
2459 | ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o | |
2460 | ||
2461 | arm_attr_merge_6a.o: arm_attr_merge_6a.s | |
2462 | $(TEST_AS) -o $@ $< | |
2463 | ||
2464 | arm_attr_merge_6b.o: arm_attr_merge_6b.s | |
2465 | $(TEST_AS) -o $@ $< | |
2466 | ||
2467 | arm_attr_merge_6r.stdout: arm_attr_merge_6r | |
2468 | $(TEST_READELF) -A $< > $@ | |
2469 | ||
2470 | arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o | |
2471 | ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o | |
2472 | ||
2473 | arm_attr_merge_7.stdout: arm_attr_merge_7 | |
2474 | $(TEST_READELF) -A $< > $@ | |
2475 | ||
2476 | arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o | |
2477 | ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o | |
2478 | ||
2479 | arm_attr_merge_7a.o: arm_attr_merge_7a.s | |
2480 | $(TEST_AS) -o $@ $< | |
2481 | ||
2482 | arm_attr_merge_7b.o: arm_attr_merge_7b.s | |
2483 | $(TEST_AS) -o $@ $< | |
2484 | ||
2485 | MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7 | |
2486 | ||
a8e2273b ILT |
2487 | # ARM1176 workaround test. |
2488 | check_SCRIPTS += arm_fix_1176.sh | |
2489 | check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \ | |
2490 | arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \ | |
2491 | arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout | |
2492 | ||
2493 | arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z | |
2494 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2495 | ||
2496 | arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new | |
2497 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2498 | ||
2499 | arm_fix_1176_default_v6z.o: arm_fix_1176.s | |
2500 | $(TEST_AS) -march=armv6z -o $@ $< | |
2501 | ||
2502 | arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z | |
2503 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2504 | ||
2505 | arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new | |
2506 | ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $< | |
2507 | ||
2508 | arm_fix_1176_on_v6z.o: arm_fix_1176.s | |
2509 | $(TEST_AS) -march=armv6z -o $@ $< | |
2510 | ||
2511 | arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z | |
2512 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2513 | ||
2514 | arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new | |
2515 | ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $< | |
2516 | ||
2517 | arm_fix_1176_off_v6z.o: arm_fix_1176.s | |
2518 | $(TEST_AS) -march=armv6z -o $@ $< | |
2519 | ||
2520 | arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te | |
2521 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2522 | ||
2523 | arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new | |
2524 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2525 | ||
2526 | arm_fix_1176_default_v5te.o: arm_fix_1176.s | |
2527 | $(TEST_AS) -march=armv5te -o $@ $< | |
2528 | ||
2529 | arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a | |
2530 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2531 | ||
2532 | arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new | |
2533 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2534 | ||
2535 | arm_fix_1176_default_v7a.o: arm_fix_1176.s | |
2536 | $(TEST_AS) -march=armv7-a -o $@ $< | |
2537 | ||
2538 | arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s | |
2539 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
2540 | ||
2541 | arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new | |
2542 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
2543 | ||
2544 | arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s | |
2545 | $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $< | |
2546 | ||
2547 | MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \ | |
2548 | arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s | |
2549 | ||
aa98ff75 DK |
2550 | # Cortex-A8 workaround test. |
2551 | ||
2552 | check_SCRIPTS += arm_cortex_a8.sh | |
2553 | check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \ | |
2554 | arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \ | |
2555 | arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout | |
2556 | ||
2557 | arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond | |
2558 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2559 | ||
2560 | arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new | |
2561 | ../ld-new -o $@ $< | |
2562 | ||
2563 | arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s | |
2564 | $(TEST_AS) -o $@ $< | |
2565 | ||
2566 | arm_cortex_a8_b.stdout: arm_cortex_a8_b | |
2567 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2568 | ||
2569 | arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new | |
2570 | ../ld-new --fix-cortex-a8 -o $@ $< | |
2571 | ||
2572 | arm_cortex_a8_b.o: arm_cortex_a8_b.s | |
2573 | $(TEST_AS) -o $@ $< | |
2574 | ||
2575 | arm_cortex_a8_bl.stdout: arm_cortex_a8_bl | |
2576 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2577 | ||
2578 | arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new | |
2579 | ../ld-new -o $@ $< | |
2580 | ||
2581 | arm_cortex_a8_bl.o: arm_cortex_a8_bl.s | |
2582 | $(TEST_AS) -o $@ $< | |
2583 | ||
2584 | arm_cortex_a8_blx.stdout: arm_cortex_a8_blx | |
2585 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2586 | ||
2587 | arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new | |
2588 | ../ld-new -o $@ $< | |
2589 | ||
2590 | arm_cortex_a8_blx.o: arm_cortex_a8_blx.s | |
2591 | $(TEST_AS) -o $@ $< | |
2592 | ||
2593 | arm_cortex_a8_local.stdout: arm_cortex_a8_local | |
2594 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2595 | ||
2596 | arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new | |
2597 | ../ld-new -o $@ $< | |
2598 | ||
2599 | arm_cortex_a8_local.o: arm_cortex_a8_local.s | |
2600 | $(TEST_AS) -o $@ $< | |
2601 | ||
2602 | arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc | |
2603 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
2604 | ||
2605 | arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new | |
2606 | ../ld-new -o $@ $< | |
2607 | ||
2608 | arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s | |
2609 | $(TEST_AS) -o $@ $< | |
2610 | ||
2611 | MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \ | |
2612 | arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc | |
2613 | ||
c87e4302 DK |
2614 | check_SCRIPTS += arm_exidx_test.sh |
2615 | check_DATA += arm_exidx_test.stdout | |
2616 | ||
2617 | arm_exidx_test.stdout: arm_exidx_test.so | |
647f1574 | 2618 | $(TEST_READELF) -Sr $< > $@ |
c87e4302 DK |
2619 | |
2620 | arm_exidx_test.so: arm_exidx_test.o ../ld-new | |
2621 | ../ld-new -shared -o $@ $< | |
2622 | ||
2623 | arm_exidx_test.o: arm_exidx_test.s | |
2624 | $(TEST_AS) -o $@ $< | |
2625 | ||
f62a3ca7 DK |
2626 | check_SCRIPTS += pr12826.sh |
2627 | check_DATA += pr12826.stdout | |
2628 | ||
2629 | pr12826.stdout: pr12826.so | |
2630 | $(TEST_READELF) -A $< > $@ | |
2631 | ||
2632 | pr12826.so: pr12826_1.o pr12826_2.o ../ld-new | |
2633 | ../ld-new -shared -o $@ $< | |
2634 | ||
2635 | pr12826_1.o: pr12826_1.s | |
2636 | $(TEST_AS) -o $@ $< | |
2637 | ||
2638 | pr12826_2.o: pr12826_2.s | |
2639 | $(TEST_AS) -o $@ $< | |
c87e4302 | 2640 | |
f6cccc2c | 2641 | check_SCRIPTS += arm_unaligned_reloc.sh |
2c339f71 | 2642 | check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout |
f6cccc2c DK |
2643 | |
2644 | arm_unaligned_reloc.stdout: arm_unaligned_reloc | |
2645 | $(TEST_OBJDUMP) -D $< > $@ | |
2646 | ||
2c339f71 DK |
2647 | arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r |
2648 | $(TEST_OBJDUMP) -Dr $< > $@ | |
2649 | ||
f6cccc2c DK |
2650 | arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new |
2651 | ../ld-new -o $@ $< | |
2652 | ||
2c339f71 DK |
2653 | arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new |
2654 | ../ld-new -r -o $@ $< | |
2655 | ||
f6cccc2c DK |
2656 | arm_unaligned_reloc.o: arm_unaligned_reloc.s |
2657 | $(TEST_AS) -o $@ $< | |
2658 | ||
2c339f71 | 2659 | MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r |
f6cccc2c | 2660 | |
cd6eab1c ILT |
2661 | # Check ARM to ARM farcall veneers |
2662 | ||
2663 | check_SCRIPTS += arm_farcall_arm_arm.sh | |
2664 | check_DATA += arm_farcall_arm_arm.stdout | |
2665 | ||
2666 | arm_farcall_arm_arm.stdout: arm_farcall_arm_arm | |
2667 | $(TEST_OBJDUMP) -d $< > $@ | |
2668 | ||
2669 | arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new | |
a8e2273b | 2670 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $< |
cd6eab1c ILT |
2671 | |
2672 | arm_farcall_arm_arm.o: arm_farcall_arm_arm.s | |
2673 | $(TEST_AS) -o $@ $< | |
2674 | ||
2675 | MOSTLYCLEANFILES += arm_farcall_arm_arm | |
2676 | ||
2677 | # Check ARM to Thumb farcall veneers | |
2678 | ||
2679 | check_SCRIPTS += arm_farcall_arm_thumb.sh | |
2680 | check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout | |
2681 | ||
2682 | arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb | |
2683 | $(TEST_OBJDUMP) -D $< > $@ | |
2684 | ||
2685 | arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new | |
2686 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2687 | ||
2688 | arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s | |
2689 | $(TEST_AS) -o $@ $< | |
2690 | ||
2691 | arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t | |
2692 | $(TEST_OBJDUMP) -D $< > $@ | |
2693 | ||
2694 | arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new | |
a8e2273b | 2695 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
2696 | |
2697 | arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s | |
2698 | $(TEST_AS) -march=armv5t -o $@ $< | |
2699 | ||
2700 | MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t | |
2701 | ||
2702 | # Check Thumb to Thumb farcall veneers | |
2703 | ||
2704 | check_SCRIPTS += arm_farcall_thumb_thumb.sh | |
2705 | check_DATA += arm_farcall_thumb_thumb.stdout \ | |
2706 | arm_farcall_thumb_thumb_5t.stdout \ | |
2707 | arm_farcall_thumb_thumb_7m.stdout \ | |
2708 | arm_farcall_thumb_thumb_6m.stdout | |
2709 | ||
2710 | arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb | |
2711 | $(TEST_OBJDUMP) -D $< > $@ | |
2712 | ||
2713 | arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new | |
2714 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2715 | ||
2716 | arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s | |
2717 | $(TEST_AS) -march=armv4t -o $@ $< | |
2718 | ||
2719 | arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t | |
2720 | $(TEST_OBJDUMP) -D $< > $@ | |
2721 | ||
2722 | arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new | |
a8e2273b | 2723 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
2724 | |
2725 | arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s | |
2726 | $(TEST_AS) -march=armv5t -o $@ $< | |
2727 | ||
2728 | arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m | |
2729 | $(TEST_OBJDUMP) -D $< > $@ | |
2730 | ||
2731 | arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new | |
2732 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2733 | ||
2734 | arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s | |
2735 | $(TEST_AS) -march=armv7-m -o $@ $< | |
2736 | ||
2737 | arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m | |
2738 | $(TEST_OBJDUMP) -D $< > $@ | |
2739 | ||
2740 | arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new | |
2741 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
2742 | ||
2743 | arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s | |
2744 | $(TEST_AS) -march=armv6-m -o $@ $< | |
2745 | ||
2746 | MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \ | |
2747 | arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m | |
2748 | ||
2749 | # Check Thumb to ARM farcall veneers | |
2750 | ||
2751 | check_SCRIPTS += arm_farcall_thumb_arm.sh | |
2752 | check_DATA += arm_farcall_thumb_arm.stdout \ | |
2753 | arm_farcall_thumb_arm_5t.stdout | |
2754 | ||
2755 | arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm | |
2756 | $(TEST_OBJDUMP) -D $< > $@ | |
2757 | ||
2758 | arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new | |
2759 | ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< | |
2760 | ||
2761 | arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s | |
2762 | $(TEST_AS) -o $@ $< | |
2763 | ||
2764 | arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t | |
2765 | $(TEST_OBJDUMP) -D $< > $@ | |
2766 | ||
2767 | arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new | |
a8e2273b | 2768 | ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
2769 | |
2770 | arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s | |
2771 | $(TEST_AS) -march=armv5t -o $@ $< | |
2772 | ||
2773 | MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t | |
2774 | ||
e4782e83 | 2775 | endif DEFAULT_TARGET_ARM |
eb373049 ILT |
2776 | |
2777 | endif NATIVE_OR_CROSS_LINKER | |
2778 | ||
35c813e2 CC |
2779 | # Tests for the dwp tool. |
2780 | # We don't want to rely yet on GCC support for -gsplit-dwarf, | |
2781 | # so we use (for now) test cases in x86 assembly language, | |
2782 | # compiled from the dwp_test_*.cc sources. | |
2783 | ||
2784 | if DEFAULT_TARGET_X86_64 | |
2785 | ||
2786 | dwp_test_main.o: dwp_test_main.s | |
2787 | $(TEST_AS) -o $@ $< | |
2788 | dwp_test_1.o: dwp_test_1.s | |
2789 | $(TEST_AS) -o $@ $< | |
2790 | dwp_test_1b.o: dwp_test_1b.s | |
2791 | $(TEST_AS) -o $@ $< | |
2792 | dwp_test_2.o: dwp_test_2.s | |
2793 | $(TEST_AS) -o $@ $< | |
2794 | ||
2795 | dwp_test_main.dwo: dwp_test_main.o | |
2796 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2797 | dwp_test_1.dwo: dwp_test_1.o | |
2798 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2799 | dwp_test_1b.dwo: dwp_test_1b.o | |
2800 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2801 | dwp_test_2.dwo: dwp_test_2.o | |
2802 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
2803 | ||
0ec6429b | 2804 | MOSTLYCLEANFILES += *.dwo *.dwp |
35c813e2 CC |
2805 | check_SCRIPTS += dwp_test_1.sh |
2806 | check_DATA += dwp_test_1.stdout | |
2807 | dwp_test_1.stdout: dwp_test_1.dwp | |
2808 | $(TEST_READELF) -wi $< > $@ | |
2809 | dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo | |
2810 | ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo | |
2811 | ||
2812 | check_SCRIPTS += dwp_test_2.sh | |
2813 | check_DATA += dwp_test_2.stdout | |
2814 | dwp_test_2.stdout: dwp_test_2.dwp | |
2815 | $(TEST_READELF) -wi $< > $@ | |
2816 | dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp | |
2817 | ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp | |
2818 | dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo | |
2819 | ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo | |
2820 | dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo | |
2821 | ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo | |
2822 | ||
2823 | endif DEFAULT_TARGET_X86_64 |