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