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