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 | ||
44803b5d CC |
141 | check_PROGRAMS += overflow_unittest |
142 | overflow_unittest_SOURCES = overflow_unittest.cc | |
143 | overflow_unittest.o: overflow_unittest.cc | |
144 | $(CXXCOMPILE) -O3 -c -o $@ $< | |
145 | ||
eb373049 | 146 | endif NATIVE_OR_CROSS_LINKER |
351a8000 ILT |
147 | |
148 | # --------------------------------------------------------------------- | |
149 | # These tests test the output of gold (end-to-end tests). In | |
150 | # particular, they make sure that gold can link "difficult" object | |
151 | # files, and the resulting object files run correctly. These can only | |
152 | # run if we've built ld-new for the native architecture (that is, | |
153 | # we're not cross-compiling it), since we run ld-new as part of these | |
154 | # tests. We use the gcc-specific flag '-B' to use our linker instead | |
155 | # of the default linker, which is why we only run our tests under gcc. | |
a360aedd | 156 | |
e2827e5f | 157 | if NATIVE_LINKER |
351a8000 | 158 | if GCC |
e2827e5f | 159 | |
351a8000 ILT |
160 | # Each of these .o's is a useful, small complete program. They're |
161 | # particularly useful for making sure ld-new's flags do what they're | |
162 | # supposed to (hence their names), but are used for many tests that | |
163 | # don't actually involve analyzing input data. | |
43771f76 ILT |
164 | flagstest_debug.o: constructor_test.cc |
165 | $(CXXCOMPILE) -O0 -g -c -o $@ $< | |
166 | flagstest_ndebug.o: constructor_test.cc | |
167 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
168 | ||
325e6408 RÁE |
169 | check_SCRIPTS += incremental_test.sh |
170 | check_DATA += incremental_test.stdout | |
0ec6429b | 171 | MOSTLYCLEANFILES += incremental_test incremental_test.cmdline |
325e6408 RÁE |
172 | incremental_test_1.o: incremental_test_1.c |
173 | $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
174 | incremental_test_2.o: incremental_test_2.c | |
175 | $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
176 | incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld | |
943c8b43 | 177 | $(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 |
178 | incremental_test.stdout: incremental_test ../incremental-dump |
179 | ../incremental-dump incremental_test > $@ | |
43771f76 | 180 | |
531813ad ST |
181 | check_SCRIPTS += gc_comdat_test.sh |
182 | check_DATA += gc_comdat_test.stdout | |
72fef11a | 183 | MOSTLYCLEANFILES += gc_comdat_test |
2b64b551 | 184 | gc_comdat_test_1.o: gc_comdat_test_1.cc |
4daadc0d | 185 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
2b64b551 | 186 | gc_comdat_test_2.o: gc_comdat_test_2.cc |
4daadc0d | 187 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
531813ad | 188 | gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld |
4daadc0d | 189 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o |
531813ad ST |
190 | gc_comdat_test.stdout: gc_comdat_test |
191 | $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout | |
192 | ||
27721062 ST |
193 | check_SCRIPTS += gc_tls_test.sh |
194 | check_DATA += gc_tls_test.stdout | |
72fef11a | 195 | MOSTLYCLEANFILES += gc_tls_test |
27721062 ST |
196 | gc_tls_test.o: gc_tls_test.cc |
197 | $(CXXCOMPILE) -O0 -c -g -o $@ $< | |
198 | gc_tls_test:gc_tls_test.o gcctestdir/ld | |
199 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o | |
200 | gc_tls_test.stdout: gc_tls_test | |
201 | $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout | |
202 | ||
f1ec9ded ST |
203 | check_SCRIPTS += gc_orphan_section_test.sh |
204 | check_DATA += gc_orphan_section_test.stdout | |
205 | MOSTLYCLEANFILES += gc_orphan_section_test | |
206 | gc_orphan_section_test.o: gc_orphan_section_test.cc | |
207 | $(CXXCOMPILE) -O0 -c -g -o $@ $< | |
208 | gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld | |
209 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o | |
210 | gc_orphan_section_test.stdout: gc_orphan_section_test | |
211 | $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout | |
212 | ||
b9b2ae8b NC |
213 | check_SCRIPTS += pr14265.sh |
214 | check_DATA += pr14265.stdout | |
215 | MOSTLYCLEANFILES += pr14265 | |
216 | pr14265.o: pr14265.c | |
217 | $(COMPILE) -O0 -c -o $@ $< | |
78d9f182 | 218 | pr14265: pr14265.o gcctestdir/ld $(srcdir)/pr14265.t |
1496b446 | 219 | $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,-T,$(srcdir)/pr14265.t -o $@ $< |
b9b2ae8b NC |
220 | pr14265.stdout: pr14265 |
221 | $(TEST_NM) --format=bsd --numeric-sort $< > $@ | |
222 | ||
cc90de49 IK |
223 | check_SCRIPTS += pr20717.sh |
224 | check_DATA += pr20717.stdout | |
225 | MOSTLYCLEANFILES += pr20717 | |
226 | pr20717.o: pr20717.c | |
227 | $(COMPILE) -O0 -ffunction-sections -c -o $@ $< | |
228 | pr20717: pr20717.o gcctestdir/ld $(srcdir)/pr20717.t | |
229 | $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,-T,$(srcdir)/pr20717.t -o $@ $< | |
230 | pr20717.stdout: pr20717 | |
231 | $(TEST_NM) $< > $@ | |
232 | ||
fd834e57 CC |
233 | check_SCRIPTS += gc_dynamic_list_test.sh |
234 | check_DATA += gc_dynamic_list_test.stdout | |
235 | MOSTLYCLEANFILES += gc_dynamic_list_test | |
236 | gc_dynamic_list_test.o: gc_dynamic_list_test.c | |
237 | $(COMPILE) -c -ffunction-sections -o $@ $< | |
238 | gc_dynamic_list_test: gc_dynamic_list_test.o gcctestdir/ld $(srcdir)/gc_dynamic_list_test.t | |
239 | $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,--dynamic-list,$(srcdir)/gc_dynamic_list_test.t gc_dynamic_list_test.o | |
240 | gc_dynamic_list_test.stdout: gc_dynamic_list_test | |
241 | $(TEST_NM) gc_dynamic_list_test > $@ | |
242 | ||
ef15dade | 243 | check_SCRIPTS += icf_test.sh |
4d9aa155 AM |
244 | check_DATA += icf_test.map |
245 | MOSTLYCLEANFILES += icf_test icf_test.map | |
2b64b551 | 246 | icf_test.o: icf_test.cc |
ef15dade | 247 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
54de2ea6 | 248 | icf_test: icf_test.o gcctestdir/ld |
4d9aa155 | 249 | $(CXXLINK) -o icf_test -Bgcctestdir/ -Wl,--icf=all,-Map,icf_test.map icf_test.o |
54de2ea6 CC |
250 | icf_test.map: icf_test |
251 | @touch icf_test.map | |
ef15dade | 252 | |
48c187ce ST |
253 | check_SCRIPTS += icf_keep_unique_test.sh |
254 | check_DATA += icf_keep_unique_test.stdout | |
72fef11a | 255 | MOSTLYCLEANFILES += icf_keep_unique_test |
48c187ce ST |
256 | icf_keep_unique_test.o: icf_keep_unique_test.cc |
257 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
258 | icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld | |
032ce4e9 | 259 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o |
48c187ce | 260 | icf_keep_unique_test.stdout: icf_keep_unique_test |
4d9aa155 | 261 | $(TEST_NM) -C $< > $@ |
531813ad | 262 | |
032ce4e9 | 263 | check_SCRIPTS += icf_safe_test.sh |
4d9aa155 AM |
264 | check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout icf_safe_test.map |
265 | MOSTLYCLEANFILES += icf_safe_test icf_safe_test.map | |
21bb3914 | 266 | icf_safe_test.o: icf_safe_test.cc |
032ce4e9 | 267 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
54de2ea6 | 268 | icf_safe_test: icf_safe_test.o gcctestdir/ld |
4d9aa155 | 269 | $(CXXLINK) -o icf_safe_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_test.map icf_safe_test.o |
54de2ea6 CC |
270 | icf_safe_test.map: icf_safe_test |
271 | @touch icf_safe_test.map | |
21bb3914 | 272 | icf_safe_test_1.stdout: icf_safe_test |
4d9aa155 | 273 | $(TEST_NM) $< > $@ |
21bb3914 | 274 | icf_safe_test_2.stdout: icf_safe_test |
4d9aa155 | 275 | $(TEST_READELF) -h $< > $@ |
21bb3914 | 276 | |
4aebb631 RC |
277 | check_SCRIPTS += icf_safe_pie_test.sh |
278 | check_DATA += icf_safe_pie_test_1.stdout icf_safe_pie_test_2.stdout icf_safe_pie_test.map | |
279 | MOSTLYCLEANFILES += icf_safe_pie_test icf_safe_pie_test.map | |
280 | icf_safe_pie_test.o: icf_safe_test.cc | |
281 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $< | |
282 | icf_safe_pie_test: icf_safe_pie_test.o gcctestdir/ld | |
283 | $(CXXLINK) -o icf_safe_pie_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_pie_test.map icf_safe_pie_test.o -pie | |
284 | icf_safe_pie_test.map: icf_safe_pie_test | |
285 | @touch icf_safe_pie_test.map | |
286 | icf_safe_pie_test_1.stdout: icf_safe_pie_test | |
287 | $(TEST_NM) $< > $@ | |
288 | icf_safe_pie_test_2.stdout: icf_safe_pie_test | |
289 | $(TEST_READELF) -h $< > $@ | |
290 | ||
21bb3914 | 291 | check_SCRIPTS += icf_safe_so_test.sh |
4d9aa155 AM |
292 | check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout icf_safe_so_test.map |
293 | MOSTLYCLEANFILES += icf_safe_so_test icf_safe_so_test.map | |
21bb3914 ST |
294 | icf_safe_so_test.o: icf_safe_so_test.cc |
295 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
54de2ea6 | 296 | icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld |
4d9aa155 | 297 | $(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 |
298 | icf_safe_so_test.map: |
299 | @touch icf_safe_so_test.map | |
21bb3914 | 300 | icf_safe_so_test_1.stdout: icf_safe_so_test |
4d9aa155 | 301 | $(TEST_NM) $< > $@ |
21bb3914 | 302 | icf_safe_so_test_2.stdout: icf_safe_so_test |
4d9aa155 | 303 | $(TEST_READELF) -h $< > $@ |
032ce4e9 | 304 | |
6e9ba2ca ST |
305 | check_SCRIPTS += final_layout.sh |
306 | check_DATA += final_layout.stdout | |
9e9143bc | 307 | MOSTLYCLEANFILES += final_layout final_layout_sequence.txt final_layout_script.lds |
6e9ba2ca ST |
308 | final_layout.o: final_layout.cc |
309 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< | |
310 | final_layout_sequence.txt: | |
311 | (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt | |
9e9143bc | 312 | final_layout_script.lds: |
a39e4af6 | 313 | (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .sbss : { *(.sbss*) } .bss : { *(.bss*) } }") > final_layout_script.lds |
9e9143bc ST |
314 | final_layout: final_layout.o final_layout_sequence.txt final_layout_script.lds gcctestdir/ld |
315 | $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt -Wl,-T,final_layout_script.lds final_layout.o | |
6e9ba2ca | 316 | final_layout.stdout: final_layout |
864a1b56 | 317 | $(TEST_NM) -n --synthetic final_layout > final_layout.stdout |
6e9ba2ca | 318 | |
28f2a4ac | 319 | check_SCRIPTS += text_section_grouping.sh |
c6ac678d ST |
320 | check_DATA += text_section_grouping.stdout text_section_no_grouping.stdout |
321 | MOSTLYCLEANFILES += text_section_grouping text_section_no_grouping | |
28f2a4ac ST |
322 | text_section_grouping.o: text_section_grouping.cc |
323 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
324 | text_section_grouping: text_section_grouping.o gcctestdir/ld | |
325 | $(CXXLINK) -Bgcctestdir/ text_section_grouping.o | |
c6ac678d ST |
326 | text_section_no_grouping: text_section_grouping.o gcctestdir/ld |
327 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-text-reorder text_section_grouping.o | |
28f2a4ac | 328 | text_section_grouping.stdout: text_section_grouping |
c6ac678d ST |
329 | $(TEST_NM) -n --synthetic text_section_grouping > text_section_grouping.stdout |
330 | text_section_no_grouping.stdout: text_section_no_grouping | |
2b64b551 | 331 | $(TEST_NM) -n --synthetic text_section_no_grouping > text_section_no_grouping.stdout |
28f2a4ac | 332 | |
6934001a CC |
333 | check_SCRIPTS += section_sorting_name.sh |
334 | check_DATA += section_sorting_name.stdout | |
335 | MOSTLYCLEANFILES += section_sorting_name | |
336 | section_sorting_name.o: section_sorting_name.cc | |
337 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
338 | section_sorting_name: section_sorting_name.o gcctestdir/ld | |
339 | $(CXXLINK) -Bgcctestdir/ -Wl,--sort-section=name section_sorting_name.o | |
340 | section_sorting_name.stdout: section_sorting_name | |
341 | $(TEST_NM) -n --synthetic section_sorting_name > section_sorting_name.stdout | |
342 | ||
2253bfba | 343 | check_PROGRAMS += icf_virtual_function_folding_test |
0ec6429b | 344 | MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map |
ce97fa81 ST |
345 | icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc |
346 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $< | |
347 | icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld | |
348 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie | |
349 | ||
350 | check_SCRIPTS += icf_preemptible_functions_test.sh | |
351 | check_DATA += icf_preemptible_functions_test.stdout | |
352 | MOSTLYCLEANFILES += icf_preemptible_functions_test | |
353 | icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc | |
354 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
355 | icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld | |
356 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared | |
357 | icf_preemptible_functions_test.stdout: icf_preemptible_functions_test | |
358 | $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout | |
359 | ||
360 | check_SCRIPTS += icf_string_merge_test.sh | |
361 | check_DATA += icf_string_merge_test.stdout | |
362 | MOSTLYCLEANFILES += icf_string_merge_test | |
363 | icf_string_merge_test.o: icf_string_merge_test.cc | |
364 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
365 | icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld | |
366 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o | |
367 | icf_string_merge_test.stdout: icf_string_merge_test | |
368 | $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout | |
369 | ||
41cbeecc ST |
370 | check_SCRIPTS += icf_sht_rel_addend_test.sh |
371 | check_DATA += icf_sht_rel_addend_test.stdout | |
372 | MOSTLYCLEANFILES += icf_sht_rel_addend_test | |
373 | icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc | |
374 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
375 | icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc | |
376 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< | |
377 | icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld | |
378 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o | |
379 | icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test | |
380 | $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout | |
381 | ||
7fb47cc9 CC |
382 | check_PROGRAMS += large_symbol_alignment |
383 | large_symbol_alignment_SOURCES = large_symbol_alignment.cc | |
384 | large_symbol_alignment_DEPENDENCIES = gcctestdir/ld | |
385 | large_symbol_alignment_LDFLAGS = -Bgcctestdir/ | |
54de2ea6 | 386 | large_symbol_alignment_LDADD = |
7fb47cc9 | 387 | |
e31908b6 CC |
388 | check_SCRIPTS += merge_string_literals.sh |
389 | check_DATA += merge_string_literals.stdout | |
390 | MOSTLYCLEANFILES += merge_string_literals | |
2b64b551 | 391 | merge_string_literals_1.o: merge_string_literals_1.cc |
e31908b6 | 392 | $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $< |
2b64b551 | 393 | merge_string_literals_2.o: merge_string_literals_2.cc |
e31908b6 CC |
394 | $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $< |
395 | merge_string_literals: merge_string_literals_1.o merge_string_literals_2.o gcctestdir/ld | |
396 | $(CXXLINK) -Bgcctestdir/ merge_string_literals_1.o merge_string_literals_2.o -O2 -shared -nostdlib | |
397 | merge_string_literals.stdout: merge_string_literals | |
398 | $(TEST_OBJDUMP) -s -j.rodata merge_string_literals > merge_string_literals.stdout | |
399 | ||
351a8000 | 400 | check_PROGRAMS += basic_test |
351a8000 | 401 | check_PROGRAMS += basic_pic_test |
56ba9a23 | 402 | basic_test.o: basic_test.cc |
22dc1b09 | 403 | $(CXXCOMPILE) -O0 -c -o $@ $< |
56ba9a23 ILT |
404 | basic_test: basic_test.o gcctestdir/ld |
405 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
328c7c2f | 406 | |
cfbf0e3c RÁE |
407 | check_PROGRAMS += eh_test |
408 | eh_test_a.o: eh_test_a.cc | |
409 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
410 | eh_test_b.o: eh_test_b.cc | |
411 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
412 | eh_test: eh_test_a.o eh_test_b.o gcctestdir/ld | |
413 | $(CXXLINK_S) -Bgcctestdir/ eh_test_a.o eh_test_b.o | |
414 | ||
698400bf CC |
415 | check_SCRIPTS += eh_test_2.sh |
416 | check_DATA += eh_test_2.sects | |
8db8e694 | 417 | MOSTLYCLEANFILES += eh_test_2 eh_test_2.sects |
698400bf CC |
418 | eh_test_r.o: eh_test_a.o eh_test_b.o gcctestdir/ld |
419 | gcctestdir/ld -r -o $@ eh_test_a.o eh_test_b.o | |
420 | eh_test_2: eh_test_r.o gcctestdir/ld | |
421 | $(CXXLINK_S) -Bgcctestdir/ -Wl,--eh-frame-hdr eh_test_r.o | |
422 | eh_test_2.sects: eh_test_2 | |
423 | $(TEST_READELF) -SW $< >$@ 2>/dev/null | |
424 | ||
328c7c2f ILT |
425 | if HAVE_STATIC |
426 | check_PROGRAMS += basic_static_test | |
56ba9a23 ILT |
427 | basic_static_test: basic_test.o gcctestdir/ld |
428 | $(CXXLINK) -Bgcctestdir/ -static basic_test.o | |
328c7c2f | 429 | endif |
22dc1b09 | 430 | |
56ba9a23 | 431 | basic_pic_test.o: basic_test.cc |
22dc1b09 | 432 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
56ba9a23 ILT |
433 | basic_pic_test: basic_pic_test.o gcctestdir/ld |
434 | $(CXXLINK) -Bgcctestdir/ basic_pic_test.o | |
328c7c2f ILT |
435 | |
436 | if HAVE_STATIC | |
437 | check_PROGRAMS += basic_static_pic_test | |
56ba9a23 ILT |
438 | basic_static_pic_test: basic_pic_test.o gcctestdir/ld |
439 | $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o | |
328c7c2f | 440 | endif |
22dc1b09 | 441 | |
374ad285 ILT |
442 | check_PROGRAMS += basic_pie_test |
443 | basic_pie_test.o: basic_test.cc | |
444 | $(CXXCOMPILE) -O0 -c -fpie -o $@ $< | |
445 | basic_pie_test: basic_pie_test.o gcctestdir/ld | |
446 | $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o | |
351a8000 ILT |
447 | |
448 | check_PROGRAMS += constructor_test | |
d5026652 ILT |
449 | constructor_test_SOURCES = constructor_test.cc |
450 | constructor_test_DEPENDENCIES = gcctestdir/ld | |
451 | constructor_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 452 | constructor_test_LDADD = |
d5026652 | 453 | |
328c7c2f ILT |
454 | if HAVE_STATIC |
455 | check_PROGRAMS += constructor_static_test | |
351a8000 ILT |
456 | constructor_static_test_SOURCES = $(constructor_test_SOURCES) |
457 | constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) | |
458 | constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static | |
1abce4a6 | 459 | constructor_static_test_LDADD = $(constructor_test_LDADD) |
328c7c2f | 460 | endif |
351a8000 ILT |
461 | |
462 | check_PROGRAMS += two_file_test | |
351a8000 | 463 | check_PROGRAMS += two_file_pic_test |
3bd52c28 ILT |
464 | two_file_test_SOURCES = \ |
465 | two_file_test_1.cc \ | |
03e8f2b2 | 466 | two_file_test_1b.cc \ |
3bd52c28 ILT |
467 | two_file_test_2.cc \ |
468 | two_file_test_main.cc \ | |
469 | two_file_test.h | |
470 | two_file_test_DEPENDENCIES = gcctestdir/ld | |
471 | two_file_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 472 | two_file_test_LDADD = |
3bd52c28 | 473 | |
328c7c2f ILT |
474 | if HAVE_STATIC |
475 | check_PROGRAMS += two_file_static_test | |
351a8000 ILT |
476 | two_file_static_test_SOURCES = $(two_file_test_SOURCES) |
477 | two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) | |
478 | two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static | |
1abce4a6 | 479 | two_file_static_test_LDADD = $(two_file_test_LDADD) |
328c7c2f | 480 | endif |
f958d5fc ILT |
481 | |
482 | two_file_pic_test_SOURCES = two_file_test_main.cc | |
483 | two_file_pic_test_DEPENDENCIES = \ | |
03e8f2b2 | 484 | gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 485 | two_file_pic_test_LDFLAGS = -Bgcctestdir/ |
03e8f2b2 | 486 | two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 487 | |
351a8000 ILT |
488 | |
489 | check_PROGRAMS += two_file_shared_1_test | |
490 | check_PROGRAMS += two_file_shared_2_test | |
491 | check_PROGRAMS += two_file_shared_1_pic_2_test | |
492 | check_PROGRAMS += two_file_shared_2_pic_1_test | |
493 | check_PROGRAMS += two_file_same_shared_test | |
494 | check_PROGRAMS += two_file_separate_shared_12_test | |
495 | check_PROGRAMS += two_file_separate_shared_21_test | |
496 | two_file_test_1_pic.o: two_file_test_1.cc | |
497 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
498 | two_file_test_1b_pic.o: two_file_test_1b.cc |
499 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 ILT |
500 | two_file_test_2_pic.o: two_file_test_2.cc |
501 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
502 | two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld |
503 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o | |
351a8000 ILT |
504 | two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld |
505 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o | |
03e8f2b2 ILT |
506 | two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld |
507 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o | |
351a8000 | 508 | |
3bd52c28 ILT |
509 | two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc |
510 | two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so | |
511 | two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
512 | two_file_shared_1_test_LDADD = two_file_shared_1.so | |
513 | ||
03e8f2b2 | 514 | two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
515 | two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so |
516 | two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
517 | two_file_shared_2_test_LDADD = two_file_shared_2.so | |
518 | ||
386c048c ILT |
519 | two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc |
520 | two_file_shared_1_pic_2_test_DEPENDENCIES = \ | |
2f2de248 | 521 | gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o |
386c048c | 522 | two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
03e8f2b2 | 523 | 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 |
524 | |
525 | two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc | |
526 | two_file_shared_2_pic_1_test_DEPENDENCIES = \ | |
e051a5b5 | 527 | gcctestdir/ld two_file_shared_1.so two_file_test_2_pic.o |
386c048c ILT |
528 | two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
529 | two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so | |
530 | ||
3bd52c28 ILT |
531 | two_file_same_shared_test_SOURCES = two_file_test_main.cc |
532 | two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so | |
533 | two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
534 | two_file_same_shared_test_LDADD = two_file_shared.so | |
535 | ||
536 | two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc | |
537 | two_file_separate_shared_12_test_DEPENDENCIES = \ | |
538 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
539 | two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
540 | two_file_separate_shared_12_test_LDADD = \ | |
541 | two_file_shared_1.so two_file_shared_2.so | |
542 | ||
543 | two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc | |
544 | two_file_separate_shared_21_test_DEPENDENCIES = \ | |
545 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
546 | two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
547 | two_file_separate_shared_21_test_LDADD = \ | |
548 | two_file_shared_2.so two_file_shared_1.so | |
549 | ||
6a74a719 ILT |
550 | check_PROGRAMS += two_file_relocatable_test |
551 | two_file_relocatable_test_SOURCES = two_file_test_main.cc | |
552 | two_file_relocatable_test_DEPENDENCIES = \ | |
553 | gcctestdir/ld two_file_relocatable.o | |
554 | two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
555 | two_file_relocatable_test_LDADD = two_file_relocatable.o | |
556 | two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
557 | gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
558 | ||
374ad285 ILT |
559 | check_PROGRAMS += two_file_pie_test |
560 | two_file_test_1_pie.o: two_file_test_1.cc | |
561 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
562 | two_file_test_1b_pie.o: two_file_test_1b.cc | |
563 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
564 | two_file_test_2_pie.o: two_file_test_2.cc | |
565 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
566 | two_file_test_main_pie.o: two_file_test_main.cc | |
567 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
568 | two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \ | |
569 | two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld | |
570 | $(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 | |
571 | ||
a82bef93 ST |
572 | check_PROGRAMS += pie_copyrelocs_test |
573 | pie_copyrelocs_test_SOURCES = pie_copyrelocs_test.cc | |
574 | pie_copyrelocs_test_DEPENDENCIES = gcctestdir/ld pie_copyrelocs_shared_test.so | |
4759c34e | 575 | pie_copyrelocs_test_CXXFLAGS = -fno-exceptions -fno-asynchronous-unwind-tables |
a82bef93 ST |
576 | pie_copyrelocs_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -pie |
577 | pie_copyrelocs_test_LDADD = pie_copyrelocs_shared_test.so | |
578 | pie_copyrelocs_shared_test.o: pie_copyrelocs_shared_test.cc | |
579 | $(CXXCOMPILE) -O2 -fpic -c -o $@ $< | |
580 | pie_copyrelocs_shared_test.so: pie_copyrelocs_shared_test.o gcctestdir/ld | |
581 | $(CXXLINK) -Bgcctestdir/ -shared pie_copyrelocs_shared_test.o | |
582 | ||
a100d66f ST |
583 | check_PROGRAMS += weak_unresolved_symbols_test |
584 | weak_unresolved_symbols_test_SOURCES = weak_unresolved_symbols_test.cc | |
585 | weak_unresolved_symbols_test_CXXFLAGS = -fPIE | |
586 | weak_unresolved_symbols_test_LDFLAGS = -Bgcctestdir/ -pie -Wl,--weak-unresolved-symbols | |
587 | ||
031cdbed ILT |
588 | check_SCRIPTS += two_file_shared.sh |
589 | check_DATA += two_file_shared.dbg | |
72fef11a | 590 | MOSTLYCLEANFILES += two_file_shared.dbg |
031cdbed ILT |
591 | two_file_shared.dbg: two_file_shared.so |
592 | $(TEST_READELF) -w $< >$@ 2>/dev/null | |
593 | ||
63402fe4 ILT |
594 | # The nonpic tests will fail on platforms which can not put non-PIC |
595 | # code into shared libraries, so we just don't run them in that case. | |
63402fe4 | 596 | if FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 597 | |
351a8000 ILT |
598 | check_PROGRAMS += two_file_shared_1_nonpic_test |
599 | check_PROGRAMS += two_file_shared_2_nonpic_test | |
600 | check_PROGRAMS += two_file_same_shared_nonpic_test | |
601 | check_PROGRAMS += two_file_separate_shared_12_nonpic_test | |
602 | check_PROGRAMS += two_file_separate_shared_21_nonpic_test | |
03e8f2b2 ILT |
603 | check_PROGRAMS += two_file_mixed_shared_test |
604 | check_PROGRAMS += two_file_mixed_2_shared_test | |
351a8000 | 605 | two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld |
611062c0 | 606 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext |
351a8000 ILT |
607 | two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld |
608 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o | |
03e8f2b2 | 609 | two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld |
611062c0 | 610 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext |
03e8f2b2 | 611 | 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 | 612 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext |
03e8f2b2 | 613 | 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 | 614 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext |
351a8000 | 615 | |
3bd52c28 ILT |
616 | two_file_shared_1_nonpic_test_SOURCES = \ |
617 | two_file_test_2.cc two_file_test_main.cc | |
618 | two_file_shared_1_nonpic_test_DEPENDENCIES = \ | |
619 | gcctestdir/ld two_file_shared_1_nonpic.so | |
620 | two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
621 | two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so | |
622 | ||
623 | two_file_shared_2_nonpic_test_SOURCES = \ | |
03e8f2b2 | 624 | two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
625 | two_file_shared_2_nonpic_test_DEPENDENCIES = \ |
626 | gcctestdir/ld two_file_shared_2_nonpic.so | |
627 | two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
628 | two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so | |
629 | ||
630 | two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc | |
631 | two_file_same_shared_nonpic_test_DEPENDENCIES = \ | |
632 | gcctestdir/ld two_file_shared_nonpic.so | |
633 | two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
634 | two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so | |
635 | ||
636 | two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc | |
637 | two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \ | |
638 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
639 | two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
640 | two_file_separate_shared_12_nonpic_test_LDADD = \ | |
641 | two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
642 | ||
643 | two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc | |
644 | two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \ | |
645 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
646 | two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
647 | two_file_separate_shared_21_nonpic_test_LDADD = \ | |
648 | two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so | |
649 | ||
03e8f2b2 ILT |
650 | two_file_mixed_shared_test_SOURCES = two_file_test_main.cc |
651 | two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so | |
652 | two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
653 | two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so | |
654 | ||
655 | two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc | |
656 | two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so | |
657 | two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
658 | two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so | |
659 | ||
d89051bd CC |
660 | check_PROGRAMS += two_file_mixed_pie_test |
661 | two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \ | |
662 | two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld | |
663 | $(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 | |
664 | ||
351a8000 | 665 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 666 | |
6835af53 ILT |
667 | check_PROGRAMS += two_file_strip_test |
668 | two_file_strip_test: two_file_test | |
669 | $(TEST_STRIP) -o two_file_strip_test two_file_test | |
670 | ||
671 | check_PROGRAMS += two_file_same_shared_strip_test | |
672 | two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc | |
673 | two_file_same_shared_strip_test_DEPENDENCIES = \ | |
674 | gcctestdir/ld two_file_shared_strip.so | |
675 | two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R. | |
676 | two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so | |
677 | two_file_shared_strip.so: two_file_shared.so | |
678 | $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so | |
679 | ||
49bdd526 ILT |
680 | check_PROGRAMS += common_test_1 |
681 | common_test_1_SOURCES = common_test_1.c | |
682 | common_test_1_DEPENDENCIES = gcctestdir/ld | |
683 | common_test_1_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 684 | common_test_1_LDADD = |
351a8000 | 685 | |
eda294df ILT |
686 | check_PROGRAMS += common_test_2 |
687 | common_test_2_SOURCES = common_test_1.c | |
688 | common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld | |
689 | common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
690 | common_test_2_LDADD = common_test_2.so common_test_3.so | |
691 | common_test_2_pic.o: common_test_2.c | |
692 | $(COMPILE) -c -fpic -o $@ $< | |
693 | common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld | |
694 | $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so | |
695 | common_test_3_pic.o: common_test_3.c | |
696 | $(COMPILE) -c -fpic -o $@ $< | |
697 | common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld | |
698 | $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script | |
699 | ||
351a8000 | 700 | check_PROGRAMS += exception_test |
351a8000 ILT |
701 | check_PROGRAMS += exception_shared_1_test |
702 | check_PROGRAMS += exception_shared_2_test | |
703 | check_PROGRAMS += exception_same_shared_test | |
704 | check_PROGRAMS += exception_separate_shared_12_test | |
705 | check_PROGRAMS += exception_separate_shared_21_test | |
706 | exception_test_1_pic.o: exception_test_1.cc | |
707 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
708 | exception_test_2_pic.o: exception_test_2.cc | |
709 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
710 | exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld | |
711 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o | |
712 | exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld | |
713 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o | |
714 | exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld | |
715 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o | |
63402fe4 | 716 | |
3151305a ILT |
717 | exception_test_SOURCES = \ |
718 | exception_test_main.cc \ | |
719 | exception_test_1.cc \ | |
720 | exception_test_2.cc \ | |
721 | exception_test.h | |
722 | exception_test_DEPENDENCIES = gcctestdir/ld | |
723 | exception_test_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 724 | exception_test_LDADD = |
3151305a | 725 | |
328c7c2f ILT |
726 | if HAVE_STATIC |
727 | check_PROGRAMS += exception_static_test | |
351a8000 ILT |
728 | exception_static_test_SOURCES = $(exception_test_SOURCES) |
729 | exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) | |
730 | exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static | |
1abce4a6 | 731 | exception_static_test_LDADD = $(exception_test_LDADD) |
328c7c2f | 732 | endif |
3151305a ILT |
733 | |
734 | exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc | |
735 | exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so | |
736 | exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
737 | exception_shared_1_test_LDADD = exception_shared_1.so | |
738 | ||
739 | exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc | |
740 | exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so | |
741 | exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
742 | exception_shared_2_test_LDADD = exception_shared_2.so | |
743 | ||
744 | exception_same_shared_test_SOURCES = exception_test_main.cc | |
745 | exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so | |
746 | exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
747 | exception_same_shared_test_LDADD = exception_shared.so | |
748 | ||
749 | exception_separate_shared_12_test_SOURCES = exception_test_main.cc | |
750 | exception_separate_shared_12_test_DEPENDENCIES = \ | |
751 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
59965708 CC |
752 | exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \ |
753 | -Wl,--no-as-needed | |
3151305a ILT |
754 | exception_separate_shared_12_test_LDADD = \ |
755 | exception_shared_1.so exception_shared_2.so | |
756 | ||
757 | exception_separate_shared_21_test_SOURCES = exception_test_main.cc | |
758 | exception_separate_shared_21_test_DEPENDENCIES = \ | |
759 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
59965708 CC |
760 | exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. \ |
761 | -Wl,--no-as-needed | |
3151305a ILT |
762 | exception_separate_shared_21_test_LDADD = \ |
763 | exception_shared_2.so exception_shared_1.so | |
764 | ||
3151305a | 765 | |
351a8000 | 766 | check_PROGRAMS += weak_test |
a360aedd | 767 | weak_test_SOURCES = weak_test.cc |
0e470e5c | 768 | weak_test_DEPENDENCIES = gcctestdir/ld |
a360aedd | 769 | weak_test_LDFLAGS = -Bgcctestdir/ |
1abce4a6 | 770 | weak_test_LDADD = |
a360aedd | 771 | |
86925eef | 772 | check_PROGRAMS += weak_undef_test |
72fef11a | 773 | MOSTLYCLEANFILES += alt/weak_undef_lib.so |
86925eef CC |
774 | weak_undef_test_SOURCES = weak_undef_test.cc |
775 | weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so | |
776 | weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
777 | weak_undef_test_LDADD = -L . weak_undef_lib.so | |
778 | weak_undef_file1.o: weak_undef_file1.cc | |
779 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
780 | weak_undef_file2.o: weak_undef_file2.cc | |
781 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
78d9f182 | 782 | weak_undef_lib.so: weak_undef_file1.o gcctestdir/ld |
86925eef | 783 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o |
78d9f182 | 784 | alt/weak_undef_lib.so: weak_undef_file2.o gcctestdir/ld |
86925eef CC |
785 | test -d alt || mkdir -p alt |
786 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o | |
351a8000 | 787 | |
1f25b93b CC |
788 | check_PROGRAMS += weak_undef_test_2 |
789 | weak_undef_test_2_SOURCES = weak_undef_test_2.cc | |
790 | weak_undef_test_2_DEPENDENCIES = gcctestdir/ld libweak_undef_2.a | |
791 | weak_undef_test_2_LDFLAGS = -Bgcctestdir/ -u weak_undef_2 | |
792 | weak_undef_test_2_LDADD = -L . -lweak_undef_2 | |
dddcc5b9 | 793 | MOSTLYCLEANFILES += libweak_undef_2.a |
1f25b93b CC |
794 | libweak_undef_2.a: weak_undef_file3.o weak_undef_file4.o |
795 | $(TEST_AR) rc $@ $^ | |
796 | weak_undef_file3.o: weak_undef_file3.cc | |
797 | $(CXXCOMPILE) -c -o $@ $< | |
798 | weak_undef_file4.o: weak_undef_file4.cc | |
799 | $(CXXCOMPILE) -c -o $@ $< | |
800 | ||
f3c69fca CC |
801 | if FN_PTRS_IN_SO_WITHOUT_PIC |
802 | check_PROGRAMS += weak_undef_nonpic_test | |
72fef11a | 803 | MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so |
f3c69fca CC |
804 | weak_undef_nonpic_test_SOURCES = weak_undef_test.cc |
805 | weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so | |
806 | weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
807 | weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so | |
808 | weak_undef_file1_nonpic.o: weak_undef_file1.cc | |
809 | $(CXXCOMPILE) -c -o $@ $< | |
810 | weak_undef_file2_nonpic.o: weak_undef_file2.cc | |
811 | $(CXXCOMPILE) -c -o $@ $< | |
812 | weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o | |
611062c0 | 813 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext |
f3c69fca CC |
814 | alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o |
815 | test -d alt || mkdir -p alt | |
611062c0 | 816 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext |
f3c69fca CC |
817 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
818 | ||
819 | ||
99a37bfd ILT |
820 | check_PROGRAMS += weak_alias_test |
821 | weak_alias_test_SOURCES = weak_alias_test_main.cc | |
822 | weak_alias_test_DEPENDENCIES = \ | |
823 | gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \ | |
21131061 | 824 | weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so |
99a37bfd ILT |
825 | weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
826 | weak_alias_test_LDADD = \ | |
827 | weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \ | |
21131061 | 828 | weak_alias_test_4.so weak_alias_test_5.so |
99a37bfd ILT |
829 | weak_alias_test_1_pic.o: weak_alias_test_1.cc |
830 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 831 | weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld |
99a37bfd ILT |
832 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o |
833 | weak_alias_test_2_pic.o: weak_alias_test_2.cc | |
834 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 835 | weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld |
99a37bfd ILT |
836 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o |
837 | weak_alias_test_3.o: weak_alias_test_3.cc | |
838 | $(CXXCOMPILE) -c -o $@ $< | |
839 | weak_alias_test_4_pic.o: weak_alias_test_4.cc | |
840 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 841 | weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld |
99a37bfd | 842 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o |
21131061 ILT |
843 | weak_alias_test_5_pic.o: weak_alias_test_5.cc |
844 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
845 | weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld | |
846 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \ | |
847 | -Wl,--version-script,$(srcdir)/weak_alias_test.script | |
99a37bfd | 848 | |
de4c45bd ILT |
849 | check_SCRIPTS += weak_plt.sh |
850 | check_PROGRAMS += weak_plt | |
851 | check_DATA += weak_plt_shared.so | |
852 | weak_plt_main_pic.o: weak_plt_main.cc | |
853 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
854 | weak_plt: weak_plt_main_pic.o gcctestdir/ld | |
855 | $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o | |
856 | weak_plt_shared_pic.o: weak_plt_shared.cc | |
857 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
858 | weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld | |
859 | $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o | |
860 | ||
f34787f8 ILT |
861 | check_PROGRAMS += copy_test |
862 | copy_test_SOURCES = copy_test.cc | |
863 | copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so | |
864 | copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
865 | copy_test_LDADD = copy_test_1.so copy_test_2.so | |
866 | copy_test_1_pic.o: copy_test_1.cc | |
867 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
868 | copy_test_1.so: gcctestdir/ld copy_test_1_pic.o | |
869 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o | |
870 | copy_test_2_pic.o: copy_test_2.cc | |
871 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
872 | copy_test_2.so: gcctestdir/ld copy_test_2_pic.o | |
873 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o | |
874 | ||
b733bcb7 CC |
875 | check_PROGRAMS += copy_test_relro |
876 | copy_test_relro_SOURCES = copy_test_relro.cc | |
877 | copy_test_relro_DEPENDENCIES = gcctestdir/ld copy_test_relro_1.so | |
878 | copy_test_relro_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-z,relro | |
879 | copy_test_relro_LDADD = copy_test_relro_1.so | |
880 | copy_test_relro_1_pic.o: copy_test_relro_1.cc | |
881 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
882 | copy_test_relro_1.so: gcctestdir/ld copy_test_relro_1_pic.o | |
883 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro copy_test_relro_1_pic.o | |
884 | ||
38ac44ac | 885 | if !DEFAULT_TARGET_POWERPC |
6eeb0170 CC |
886 | check_SCRIPTS += copy_test_protected.sh |
887 | check_DATA += copy_test_protected.err | |
888 | MOSTLYCLEANFILES += copy_test_protected.err | |
889 | copy_test_protected.err: copy_test_protected.o copy_test_2.so gcctestdir/ld | |
890 | @echo $(CXXLINK) -Bgcctestdir/ -o copy_test_protected copy_test_protected.o copy_test_2.so -Wl,-R,. "2>$@" | |
891 | @if $(CXXLINK) -Bgcctestdir/ -o copy_test_protected copy_test_protected.o copy_test_2.so -Wl,-R,. 2>$@; \ | |
892 | then \ | |
893 | echo 1>&2 "Link of copy_test_protected should have failed"; \ | |
894 | rm -f $@; \ | |
895 | exit 1; \ | |
896 | fi | |
38ac44ac | 897 | endif |
6eeb0170 | 898 | |
6eee141f ILT |
899 | if TLS |
900 | ||
351a8000 ILT |
901 | check_PROGRAMS += tls_test |
902 | check_PROGRAMS += tls_pic_test | |
c7177d31 | 903 | check_PROGRAMS += tls_pie_test |
b3705d2a | 904 | check_PROGRAMS += tls_pie_pic_test |
351a8000 | 905 | check_PROGRAMS += tls_shared_test |
c03c7692 | 906 | check_PROGRAMS += tls_shared_ie_test |
c2b45e22 | 907 | check_PROGRAMS += tls_shared_gd_to_ie_test |
351a8000 ILT |
908 | tls_test_pic.o: tls_test.cc |
909 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
910 | tls_test_file2_pic.o: tls_test_file2.cc | |
911 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
155a0dd7 ILT |
912 | tls_test_c_pic.o: tls_test_c.c |
913 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
914 | tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld | |
9c2d0ef9 | 915 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs |
c2b45e22 CC |
916 | tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld |
917 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o | |
351a8000 | 918 | |
c03c7692 ILT |
919 | tls_test_pic_ie.o: tls_test.cc |
920 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
921 | tls_test_file2_pic_ie.o: tls_test_file2.cc | |
922 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
155a0dd7 ILT |
923 | tls_test_c_pic_ie.o: tls_test_c.c |
924 | $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $< | |
925 | tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld | |
926 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o | |
c03c7692 | 927 | |
e0374858 | 928 | tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h |
155a0dd7 | 929 | tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o |
6eee141f | 930 | tls_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
931 | tls_test_LDADD = tls_test_c.o -lpthread |
932 | tls_test_c.o: tls_test_c.c | |
933 | $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $< | |
6eee141f ILT |
934 | |
935 | tls_pic_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
936 | tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \ |
937 | tls_test_c_pic.o | |
6eee141f | 938 | tls_pic_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
939 | tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \ |
940 | -lpthread | |
6eee141f | 941 | |
c7177d31 ILT |
942 | tls_test_main_pie.o: tls_test_main.cc tls_test.h |
943 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
944 | tls_test_pie.o: tls_test.cc tls_test.h | |
945 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
946 | tls_test_file2_pie.o: tls_test_file2.cc tls_test.h | |
947 | $(CXXCOMPILE) -c -fpie -o $@ $< | |
948 | tls_test_c_pie.o: tls_test_c.c | |
949 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
950 | tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \ | |
951 | tls_test_c_pie.o gcctestdir/ld | |
952 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread | |
953 | ||
a6a17750 CC |
954 | check_SCRIPTS += tls_pie_test.sh |
955 | check_DATA += tls_pie_test.stdout | |
956 | tls_pie_test.stdout: tls_pie_test | |
957 | $(TEST_READELF) -rW $< > $@ 2>/dev/null | |
958 | ||
b3705d2a ILT |
959 | tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \ |
960 | tls_test_c_pic.o gcctestdir/ld | |
961 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread | |
962 | ||
6eee141f ILT |
963 | tls_shared_test_SOURCES = tls_test_main.cc |
964 | tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so | |
965 | tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
966 | tls_shared_test_LDADD = tls_test_shared.so -lpthread | |
967 | ||
c03c7692 ILT |
968 | tls_shared_ie_test_SOURCES = tls_test_main.cc |
969 | tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so | |
970 | tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
971 | tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread | |
972 | ||
c2b45e22 | 973 | tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc |
155a0dd7 ILT |
974 | tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \ |
975 | tls_test_c_pic.o tls_test_shared2.so | |
c2b45e22 | 976 | tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
977 | tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \ |
978 | tls_test_shared2.so -lpthread | |
c2b45e22 CC |
979 | |
980 | if TLS_GNU2_DIALECT | |
981 | ||
982 | check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test | |
983 | ||
984 | tls_test_gnu2.o: tls_test.cc | |
985 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
986 | tls_test_file2_gnu2.o: tls_test_file2.cc | |
987 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
155a0dd7 ILT |
988 | tls_test_c_gnu2.o: tls_test_c.c |
989 | $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $< | |
c2b45e22 CC |
990 | tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld |
991 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o | |
992 | ||
993 | tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
994 | tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \ |
995 | tls_test_c_gnu2.o tls_test_gnu2_shared2.so | |
c2b45e22 | 996 | tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
997 | tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \ |
998 | tls_test_gnu2_shared2.so -lpthread | |
c2b45e22 CC |
999 | |
1000 | if TLS_DESCRIPTORS | |
1001 | ||
1002 | check_PROGRAMS += tls_shared_gnu2_test | |
1003 | ||
155a0dd7 ILT |
1004 | tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld |
1005 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o | |
c2b45e22 CC |
1006 | |
1007 | tls_shared_gnu2_test_SOURCES = tls_test_main.cc | |
1008 | tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so | |
1009 | tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1010 | tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread | |
1011 | ||
1012 | endif TLS_DESCRIPTORS | |
1013 | ||
1014 | endif TLS_GNU2_DIALECT | |
1015 | ||
328c7c2f | 1016 | if HAVE_STATIC |
351a8000 ILT |
1017 | if STATIC_TLS |
1018 | check_PROGRAMS += tls_static_test | |
1019 | check_PROGRAMS += tls_static_pic_test | |
1020 | ||
1021 | tls_static_test_SOURCES = $(tls_test_SOURCES) | |
1022 | tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) | |
1023 | tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static | |
1024 | tls_static_test_LDADD = $(tls_test_LDADD) | |
1025 | ||
1026 | tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES) | |
1027 | tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) | |
1028 | tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static | |
1029 | tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) | |
1030 | endif | |
328c7c2f | 1031 | endif |
6eee141f ILT |
1032 | |
1033 | if FN_PTRS_IN_SO_WITHOUT_PIC | |
351a8000 | 1034 | check_PROGRAMS += tls_shared_nonpic_test |
155a0dd7 | 1035 | tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld |
611062c0 | 1036 | $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext |
6eee141f ILT |
1037 | |
1038 | tls_shared_nonpic_test_SOURCES = tls_test_main.cc | |
1039 | tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so | |
1040 | tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1041 | tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread | |
351a8000 | 1042 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
6eee141f | 1043 | |
351a8000 | 1044 | endif TLS |
6eee141f | 1045 | |
1fa29f10 IT |
1046 | if DEFAULT_TARGET_X86_64 |
1047 | ||
1048 | check_SCRIPTS += x86_64_mov_to_lea.sh | |
1049 | check_DATA += x86_64_mov_to_lea1.stdout x86_64_mov_to_lea2.stdout \ | |
1050 | x86_64_mov_to_lea3.stdout x86_64_mov_to_lea4.stdout \ | |
1051 | x86_64_mov_to_lea5.stdout x86_64_mov_to_lea6.stdout \ | |
1052 | x86_64_mov_to_lea7.stdout x86_64_mov_to_lea8.stdout \ | |
1053 | x86_64_mov_to_lea9.stdout x86_64_mov_to_lea10.stdout \ | |
1054 | x86_64_mov_to_lea11.stdout x86_64_mov_to_lea12.stdout \ | |
1055 | x86_64_mov_to_lea13.stdout x86_64_mov_to_lea14.stdout | |
1056 | MOSTLYCLEANFILES += x86_64_mov_to_lea1 x86_64_mov_to_lea2 \ | |
1057 | x86_64_mov_to_lea3 x86_64_mov_to_lea4 x86_64_mov_to_lea5 \ | |
1058 | x86_64_mov_to_lea6 x86_64_mov_to_lea7 x86_64_mov_to_lea8 \ | |
1059 | x86_64_mov_to_lea9 x86_64_mov_to_lea10 x86_64_mov_to_lea11 \ | |
1060 | x86_64_mov_to_lea12 x86_64_mov_to_lea13 x86_64_mov_to_lea14 | |
1061 | ||
1062 | x86_64_mov_to_lea1.o: x86_64_mov_to_lea1.s | |
1063 | $(TEST_AS) --64 -o $@ $< | |
1064 | x86_64_mov_to_lea2.o: x86_64_mov_to_lea1.s | |
1065 | $(TEST_AS) --x32 -o $@ $< | |
1066 | x86_64_mov_to_lea3.o: x86_64_mov_to_lea2.s | |
1067 | $(TEST_AS) --x32 -o $@ $< | |
1068 | x86_64_mov_to_lea4.o: x86_64_mov_to_lea2.s | |
1069 | $(TEST_AS) --64 -o $@ $< | |
1070 | x86_64_mov_to_lea5.o: x86_64_mov_to_lea3.s | |
1cd17042 | 1071 | $(TEST_AS) --x32 -mrelax-relocations=yes -o $@ $< |
1fa29f10 | 1072 | x86_64_mov_to_lea6.o: x86_64_mov_to_lea3.s |
1cd17042 | 1073 | $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $< |
1fa29f10 IT |
1074 | x86_64_mov_to_lea7.o: x86_64_mov_to_lea4.s |
1075 | $(TEST_AS) --x32 -o $@ $< | |
1076 | x86_64_mov_to_lea8.o: x86_64_mov_to_lea4.s | |
1077 | $(TEST_AS) --64 -o $@ $< | |
78d9f182 | 1078 | x86_64_mov_to_lea1: x86_64_mov_to_lea1.o ../ld-new |
1fa29f10 | 1079 | ../ld-new -Bsymbolic -shared -melf_x86_64 -o $@ $< |
78d9f182 | 1080 | x86_64_mov_to_lea2: x86_64_mov_to_lea1.o ../ld-new |
1fa29f10 | 1081 | ../ld-new -pie -melf_x86_64 -o $@ $< |
78d9f182 | 1082 | x86_64_mov_to_lea3: x86_64_mov_to_lea1.o ../ld-new |
1fa29f10 | 1083 | ../ld-new -melf_x86_64 -o $@ $< |
78d9f182 | 1084 | x86_64_mov_to_lea4: x86_64_mov_to_lea2.o ../ld-new |
1fa29f10 | 1085 | ../ld-new -Bsymbolic -shared -melf32_x86_64 -o $@ $< |
78d9f182 | 1086 | x86_64_mov_to_lea5: x86_64_mov_to_lea2.o ../ld-new |
1fa29f10 | 1087 | ../ld-new -pie -melf32_x86_64 -o $@ $< |
78d9f182 | 1088 | x86_64_mov_to_lea6: x86_64_mov_to_lea2.o ../ld-new |
1fa29f10 | 1089 | ../ld-new -melf32_x86_64 -o $@ $< |
78d9f182 | 1090 | x86_64_mov_to_lea7: x86_64_mov_to_lea3.o ../ld-new |
1fa29f10 | 1091 | ../ld-new -melf32_x86_64 -pie -o $@ $< |
78d9f182 | 1092 | x86_64_mov_to_lea8: x86_64_mov_to_lea4.o ../ld-new |
1fa29f10 | 1093 | ../ld-new -melf_x86_64 -pie -o $@ $< |
78d9f182 | 1094 | x86_64_mov_to_lea9: x86_64_mov_to_lea5.o ../ld-new |
1fa29f10 | 1095 | ../ld-new -melf32_x86_64 -o $@ $< |
78d9f182 | 1096 | x86_64_mov_to_lea10: x86_64_mov_to_lea6.o ../ld-new |
1fa29f10 | 1097 | ../ld-new -melf_x86_64 -o $@ $< |
78d9f182 | 1098 | x86_64_mov_to_lea11: x86_64_mov_to_lea2.o ../ld-new |
1fa29f10 | 1099 | ../ld-new -melf32_x86_64 -shared -o $@ $< |
78d9f182 | 1100 | x86_64_mov_to_lea12: x86_64_mov_to_lea1.o ../ld-new |
1fa29f10 | 1101 | ../ld-new -melf_x86_64 -shared -o $@ $< |
78d9f182 | 1102 | x86_64_mov_to_lea13: x86_64_mov_to_lea7.o ../ld-new |
1fa29f10 | 1103 | ../ld-new -melf32_x86_64 -shared -o $@ $< |
78d9f182 | 1104 | x86_64_mov_to_lea14: x86_64_mov_to_lea8.o ../ld-new |
1fa29f10 IT |
1105 | ../ld-new -melf_x86_64 -shared -o $@ $< |
1106 | x86_64_mov_to_lea1.stdout: x86_64_mov_to_lea1 | |
1107 | $(TEST_OBJDUMP) -dw $< > $@ | |
1108 | x86_64_mov_to_lea2.stdout: x86_64_mov_to_lea2 | |
1109 | $(TEST_OBJDUMP) -dw $< > $@ | |
1110 | x86_64_mov_to_lea3.stdout: x86_64_mov_to_lea3 | |
1111 | $(TEST_OBJDUMP) -dw $< > $@ | |
1112 | x86_64_mov_to_lea4.stdout: x86_64_mov_to_lea4 | |
1113 | $(TEST_OBJDUMP) -dw $< > $@ | |
1114 | x86_64_mov_to_lea5.stdout: x86_64_mov_to_lea5 | |
1115 | $(TEST_OBJDUMP) -dw $< > $@ | |
1116 | x86_64_mov_to_lea6.stdout: x86_64_mov_to_lea6 | |
1117 | $(TEST_OBJDUMP) -dw $< > $@ | |
1118 | x86_64_mov_to_lea7.stdout: x86_64_mov_to_lea7 | |
1119 | $(TEST_OBJDUMP) -dw $< > $@ | |
1120 | x86_64_mov_to_lea8.stdout: x86_64_mov_to_lea8 | |
1121 | $(TEST_OBJDUMP) -dw $< > $@ | |
1122 | x86_64_mov_to_lea9.stdout: x86_64_mov_to_lea9 | |
1123 | $(TEST_OBJDUMP) -dw $< > $@ | |
1124 | x86_64_mov_to_lea10.stdout: x86_64_mov_to_lea10 | |
1125 | $(TEST_OBJDUMP) -dw $< > $@ | |
1126 | x86_64_mov_to_lea11.stdout: x86_64_mov_to_lea11 | |
1127 | $(TEST_OBJDUMP) -dw $< > $@ | |
1128 | x86_64_mov_to_lea12.stdout: x86_64_mov_to_lea12 | |
1129 | $(TEST_OBJDUMP) -dw $< > $@ | |
1130 | x86_64_mov_to_lea13.stdout: x86_64_mov_to_lea13 | |
1131 | $(TEST_OBJDUMP) -dw $< > $@ | |
1132 | x86_64_mov_to_lea14.stdout: x86_64_mov_to_lea14 | |
1133 | $(TEST_OBJDUMP) -dw $< > $@ | |
1134 | ||
3a4f096e ST |
1135 | check_SCRIPTS += x86_64_indirect_call_to_direct.sh |
1136 | check_DATA += x86_64_indirect_call_to_direct1.stdout \ | |
1137 | x86_64_indirect_jump_to_direct1.stdout | |
1138 | MOSTLYCLEANFILES += x86_64_indirect_call_to_direct1 \ | |
1139 | x86_64_indirect_jump_to_direct1 | |
1140 | ||
1141 | x86_64_indirect_call_to_direct1.o: x86_64_indirect_call_to_direct1.s | |
1142 | $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $< | |
1143 | x86_64_indirect_call_to_direct1: x86_64_indirect_call_to_direct1.o gcctestdir/ld | |
1144 | gcctestdir/ld -o $@ $< | |
1145 | x86_64_indirect_call_to_direct1.stdout: x86_64_indirect_call_to_direct1 | |
1146 | $(TEST_OBJDUMP) -dw $< > $@ | |
1147 | x86_64_indirect_jump_to_direct1.o: x86_64_indirect_jump_to_direct1.s | |
1148 | $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $< | |
1149 | x86_64_indirect_jump_to_direct1: x86_64_indirect_jump_to_direct1.o gcctestdir/ld | |
1150 | gcctestdir/ld -o $@ $< | |
1151 | x86_64_indirect_jump_to_direct1.stdout: x86_64_indirect_jump_to_direct1 | |
1152 | $(TEST_OBJDUMP) -dw $< > $@ | |
1153 | ||
c34c98ed CC |
1154 | check_SCRIPTS += x86_64_overflow_pc32.sh |
1155 | check_DATA += x86_64_overflow_pc32.err | |
1156 | MOSTLYCLEANFILES += x86_64_overflow_pc32.err | |
1157 | x86_64_overflow_pc32.o: x86_64_overflow_pc32.s | |
1158 | $(TEST_AS) -o $@ $< | |
1159 | x86_64_overflow_pc32.err: x86_64_overflow_pc32.o gcctestdir/ld | |
19ef3f4d CC |
1160 | @echo gcctestdir/ld -e bar -Tdata=0x81000000 -o x86_64_overflow_pc32 x86_64_overflow_pc32.o "2>$@" |
1161 | @if gcctestdir/ld -e bar -Tdata=0x81000000 -o x86_64_overflow_pc32 x86_64_overflow_pc32.o 2>$@; \ | |
c34c98ed CC |
1162 | then \ |
1163 | echo 1>&2 "Link of x86_64_overflow_pc32 should have failed"; \ | |
1164 | rm -f $@; \ | |
1165 | exit 1; \ | |
1166 | fi | |
1167 | ||
ac423761 GN |
1168 | check_PROGRAMS += pr17704a_test |
1169 | pr17704a_test.o: pr17704a_test.s | |
1170 | $(TEST_AS) --64 -o $@ $< | |
1171 | pr17704a_test: pr17704a_test.o gcctestdir/ld | |
1172 | gcctestdir/ld --icf=all -o $@ $< | |
1173 | ||
19ef3f4d CC |
1174 | check_SCRIPTS += x32_overflow_pc32.sh |
1175 | check_DATA += x32_overflow_pc32.err | |
1176 | MOSTLYCLEANFILES += x32_overflow_pc32.err | |
19ef3f4d CC |
1177 | x32_overflow_pc32.o: x86_64_overflow_pc32.s |
1178 | $(TEST_AS) --x32 -o $@ $< | |
1179 | x32_overflow_pc32.err: x32_overflow_pc32.o gcctestdir/ld | |
1180 | @echo gcctestdir/ld -e bar -Tdata=0x81000000 -o x32_overflow_pc32 x32_overflow_pc32.o "2>$@" | |
1181 | @if gcctestdir/ld -e bar -Tdata=0x81000000 -o x32_overflow_pc32 x32_overflow_pc32.o 2>$@; \ | |
1182 | then \ | |
1183 | echo 1>&2 "Link of x32_overflow_pc32 should have failed"; \ | |
1184 | rm -f $@; \ | |
1185 | exit 1; \ | |
1186 | fi | |
1187 | ||
1fa29f10 IT |
1188 | endif DEFAULT_TARGET_X86_64 |
1189 | ||
ad961eab L |
1190 | if DEFAULT_TARGET_X86_64_OR_X32 |
1191 | ||
1192 | check_PROGRAMS += pr20216a_test | |
1193 | pr20216a_test_SOURCES = pr20216_main.c pr20216_def.c | |
1194 | pr20216a_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as | |
1195 | pr20216a_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1196 | pr20216a_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1197 | pr20216a_test_LDADD = pr20216_gd.o pr20216_ld.o | |
1198 | ||
1199 | check_PROGRAMS += pr20216b_test | |
1200 | pr20216b_test_SOURCES = pr20216_main.c pr20216_def.c | |
1201 | pr20216b_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as | |
1202 | pr20216b_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1203 | pr20216b_test_LDFLAGS = -pie -Bgcctestdir/ -Wl,-R,. | |
1204 | pr20216b_test_LDADD = pr20216_gd.o pr20216_ld.o | |
1205 | ||
1206 | check_PROGRAMS += pr20216c_test | |
1207 | pr20216c_test_SOURCES = pr20216_main.c pr20216_def.c | |
1208 | pr20216c_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as | |
1209 | pr20216c_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1210 | pr20216c_test_LDFLAGS = -static -Bgcctestdir/ -Wl,-R,. | |
1211 | pr20216c_test_LDADD = pr20216_gd.o pr20216_ld.o | |
1212 | ||
1213 | check_PROGRAMS += pr20216d_test | |
1214 | pr20216d_test_SOURCES = pr20216_main.c pr20216_def.c | |
1215 | pr20216d_test_DEPENDENCIES = pr20216a.so gcctestdir/ld gcctestdir/as | |
1216 | pr20216d_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1217 | pr20216d_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1218 | pr20216d_test_LDADD = pr20216a.so | |
1219 | ||
1220 | check_PROGRAMS += pr20216e_test | |
1221 | pr20216e_test_SOURCES = pr20216_main.c | |
1222 | pr20216e_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o pr20216b.so gcctestdir/ld gcctestdir/as | |
1223 | pr20216e_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1224 | pr20216e_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1225 | pr20216e_test_LDADD = pr20216_gd.o pr20216_ld.o pr20216b.so | |
1226 | ||
1227 | MOSTLYCLEANFILES += pr20216a.so pr20216b.so | |
1228 | ||
1229 | pr20216a.so: pr20216_gd.o pr20216_ld.o gcctestdir/ld | |
1230 | $(LINK) -Bgcctestdir/ -shared pr20216_gd.o pr20216_ld.o | |
1231 | ||
1232 | pr20216b.so: pr20216_def.o gcctestdir/ld | |
1233 | $(LINK) -Bgcctestdir/ -shared pr20216_def.o | |
1234 | ||
a4aa1f5f | 1235 | pr20216_gd.o: pr20216_gd.S gcctestdir/as |
f5713901 | 1236 | $(COMPILE) -Bgcctestdir/ -c -o $@ $< |
ad961eab | 1237 | |
a4aa1f5f | 1238 | pr20216_ld.o: pr20216_ld.S gcctestdir/as |
f5713901 | 1239 | $(COMPILE) -Bgcctestdir/ -c -o $@ $< |
ad961eab L |
1240 | |
1241 | endif DEFAULT_TARGET_X86_64_OR_X32 | |
1242 | ||
c4fc4724 IT |
1243 | if DEFAULT_TARGET_I386 |
1244 | ||
1245 | check_SCRIPTS += i386_mov_to_lea.sh | |
1246 | check_DATA += i386_mov_to_lea1.stdout i386_mov_to_lea2.stdout \ | |
1247 | i386_mov_to_lea3.stdout i386_mov_to_lea4.stdout \ | |
1248 | i386_mov_to_lea5.stdout i386_mov_to_lea6.stdout \ | |
1249 | i386_mov_to_lea7.stdout i386_mov_to_lea8.stdout | |
1250 | MOSTLYCLEANFILES += i386_mov_to_lea1 i386_mov_to_lea2 i386_mov_to_lea3 \ | |
1251 | i386_mov_to_lea4 i386_mov_to_lea5 i386_mov_to_lea6 \ | |
1252 | i386_mov_to_lea7 i386_mov_to_lea8 | |
1253 | ||
1254 | i386_mov_to_lea1.o: i386_mov_to_lea1.s | |
1255 | $(TEST_AS) --32 -o $@ $< | |
1256 | i386_mov_to_lea2.o: i386_mov_to_lea2.s | |
1257 | $(TEST_AS) --32 -o $@ $< | |
1258 | i386_mov_to_lea3.o: i386_mov_to_lea3.s | |
1259 | $(TEST_AS) --32 -o $@ $< | |
1260 | i386_mov_to_lea4.o: i386_mov_to_lea4.s | |
1261 | $(TEST_AS) --32 -o $@ $< | |
1262 | i386_mov_to_lea5.o: i386_mov_to_lea5.s | |
1263 | $(TEST_AS) --32 -o $@ $< | |
78d9f182 | 1264 | i386_mov_to_lea1: i386_mov_to_lea1.o ../ld-new |
c4fc4724 | 1265 | ../ld-new -Bsymbolic -shared -melf_i386 -o $@ $< |
78d9f182 | 1266 | i386_mov_to_lea2: i386_mov_to_lea1.o ../ld-new |
c4fc4724 | 1267 | ../ld-new -pie -melf_i386 -o $@ $< |
78d9f182 | 1268 | i386_mov_to_lea3: i386_mov_to_lea1.o ../ld-new |
c4fc4724 | 1269 | ../ld-new -melf_i386 -o $@ $< |
78d9f182 | 1270 | i386_mov_to_lea4: i386_mov_to_lea1.o ../ld-new |
c4fc4724 | 1271 | ../ld-new -melf_i386 -shared -o $@ $< |
78d9f182 | 1272 | i386_mov_to_lea5: i386_mov_to_lea2.o ../ld-new |
c4fc4724 | 1273 | ../ld-new -melf_i386 -shared -o $@ $< |
78d9f182 | 1274 | i386_mov_to_lea6: i386_mov_to_lea3.o ../ld-new |
c4fc4724 | 1275 | ../ld-new -melf_i386 -shared -o $@ $< |
78d9f182 | 1276 | i386_mov_to_lea7: i386_mov_to_lea4.o ../ld-new |
c4fc4724 | 1277 | ../ld-new -melf_i386 -shared -o $@ $< |
78d9f182 | 1278 | i386_mov_to_lea8: i386_mov_to_lea5.o ../ld-new |
c4fc4724 IT |
1279 | ../ld-new -melf_i386 -shared -o $@ $< |
1280 | i386_mov_to_lea1.stdout: i386_mov_to_lea1 | |
1281 | $(TEST_OBJDUMP) -dw $< > $@ | |
1282 | i386_mov_to_lea2.stdout: i386_mov_to_lea2 | |
1283 | $(TEST_OBJDUMP) -dw $< > $@ | |
1284 | i386_mov_to_lea3.stdout: i386_mov_to_lea3 | |
1285 | $(TEST_OBJDUMP) -dw $< > $@ | |
1286 | i386_mov_to_lea4.stdout: i386_mov_to_lea4 | |
1287 | $(TEST_OBJDUMP) -dw $< > $@ | |
1288 | i386_mov_to_lea5.stdout: i386_mov_to_lea5 | |
1289 | $(TEST_OBJDUMP) -dw $< > $@ | |
1290 | i386_mov_to_lea6.stdout: i386_mov_to_lea6 | |
1291 | $(TEST_OBJDUMP) -dw $< > $@ | |
1292 | i386_mov_to_lea7.stdout: i386_mov_to_lea7 | |
1293 | $(TEST_OBJDUMP) -dw $< > $@ | |
1294 | i386_mov_to_lea8.stdout: i386_mov_to_lea8 | |
1295 | $(TEST_OBJDUMP) -dw $< > $@ | |
1296 | ||
b287eca3 L |
1297 | check_PROGRAMS += pr20308a_test |
1298 | pr20308a_test_SOURCES = pr20308_main.c pr20308_def.c | |
1299 | pr20308a_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as | |
1300 | pr20308a_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1301 | pr20308a_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1302 | pr20308a_test_LDADD = pr20308_gd.o pr20308_ld.o | |
1303 | ||
1304 | check_PROGRAMS += pr20308b_test | |
1305 | pr20308b_test_SOURCES = pr20308_main.c pr20308_def.c | |
1306 | pr20308b_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as | |
1307 | pr20308b_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1308 | pr20308b_test_LDFLAGS = -pie -Bgcctestdir/ -Wl,-R,. | |
1309 | pr20308b_test_LDADD = pr20308_gd.o pr20308_ld.o | |
1310 | ||
1311 | check_PROGRAMS += pr20308c_test | |
1312 | pr20308c_test_SOURCES = pr20308_main.c pr20308_def.c | |
1313 | pr20308c_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as | |
1314 | pr20308c_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1315 | pr20308c_test_LDFLAGS = -static -Bgcctestdir/ -Wl,-R,. | |
1316 | pr20308c_test_LDADD = pr20308_gd.o pr20308_ld.o | |
1317 | ||
1318 | check_PROGRAMS += pr20308d_test | |
1319 | pr20308d_test_SOURCES = pr20308_main.c pr20308_def.c | |
1320 | pr20308d_test_DEPENDENCIES = pr20308a.so gcctestdir/ld gcctestdir/as | |
1321 | pr20308d_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1322 | pr20308d_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1323 | pr20308d_test_LDADD = pr20308a.so | |
1324 | ||
1325 | check_PROGRAMS += pr20308e_test | |
1326 | pr20308e_test_SOURCES = pr20308_main.c | |
1327 | pr20308e_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o pr20308b.so gcctestdir/ld gcctestdir/as | |
1328 | pr20308e_test_CFLAGS = -Bgcctestdir/ -fPIE | |
1329 | pr20308e_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1330 | pr20308e_test_LDADD = pr20308_gd.o pr20308_ld.o pr20308b.so | |
1331 | ||
1332 | MOSTLYCLEANFILES += pr20308a.so pr20308b.so | |
1333 | ||
1334 | pr20308a.so: pr20308_gd.o pr20308_ld.o gcctestdir/ld | |
1335 | $(LINK) -Bgcctestdir/ -shared pr20308_gd.o pr20308_ld.o | |
1336 | ||
1337 | pr20308b.so: pr20308_def.o gcctestdir/ld | |
1338 | $(LINK) -Bgcctestdir/ -shared pr20308_def.o | |
1339 | ||
a4aa1f5f CC |
1340 | pr20308_gd.o: pr20308_gd.S gcctestdir/as |
1341 | $(COMPILE) -Bgcctestdir/ -c -o $@ $< | |
b287eca3 | 1342 | |
a4aa1f5f CC |
1343 | pr20308_ld.o: pr20308_ld.S gcctestdir/as |
1344 | $(COMPILE) -Bgcctestdir/ -c -o $@ $< | |
b287eca3 | 1345 | |
c4fc4724 IT |
1346 | endif DEFAULT_TARGET_I386 |
1347 | ||
d491d34e ILT |
1348 | check_PROGRAMS += many_sections_test |
1349 | many_sections_test_SOURCES = many_sections_test.cc | |
1350 | many_sections_test_DEPENDENCIES = gcctestdir/ld | |
1351 | many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic | |
1abce4a6 | 1352 | many_sections_test_LDADD = |
d491d34e ILT |
1353 | |
1354 | BUILT_SOURCES += many_sections_define.h | |
72fef11a | 1355 | MOSTLYCLEANFILES += many_sections_define.h |
d491d34e ILT |
1356 | many_sections_define.h: |
1357 | (for i in `seq 1 70000`; do \ | |
1358 | echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \ | |
1359 | done) > $@.tmp | |
1360 | mv -f $@.tmp $@ | |
1361 | ||
1362 | BUILT_SOURCES += many_sections_check.h | |
72fef11a | 1363 | MOSTLYCLEANFILES += many_sections_check.h |
d491d34e | 1364 | many_sections_check.h: |
4c94d6ae | 1365 | (for i in `seq 1 1000 70000`; do \ |
d491d34e ILT |
1366 | echo "assert(var_$$i == $$i);"; \ |
1367 | done) > $@.tmp | |
1368 | mv -f $@.tmp $@ | |
1369 | ||
1370 | check_PROGRAMS += many_sections_r_test | |
d491d34e ILT |
1371 | many_sections_r_test.o: many_sections_test.o gcctestdir/ld |
1372 | gcctestdir/ld -r -o $@ many_sections_test.o | |
7bc3e21a ILT |
1373 | many_sections_r_test: many_sections_r_test.o gcctestdir/ld |
1374 | $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS) | |
6eee141f | 1375 | |
82d93790 CC |
1376 | check_SCRIPTS += file_in_many_sections_test.sh |
1377 | check_DATA += file_in_many_sections.stdout | |
1378 | MOSTLYCLEANFILES += file_in_many_sections | |
1379 | file_in_many_sections.o: file_in_many_sections.c many_sections_define.h | |
1380 | $(COMPILE) -c -fdata-sections -o $@ $(srcdir)/file_in_many_sections.c | |
1381 | file_in_many_sections: file_in_many_sections.o gcctestdir/ld | |
1382 | $(LINK) -Bgcctestdir/ file_in_many_sections.o -Wl,--gc-sections | |
1383 | file_in_many_sections.stdout: file_in_many_sections | |
1384 | $(TEST_READELF) -s $< > $@ | |
1385 | ||
2fd32231 ILT |
1386 | check_PROGRAMS += initpri1 |
1387 | initpri1_SOURCES = initpri1.c | |
1388 | initpri1_DEPENDENCIES = gcctestdir/ld | |
1389 | initpri1_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 1390 | initpri1_LDADD = |
2fd32231 | 1391 | |
5393d741 ILT |
1392 | check_PROGRAMS += initpri2 |
1393 | initpri2_SOURCES = initpri2.c | |
1394 | initpri2_DEPENDENCIES = gcctestdir/ld | |
7b5de7ee | 1395 | initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array |
5393d741 | 1396 | initpri2_LDADD = |
2fd32231 | 1397 | |
487b39df ILT |
1398 | check_PROGRAMS += initpri3a |
1399 | initpri3a_SOURCES = initpri3.c | |
1400 | initpri3a_DEPENDENCIES = gcctestdir/ld | |
1401 | initpri3a_LDFLAGS = -Bgcctestdir/ | |
1402 | initpri3a_LDADD = | |
1403 | ||
7c6109da DK |
1404 | # This test fails on targets not using .ctors and .dtors sections (e.g. ARM |
1405 | # EABI). Given that gcc is moving towards using .init_array in all cases, | |
1406 | # this test is commented out. A better fix would be checking whether gcc | |
1407 | # uses .ctors or .init_array sections in configure. | |
1408 | ||
1409 | # check_PROGRAMS += initpri3b | |
1410 | # initpri3b_SOURCES = initpri3.c | |
1411 | # initpri3b_DEPENDENCIES = gcctestdir/ld | |
1412 | # initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array | |
1413 | # initpri3b_LDADD = | |
487b39df | 1414 | |
351a8000 ILT |
1415 | # Test --detect-odr-violations |
1416 | check_SCRIPTS += debug_msg.sh | |
6eee141f | 1417 | |
351a8000 ILT |
1418 | # Create the data files that debug_msg.sh analyzes. |
1419 | check_DATA += debug_msg.err | |
1420 | MOSTLYCLEANFILES += debug_msg.err | |
1421 | debug_msg.o: debug_msg.cc | |
1422 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc | |
1423 | odr_violation1.o: odr_violation1.cc | |
1424 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc | |
71ff8986 ILT |
1425 | # Compile with different optimization flags to check that rearranged |
1426 | # instructions don't cause a false positive. | |
351a8000 | 1427 | odr_violation2.o: odr_violation2.cc |
71ff8986 | 1428 | $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 ILT |
1429 | debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld |
1430 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" | |
1431 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ | |
1432 | then \ | |
1433 | echo 1>&2 "Link of debug_msg should have failed"; \ | |
1434 | rm -f $@; \ | |
1435 | exit 1; \ | |
1436 | fi | |
1437 | ||
93acabad CC |
1438 | # Test error message when a vtable is undefined. |
1439 | check_SCRIPTS += missing_key_func.sh | |
1440 | check_DATA += missing_key_func.err | |
1441 | MOSTLYCLEANFILES += missing_key_func.err | |
1442 | missing_key_func.o: missing_key_func.cc | |
1443 | $(CXXCOMPILE) -O0 -g -c -o $@ $(srcdir)/missing_key_func.cc | |
1444 | missing_key_func.err: missing_key_func.o gcctestdir/ld | |
1445 | @echo $(CXXLINK) -Bgcctestdir/ -o missing_key_func missing_key_func.o "2>$@" | |
1446 | @if $(CXXLINK) -Bgcctestdir/ -o missing_key_func missing_key_func.o 2>$@; \ | |
1447 | then \ | |
1448 | echo 1>&2 "Link of missing_key_func should have failed"; \ | |
1449 | rm -f $@; \ | |
1450 | exit 1; \ | |
1451 | fi | |
472076e4 | 1452 | |
472076e4 CC |
1453 | # Check that --detect-odr-violations works with compressed debug sections. |
1454 | check_DATA += debug_msg_cdebug.err | |
1455 | MOSTLYCLEANFILES += debug_msg_cdebug.err | |
1456 | debug_msg_cdebug.o: debug_msg.cc gcctestdir/as | |
1457 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc | |
1458 | odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as | |
1459 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc | |
1460 | odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as | |
1461 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc | |
1462 | debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld | |
1463 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@" | |
1464 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \ | |
1465 | then \ | |
1466 | echo 1>&2 "Link of debug_msg_cdebug should have failed"; \ | |
1467 | rm -f $@; \ | |
1468 | exit 1; \ | |
1469 | fi | |
48058663 L |
1470 | check_DATA += debug_msg_cdebug_gabi.err |
1471 | MOSTLYCLEANFILES += debug_msg_cdebug_gabi.err | |
1472 | debug_msg_cdebug_gabi.o: debug_msg.cc gcctestdir/as | |
1473 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/debug_msg.cc | |
1474 | odr_violation1_cdebug_gabi.o: odr_violation1.cc gcctestdir/as | |
1475 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/odr_violation1.cc | |
1476 | odr_violation2_cdebug_gabi.o: odr_violation2.cc gcctestdir/as | |
1477 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/odr_violation2.cc | |
1478 | debug_msg_cdebug_gabi.err: debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o gcctestdir/ld | |
1479 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o "2>$@" | |
1480 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug_gabi debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o 2>$@; \ | |
1481 | then \ | |
1482 | echo 1>&2 "Link of debug_msg_cdebug_gabi should have failed"; \ | |
1483 | rm -f $@; \ | |
1484 | exit 1; \ | |
1485 | fi | |
472076e4 | 1486 | |
351a8000 ILT |
1487 | # See if we can also detect problems when we're linking .so's, not .o's. |
1488 | check_DATA += debug_msg_so.err | |
1489 | MOSTLYCLEANFILES += debug_msg_so.err | |
1490 | debug_msg.so: debug_msg.cc gcctestdir/ld | |
1491 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
1492 | odr_violation1.so: odr_violation1.cc gcctestdir/ld | |
1493 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
1494 | odr_violation2.so: odr_violation2.cc gcctestdir/ld | |
71ff8986 | 1495 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 | 1496 | debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld |
3d587466 CC |
1497 | @echo $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" |
1498 | @if $(CXXLINK_S) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ | |
351a8000 ILT |
1499 | then \ |
1500 | echo 1>&2 "Link of debug_msg_so should have failed"; \ | |
1501 | rm -f $@; \ | |
1502 | exit 1; \ | |
1503 | fi | |
1504 | ||
1505 | # We also want to make sure we do something reasonable when there's no | |
1506 | # debug info available. For the best test, we use .so's. | |
1507 | check_DATA += debug_msg_ndebug.err | |
1508 | MOSTLYCLEANFILES += debug_msg_ndebug.err | |
1509 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld | |
1510 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
1511 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld | |
1512 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
1513 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld | |
71ff8986 | 1514 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
351a8000 | 1515 | debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld |
3d587466 CC |
1516 | @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>$@" |
1517 | @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 |
1518 | then \ |
1519 | echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ | |
1520 | rm -f $@; \ | |
1521 | exit 1; \ | |
1522 | fi | |
1523 | ||
1524 | ||
1525 | # Similar to --detect-odr-violations: check for undefined symbols in .so's | |
1526 | check_SCRIPTS += undef_symbol.sh | |
1527 | check_DATA += undef_symbol.err | |
1528 | MOSTLYCLEANFILES += undef_symbol.err | |
1529 | undef_symbol.o: undef_symbol.cc | |
1530 | $(CXXCOMPILE) -O0 -g -c -fPIC $< | |
1531 | undef_symbol.so: undef_symbol.o gcctestdir/ld | |
1532 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o | |
1533 | undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld | |
1534 | @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@" | |
1535 | @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \ | |
1536 | then \ | |
1537 | echo 1>&2 "Link of undef_symbol_test should have failed"; \ | |
1538 | rm -f $@; \ | |
1539 | exit 1; \ | |
1540 | fi | |
1541 | ||
1542 | ||
351a8000 ILT |
1543 | # Test -o when emitting to a special file (such as something in /dev). |
1544 | check_PROGRAMS += flagstest_o_specialfile | |
0e470e5c | 1545 | flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld |
351a8000 ILT |
1546 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@ |
1547 | chmod a+x $@ | |
1548 | test -s $@ | |
1549 | ||
fb8b9dbc L |
1550 | # Test --compress-debug-sections. |
1551 | check_PROGRAMS += flagstest_compress_debug_sections_none | |
1552 | check_DATA += flagstest_compress_debug_sections_none.stdout | |
1553 | flagstest_compress_debug_sections_none: flagstest_debug.o gcctestdir/ld | |
1554 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=none | |
1555 | test -s $@ | |
1556 | ||
1557 | # Dump DWARF debug sections. | |
1558 | flagstest_compress_debug_sections_none.stdout: flagstest_compress_debug_sections_none | |
1559 | $(TEST_READELF) -w $< > $@.tmp | |
1560 | mv -f $@.tmp $@ | |
1561 | ||
7fcd0256 | 1562 | check_PROGRAMS += flagstest_compress_debug_sections |
fb8b9dbc L |
1563 | check_DATA += flagstest_compress_debug_sections.stdout \ |
1564 | flagstest_compress_debug_sections.cmp \ | |
1565 | flagstest_compress_debug_sections.check | |
0863441e CC |
1566 | MOSTLYCLEANFILES += flagstest_compress_debug_sections.check \ |
1567 | flagstest_compress_debug_sections.cmp | |
7fcd0256 ILT |
1568 | flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld |
1569 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib | |
1570 | test -s $@ | |
1571 | ||
9c7fe3c5 CC |
1572 | # Test --compress-debug-sections with --build-id=tree. |
1573 | check_PROGRAMS += flagstest_compress_debug_sections_and_build_id_tree | |
1574 | flagstest_compress_debug_sections_and_build_id_tree: flagstest_debug.o gcctestdir/ld | |
1575 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib \ | |
1576 | -Wl,--build-id=tree \ | |
1577 | -Wl,--build-id-chunk-size-for-treehash=4096 \ | |
1578 | -Wl,--build-id-min-file-size-for-treehash=0 | |
1579 | test -s $@ | |
7fcd0256 | 1580 | |
fb8b9dbc L |
1581 | # Dump compressed DWARF debug sections. |
1582 | flagstest_compress_debug_sections.stdout: flagstest_compress_debug_sections | |
1583 | $(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp | |
1584 | mv -f $@.tmp $@ | |
1585 | ||
19a7fe52 | 1586 | # Check there are compressed DWARF .debug_* sections. |
fb8b9dbc | 1587 | flagstest_compress_debug_sections.check: flagstest_compress_debug_sections |
19a7fe52 | 1588 | $(TEST_READELF) -SW $< | egrep ".debug_.* C *" > $@.tmp |
fb8b9dbc L |
1589 | mv -f $@.tmp $@ |
1590 | ||
1591 | # Compare DWARF debug info. | |
1592 | flagstest_compress_debug_sections.cmp: flagstest_compress_debug_sections.stdout \ | |
1593 | flagstest_compress_debug_sections_none.stdout | |
1594 | cmp flagstest_compress_debug_sections.stdout \ | |
1595 | flagstest_compress_debug_sections_none.stdout > $@.tmp | |
1596 | mv -f $@.tmp $@ | |
1597 | ||
1598 | check_PROGRAMS += flagstest_compress_debug_sections_gnu | |
1599 | check_DATA += flagstest_compress_debug_sections_gnu.stdout \ | |
1600 | flagstest_compress_debug_sections_gnu.cmp \ | |
1601 | flagstest_compress_debug_sections_gnu.check | |
0863441e CC |
1602 | MOSTLYCLEANFILES += flagstest_compress_debug_sections_gnu.check \ |
1603 | flagstest_compress_debug_sections_gnu.cmp | |
fb8b9dbc L |
1604 | flagstest_compress_debug_sections_gnu: flagstest_debug.o gcctestdir/ld |
1605 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gnu | |
1606 | test -s $@ | |
1607 | ||
1608 | # Dump compressed DWARF debug sections. | |
1609 | flagstest_compress_debug_sections_gnu.stdout: flagstest_compress_debug_sections_gnu | |
1610 | $(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp | |
1611 | mv -f $@.tmp $@ | |
1612 | ||
1613 | # Check there are compressed DWARF .zdebug_* sections. | |
1614 | flagstest_compress_debug_sections_gnu.check: flagstest_compress_debug_sections_gnu | |
1615 | $(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp | |
1616 | mv -f $@.tmp $@ | |
1617 | ||
1618 | # Compare DWARF debug info. | |
1619 | flagstest_compress_debug_sections_gnu.cmp: flagstest_compress_debug_sections_gnu.stdout \ | |
1620 | flagstest_compress_debug_sections_none.stdout | |
1621 | cmp flagstest_compress_debug_sections_gnu.stdout \ | |
1622 | flagstest_compress_debug_sections_none.stdout > $@.tmp | |
1623 | mv -f $@.tmp $@ | |
1624 | ||
1625 | check_PROGRAMS += flagstest_compress_debug_sections_gabi | |
1626 | check_DATA += flagstest_compress_debug_sections_gabi.stdout \ | |
1627 | flagstest_compress_debug_sections_gabi.cmp \ | |
1628 | flagstest_compress_debug_sections_gabi.check | |
0863441e CC |
1629 | MOSTLYCLEANFILES += flagstest_compress_debug_sections_gabi.cmp \ |
1630 | flagstest_compress_debug_sections_gabi.check | |
fb8b9dbc L |
1631 | flagstest_compress_debug_sections_gabi: flagstest_debug.o gcctestdir/ld |
1632 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gabi | |
1633 | test -s $@ | |
1634 | ||
1635 | # Dump compressed DWARF debug sections. | |
1636 | flagstest_compress_debug_sections_gabi.stdout: flagstest_compress_debug_sections_gabi | |
1637 | $(TEST_READELF) -w $< > $@.tmp | |
1638 | mv -f $@.tmp $@ | |
1639 | ||
1640 | # Check there are compressed DWARF .debug_* sections. | |
1641 | flagstest_compress_debug_sections_gabi.check: flagstest_compress_debug_sections_gabi | |
1642 | $(TEST_READELF) -tW $< | grep "COMPRESSED" > $@.tmp | |
1643 | mv -f $@.tmp $@ | |
1644 | ||
1645 | # Compare DWARF debug info. | |
1646 | flagstest_compress_debug_sections_gabi.cmp: flagstest_compress_debug_sections_gabi.stdout \ | |
1647 | flagstest_compress_debug_sections_none.stdout | |
1648 | cmp flagstest_compress_debug_sections_gabi.stdout \ | |
1649 | flagstest_compress_debug_sections_none.stdout > $@.tmp | |
1650 | mv -f $@.tmp $@ | |
1651 | ||
351a8000 ILT |
1652 | # The specialfile output has a tricky case when we also compress debug |
1653 | # sections, because it requires output-file resizing. | |
1654 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections | |
0e470e5c ILT |
1655 | flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \ |
1656 | gcctestdir/ld | |
126f3ece | 1657 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@ |
351a8000 ILT |
1658 | chmod a+x $@ |
1659 | test -s $@ | |
1660 | ||
f54f5e31 L |
1661 | check_SCRIPTS += pr18689.sh |
1662 | check_DATA += pr18689.stdout | |
1663 | MOSTLYCLEANFILES += pr18689a.o pr18689b.o | |
1664 | ||
1665 | pr18689.stdout: pr18689b.o | |
1666 | $(TEST_READELF) -SW $< > $@ | |
1667 | ||
1668 | pr18689a.o: pr18689.o ../ld-new | |
1669 | ../ld-new -r -o $@ $< | |
1670 | ||
1671 | pr18689b.o: pr18689a.o ../ld-new | |
1672 | ../ld-new -r -o $@ $< | |
1673 | ||
1674 | pr18689.o: pr18689.c gcctestdir/as | |
1675 | $(COMPILE) -Bgcctestdir/ -ggdb3 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/pr18689.c | |
1676 | ||
d12a5ea8 ILT |
1677 | # Test -TText and -Tdata. |
1678 | check_PROGRAMS += flagstest_o_ttext_1 | |
1679 | flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld | |
1680 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000 | |
1681 | ||
1682 | # This version won't be runnable, because there is no way to put the | |
1683 | # PT_PHDR segment at file offset 0. We just make sure that we can | |
1684 | # build it without error. | |
1685 | check_DATA += flagstest_o_ttext_2 | |
0ec6429b | 1686 | MOSTLYCLEANFILES += flagstest_o_ttext_2 |
d12a5ea8 ILT |
1687 | flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld |
1688 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010 | |
1689 | ||
99f8faca ILT |
1690 | # Test symbol versioning. |
1691 | check_PROGRAMS += ver_test | |
1692 | ver_test_SOURCES = ver_test_main.cc | |
1693 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
1694 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1695 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
1696 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld | |
1697 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so | |
09124467 | 1698 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
41d0ab5f | 1699 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so |
09124467 ILT |
1700 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld |
1701 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o | |
99f8faca ILT |
1702 | ver_test_1.o: ver_test_1.cc |
1703 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1704 | ver_test_2.o: ver_test_2.cc | |
1705 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1706 | ver_test_3.o: ver_test_3.cc | |
1707 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1708 | ver_test_4.o: ver_test_4.cc | |
1709 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 1710 | |
0602e05a ILT |
1711 | check_SCRIPTS += ver_test_1.sh |
1712 | check_DATA += ver_test_1.syms | |
1713 | ver_test_1.syms: ver_test_1.so | |
1714 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1715 | ||
be3e6201 ILT |
1716 | check_PROGRAMS += ver_test_2 |
1717 | ver_test_2_SOURCES = ver_test_main_2.cc | |
1718 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
1719 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1720 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
1721 | ||
be3e6201 ILT |
1722 | check_SCRIPTS += ver_test_2.sh |
1723 | check_DATA += ver_test_2.syms | |
1724 | ver_test_2.syms: ver_test_2 | |
6835af53 | 1725 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 1726 | |
686c8caf ILT |
1727 | check_SCRIPTS += ver_test_4.sh |
1728 | check_DATA += ver_test_4.syms | |
1729 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 1730 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
1731 | |
1732 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld | |
1733 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so | |
1734 | ver_test_5.o: ver_test_5.cc | |
1735 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1736 | check_SCRIPTS += ver_test_5.sh | |
1737 | check_DATA += ver_test_5.syms | |
1738 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 1739 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 1740 | |
18e6b24e ILT |
1741 | check_PROGRAMS += ver_test_6 |
1742 | ver_test_6_SOURCES = ver_test_6.c | |
1743 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
1744 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1745 | ver_test_6_LDADD = ver_test_2.so | |
1746 | ||
479f6503 ILT |
1747 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
1748 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o | |
1749 | ver_test_7.o: ver_test_7.cc | |
1750 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1751 | check_SCRIPTS += ver_test_7.sh | |
1752 | check_DATA += ver_test_7.syms | |
1753 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 1754 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 1755 | |
75517b77 ILT |
1756 | check_PROGRAMS += ver_test_8 |
1757 | ver_test_8_SOURCES = two_file_test_main.cc | |
1758 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so | |
1759 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1760 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so | |
1761 | ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld | |
1762 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so | |
1763 | ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld | |
1764 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o | |
1765 | ||
40d7d93f CC |
1766 | check_SCRIPTS += ver_test_8.sh |
1767 | check_DATA += ver_test_8_2.so.syms | |
1768 | ver_test_8_2.so.syms: ver_test_8_2.so | |
1769 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1770 | ||
95d14cd3 ILT |
1771 | check_PROGRAMS += ver_test_9 |
1772 | ver_test_9_SOURCES = ver_test_main.cc | |
1773 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so | |
1774 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1775 | ver_test_9_LDADD = ver_test_9.so | |
1776 | ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld | |
41d0ab5f | 1777 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so |
95d14cd3 ILT |
1778 | ver_test_9.o: ver_test_9.cc |
1779 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1780 | ||
057ead22 ILT |
1781 | check_SCRIPTS += ver_test_10.sh |
1782 | check_DATA += ver_test_10.syms | |
1783 | ver_test_10.syms: ver_test_10.so | |
1784 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1785 | ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script | |
1786 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o | |
1787 | ||
9c5b8369 | 1788 | check_PROGRAMS += ver_test_11 |
72fef11a | 1789 | MOSTLYCLEANFILES += ver_test_11.a |
9c5b8369 ILT |
1790 | ver_test_11_SOURCES = ver_test_main_2.cc |
1791 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a | |
1792 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1793 | ver_test_11_LDADD = ver_test_11.a | |
1794 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o | |
1795 | $(TEST_AR) rc $@ $^ | |
1796 | ||
6d1c4efb ILT |
1797 | check_PROGRAMS += ver_test_12 |
1798 | ver_test_12_SOURCES = ver_test_main_2.cc | |
1799 | ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o | |
1800 | ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1801 | ver_test_12_LDADD = ver_test_12.o | |
1802 | ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o | |
1803 | gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o | |
1804 | ||
b45e00b3 CC |
1805 | check_SCRIPTS += ver_test_13.sh |
1806 | check_DATA += ver_test_13.syms | |
1807 | ver_test_13.syms: ver_test_13.so | |
1808 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
1809 | ver_test_13.so: gcctestdir/ld ver_test_13.o ver_test_13.script | |
1810 | $(LINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_13.script ver_test_13.o | |
1811 | ver_test_13.o: ver_test_13.c | |
1812 | $(COMPILE) -c -fpic -o $@ $< | |
1813 | ||
8bdcdf2c ILT |
1814 | check_PROGRAMS += protected_1 |
1815 | protected_1_SOURCES = \ | |
1816 | protected_main_1.cc protected_main_2.cc protected_main_3.cc | |
1817 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1818 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1819 | protected_1_LDADD = protected_1.so | |
1820 | ||
1821 | protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1822 | $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o | |
1823 | protected_1_pic.o: protected_1.cc | |
1824 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1825 | protected_2_pic.o: protected_2.cc | |
1826 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1827 | protected_3_pic.o: protected_3.cc | |
1828 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1829 | ||
1830 | check_PROGRAMS += protected_2 | |
1831 | protected_2_SOURCES = protected_main_1.cc protected_3.cc | |
1832 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so | |
1833 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1834 | protected_2_LDADD = protected_1.so | |
1835 | ||
837504c4 ILT |
1836 | check_DATA += protected_3.err |
1837 | MOSTLYCLEANFILES += protected_3.err | |
1838 | protected_4_pic.o: protected_4.cc | |
1839 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
1840 | protected_3.err: protected_4_pic.o gcctestdir/ld | |
1841 | @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@" | |
1842 | @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \ | |
1843 | echo 1>&2 "Link of protected_4.so should have failed"; \ | |
1844 | rm -f $@; \ | |
1845 | exit 1; \ | |
1846 | fi | |
1847 | ||
9f1d377b | 1848 | check_PROGRAMS += relro_test |
fc497986 CC |
1849 | check_SCRIPTS += relro_test.sh |
1850 | check_DATA += relro_test.stdout | |
9f1d377b ILT |
1851 | relro_test_SOURCES = relro_test_main.cc |
1852 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so | |
1853 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1854 | relro_test_LDADD = relro_test.so | |
1855 | relro_test.so: gcctestdir/ld relro_test_pic.o | |
1856 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o | |
1857 | relro_test_pic.o: relro_test.cc | |
1858 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
fc497986 CC |
1859 | relro_test.stdout: relro_test.so |
1860 | $(TEST_READELF) -SlW relro_test.so > relro_test.stdout | |
9f1d377b | 1861 | |
9446efde ILT |
1862 | check_PROGRAMS += relro_now_test |
1863 | relro_now_test_SOURCES = relro_test_main.cc | |
1864 | relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so | |
1865 | relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now | |
1866 | relro_now_test_LDADD = relro_now_test.so | |
1867 | relro_now_test.so: gcctestdir/ld relro_test_pic.o | |
1868 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o | |
1869 | ||
5f1ab67a ILT |
1870 | check_PROGRAMS += relro_strip_test |
1871 | relro_strip_test_SOURCES = relro_test_main.cc | |
1872 | relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so | |
1873 | relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1874 | relro_strip_test_LDADD = relro_strip_test.so | |
1875 | relro_strip_test.so: relro_test.so | |
1876 | $(TEST_STRIP) -o $@ $< | |
1877 | ||
2d924fd9 ILT |
1878 | check_PROGRAMS += relro_script_test |
1879 | relro_script_test_SOURCES = relro_test_main.cc | |
1880 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so | |
1881 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
1882 | relro_script_test_LDADD = relro_script_test.so | |
1883 | relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o | |
1496b446 | 1884 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o |
2d924fd9 | 1885 | |
e5756efb | 1886 | check_PROGRAMS += script_test_1 |
5b2af7dd | 1887 | script_test_1_SOURCES = script_test_1a.cc script_test_1b.cc |
e5756efb | 1888 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t |
1496b446 | 1889 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t |
1abce4a6 | 1890 | script_test_1_LDADD = |
e5756efb | 1891 | |
a445fddf ILT |
1892 | check_PROGRAMS += script_test_2 |
1893 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
1894 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
1496b446 | 1895 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t |
1abce4a6 | 1896 | script_test_2_LDADD = |
a445fddf | 1897 | |
88dd47ac ILT |
1898 | check_PROGRAMS += justsyms |
1899 | justsyms_SOURCES = justsyms_1.cc | |
1900 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
1901 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
1abce4a6 | 1902 | justsyms_LDADD = |
88dd47ac ILT |
1903 | justsyms_2.o: justsyms_2.cc |
1904 | $(CXXCOMPILE) -c -o $@ $< | |
83bfb6b7 | 1905 | justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t |
52dc3f9c | 1906 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o |
88dd47ac | 1907 | |
c3f7b0e5 CC |
1908 | check_PROGRAMS += justsyms_exec |
1909 | justsyms_exec_SOURCES = justsyms_exec.c | |
1910 | justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib | |
1911 | justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib | |
1912 | justsyms_exec_LDADD = | |
0ec6429b | 1913 | MOSTLYCLEANFILES += justsyms_lib |
c3f7b0e5 CC |
1914 | justsyms_lib.o: justsyms_lib.c |
1915 | $(COMPILE) -c -o $@ $< | |
1916 | justsyms_lib: justsyms_lib.o gcctestdir/ld | |
1917 | gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o | |
1918 | ||
bc644c6c | 1919 | check_PROGRAMS += binary_test |
72fef11a | 1920 | MOSTLYCLEANFILES += binary.txt |
bc644c6c ILT |
1921 | binary_test_SOURCES = binary_test.cc |
1922 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
1923 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf | |
1abce4a6 | 1924 | binary_test_LDADD = |
bc644c6c ILT |
1925 | # Copy the file to the build directory to avoid worrying about the |
1926 | # full pathname in the generated symbols. | |
1927 | binary.txt: $(srcdir)/binary.in | |
1928 | rm -f $@ | |
1929 | $(LN_S) $< $@ | |
1930 | ||
09124467 ILT |
1931 | check_SCRIPTS += ver_matching_test.sh |
1932 | check_DATA += ver_matching_test.stdout | |
1933 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
2fbb4320 ILT |
1934 | ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld |
1935 | $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map | |
1936 | ver_matching_def_pic.o: ver_matching_def.cc | |
1937 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< | |
09124467 | 1938 | ver_matching_test.stdout: ver_matching_def.so |
52dc3f9c | 1939 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
1c4f3631 ILT |
1940 | |
1941 | check_PROGRAMS += script_test_3 | |
1942 | check_SCRIPTS += script_test_3.sh | |
1943 | check_DATA += script_test_3.stdout | |
1944 | MOSTLYCLEANFILES += script_test_3.stdout | |
1945 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
1496b446 | 1946 | $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_3.t |
1c4f3631 | 1947 | script_test_3.stdout: script_test_3 |
2cefc357 | 1948 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
09124467 | 1949 | |
4ebf39db ILT |
1950 | check_PROGRAMS += tls_phdrs_script_test |
1951 | tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) | |
1952 | tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t | |
1496b446 | 1953 | tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t |
4ebf39db ILT |
1954 | tls_phdrs_script_test_LDADD = $(tls_test_LDADD) |
1955 | ||
e6188289 ILT |
1956 | check_SCRIPTS += script_test_4.sh |
1957 | check_DATA += script_test_4.stdout | |
72fef11a | 1958 | MOSTLYCLEANFILES += script_test_4 |
e6188289 | 1959 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t |
1496b446 | 1960 | $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_4.t |
e6188289 ILT |
1961 | script_test_4.stdout: script_test_4 |
1962 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout | |
1963 | ||
6c93b22c ILT |
1964 | check_PROGRAMS += tls_script_test |
1965 | tls_script_test_SOURCES = $(tls_test_SOURCES) | |
1966 | tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t | |
1496b446 | 1967 | tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_4.t |
6c93b22c ILT |
1968 | tls_script_test_LDADD = $(tls_test_LDADD) |
1969 | ||
401a9a73 CC |
1970 | check_SCRIPTS += script_test_5.sh |
1971 | check_DATA += script_test_5.stdout | |
72fef11a | 1972 | MOSTLYCLEANFILES += script_test_5 |
401a9a73 | 1973 | script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t |
1496b446 | 1974 | $(CXXLINK) -Bgcctestdir/ script_test_5.o -Wl,-T,$(srcdir)/script_test_5.t |
401a9a73 CC |
1975 | script_test_5.stdout: script_test_5 |
1976 | $(TEST_READELF) -SW script_test_5 > script_test_5.stdout | |
1977 | ||
3c12dcdb DK |
1978 | check_SCRIPTS += script_test_6.sh |
1979 | check_DATA += script_test_6.stdout | |
1980 | MOSTLYCLEANFILES += script_test_6 | |
1981 | script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t | |
1496b446 | 1982 | $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_6.t \ |
3c12dcdb DK |
1983 | -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000 |
1984 | script_test_6.stdout: script_test_6 | |
1985 | $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout | |
1986 | ||
1987 | check_SCRIPTS += script_test_7.sh | |
1988 | check_DATA += script_test_7.stdout | |
1989 | MOSTLYCLEANFILES += script_test_7 | |
1990 | script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1496b446 | 1991 | $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_7.t |
3c12dcdb DK |
1992 | script_test_7.stdout: script_test_7 |
1993 | $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout | |
1994 | ||
1995 | check_SCRIPTS += script_test_8.sh | |
1996 | check_DATA += script_test_8.stdout | |
1997 | MOSTLYCLEANFILES += script_test_8 | |
1998 | script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t | |
1496b446 | 1999 | $(CXXLINK) -Bgcctestdir/ basic_test.o -Wl,-T,$(srcdir)/script_test_7.t \ |
3c12dcdb DK |
2000 | -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000 |
2001 | script_test_8.stdout: script_test_8 | |
2002 | $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout | |
2003 | ||
d103a984 RÁE |
2004 | check_SCRIPTS += script_test_9.sh |
2005 | check_DATA += script_test_9.stdout | |
0ec6429b | 2006 | MOSTLYCLEANFILES += script_test_9 |
d103a984 RÁE |
2007 | script_test_9.o: script_test_9.cc |
2008 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
2009 | script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o | |
1496b446 | 2010 | $(CXXLINK) -Bgcctestdir/ script_test_9.o -Wl,-T,$(srcdir)/script_test_9.t |
d103a984 RÁE |
2011 | script_test_9.stdout: script_test_9 |
2012 | $(TEST_READELF) -lW script_test_9 > script_test_9.stdout | |
2013 | ||
502e8a84 CC |
2014 | # Test scripts with a relocatable link. |
2015 | # The -g option is necessary to trigger a bug where a section | |
2016 | # declared in a script file is assigned a non-zero starting address. | |
2017 | check_PROGRAMS += script_test_11 | |
2018 | script_test_11: gcctestdir/ld script_test_11_r.o | |
2019 | $(LINK) -Bgcctestdir/ script_test_11_r.o | |
5b2af7dd L |
2020 | script_test_11_r.o: gcctestdir/ld $(srcdir)/script_test_11.t script_test_11a.o script_test_11b.o |
2021 | gcctestdir/ld -r -o $@ -T $(srcdir)/script_test_11.t script_test_11a.o script_test_11b.o | |
2022 | script_test_11a.o: script_test_11a.c | |
2023 | $(COMPILE) -c -g -o $@ $< | |
2024 | script_test_11b.o: script_test_11b.c | |
502e8a84 | 2025 | $(COMPILE) -c -g -o $@ $< |
d103a984 | 2026 | |
374082df CC |
2027 | # Test difference between "*(a b)" and "*(a) *(b)" in input section spec. |
2028 | check_PROGRAMS += script_test_12 | |
2029 | script_test_12: gcctestdir/ld $(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o | |
2030 | $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o | |
2031 | ||
2032 | check_PROGRAMS += script_test_12i | |
2033 | script_test_12i: gcctestdir/ld $(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o | |
2034 | $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o | |
a3a0c391 JY |
2035 | script_test_12a.o: script_test_12a.c |
2036 | $(COMPILE) -O0 -c -o $@ $< | |
2037 | script_test_12b.o: script_test_12b.c | |
2038 | $(COMPILE) -O0 -c -o $@ $< | |
374082df | 2039 | |
bfbf34de CC |
2040 | # Test for ordering internally created sections with a linker script. |
2041 | check_SCRIPTS += script_test_13.sh | |
2042 | check_DATA += script_test_13.stdout | |
2043 | MOSTLYCLEANFILES += script_test_13 | |
2044 | script_test_13.o: script_test_13.c | |
2045 | $(COMPILE) -O0 -c -fPIC -o $@ $< | |
2046 | script_test_13: $(srcdir)/script_test_13.t script_test_13.o gcctestdir/ld | |
2047 | gcctestdir/ld -shared -o $@ script_test_13.o -T $(srcdir)/script_test_13.t | |
2048 | script_test_13.stdout: script_test_13 | |
2049 | $(TEST_READELF) -SW script_test_13 > $@ | |
2050 | ||
f224a3c5 IK |
2051 | # Test for SORT_BY_INIT_PRIORITY. |
2052 | check_SCRIPTS += script_test_14.sh | |
2053 | check_DATA += script_test_14.stdout | |
2054 | MOSTLYCLEANFILES += script_test_14 | |
2055 | script_test_14.o: script_test_14.s | |
2056 | $(TEST_AS) -o $@ $< | |
2057 | script_test_14: $(srcdir)/script_test_14.t script_test_14.o gcctestdir/ld | |
2058 | gcctestdir/ld -o $@ script_test_14.o -T $(srcdir)/script_test_14.t | |
2059 | script_test_14.stdout: script_test_14 | |
2060 | $(TEST_OBJDUMP) -s script_test_14 > $@ | |
2061 | ||
5d9f66cb CC |
2062 | # Test BSS section placement at end of segment. |
2063 | check_SCRIPTS += script_test_15a.sh | |
2064 | check_DATA += script_test_15a.stdout | |
2065 | MOSTLYCLEANFILES += script_test_15a | |
2066 | script_test_15a: $(srcdir)/script_test_15a.t script_test_15.o gcctestdir/ld | |
2067 | gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15a.t | |
2068 | script_test_15a.stdout: script_test_15a | |
2069 | $(TEST_READELF) -lSW script_test_15a > $@ | |
2070 | ||
2071 | # Test BSS section placement in middle of segment. | |
2072 | check_SCRIPTS += script_test_15b.sh | |
2073 | check_DATA += script_test_15b.stdout | |
2074 | MOSTLYCLEANFILES += script_test_15b | |
2075 | script_test_15b: $(srcdir)/script_test_15b.t script_test_15.o gcctestdir/ld | |
2076 | gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15b.t | |
2077 | script_test_15b.stdout: script_test_15b | |
2078 | $(TEST_READELF) -lSW script_test_15b > $@ | |
2079 | ||
2080 | # Test orphan BSS section placement. | |
2081 | check_SCRIPTS += script_test_15c.sh | |
2082 | check_DATA += script_test_15c.stdout | |
2083 | MOSTLYCLEANFILES += script_test_15c | |
2084 | script_test_15c: $(srcdir)/script_test_15c.t script_test_15.o gcctestdir/ld | |
2085 | gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15c.t | |
2086 | script_test_15c.stdout: script_test_15c | |
2087 | $(TEST_READELF) -lSW script_test_15c > $@ | |
2088 | ||
c82fbeee CS |
2089 | # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, |
2090 | # and --dynamic-list-cpp-typeinfo | |
2091 | ||
2092 | check_SCRIPTS += dynamic_list.sh | |
2093 | check_DATA += dynamic_list.stdout | |
72fef11a | 2094 | MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout |
c82fbeee CS |
2095 | dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t |
2096 | $(CXXLINK) -Bgcctestdir/ basic_test.o \ | |
2097 | -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ | |
2098 | -Wl,--dynamic-list-data \ | |
2099 | -Wl,--dynamic-list-cpp-new \ | |
2100 | -Wl,--dynamic-list-cpp-typeinfo | |
2101 | dynamic_list.stdout: dynamic_list | |
94e6ee91 | 2102 | $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout |
c82fbeee | 2103 | |
fd834e57 CC |
2104 | check_PROGRAMS += dynamic_list_2 |
2105 | dynamic_list_2_SOURCES = dynamic_list_2.cc | |
2106 | dynamic_list_2_DEPENDENCIES = gcctestdir/ld dynamic_list_lib1.so dynamic_list_lib2.so | |
2107 | dynamic_list_2_LDFLAGS = -Bgcctestdir/ -L. -Wl,-R,. -Wl,--no-as-needed | |
2108 | dynamic_list_2_LDADD = dynamic_list_lib1.so dynamic_list_lib2.so | |
2109 | ||
2110 | dynamic_list_lib1.so: gcctestdir/ld dynamic_list_lib1.o | |
2111 | $(CXXLINK) -Bgcctestdir/ -shared dynamic_list_lib1.o | |
2112 | dynamic_list_lib1.o: dynamic_list_lib1.cc | |
2113 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
2114 | ||
2115 | dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t | |
e9c1bdad | 2116 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o |
fd834e57 CC |
2117 | dynamic_list_lib2.o: dynamic_list_lib2.cc |
2118 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
2119 | ||
fbd8a257 | 2120 | check_PROGRAMS += thin_archive_test_1 |
72fef11a CC |
2121 | MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \ |
2122 | alt/thin_archive_test_2.o alt/thin_archive_test_4.o \ | |
2123 | alt/libthin2.a alt/libthin4.a | |
fbd8a257 CC |
2124 | thin_archive_test_1_SOURCES = thin_archive_main.cc |
2125 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a | |
2126 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt | |
2127 | thin_archive_test_1_LDADD = libthin1.a -lthin2 | |
2128 | ||
2129 | check_PROGRAMS += thin_archive_test_2 | |
2130 | thin_archive_test_2_SOURCES = thin_archive_main.cc | |
2131 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a | |
2132 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. | |
2133 | thin_archive_test_2_LDADD = -lthinall | |
2134 | ||
2135 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o | |
2136 | rm -f $@ | |
2137 | $(TEST_AR) crT $@ $^ | |
2138 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o | |
2139 | rm -f $@ | |
2140 | $(TEST_AR) crT $@ $^ | |
2141 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o | |
2142 | rm -f $@ | |
2143 | $(TEST_AR) crT $@ $^ | |
2144 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o | |
2145 | rm -f $@ | |
2146 | $(TEST_AR) crT $@ $^ | |
2147 | libthinall.a: libthin3.a alt/libthin4.a | |
2148 | rm -f $@ | |
2149 | $(TEST_AR) crT $@ $^ | |
2150 | alt/thin_archive_test_2.o: thin_archive_test_2.cc | |
2151 | test -d alt || mkdir -p alt | |
2152 | $(CXXCOMPILE) -c -o $@ $< | |
2153 | alt/thin_archive_test_4.o: thin_archive_test_4.cc | |
2154 | test -d alt || mkdir -p alt | |
2155 | $(CXXCOMPILE) -c -o $@ $< | |
2156 | ||
89fc3421 CC |
2157 | if PLUGINS |
2158 | ||
2159 | check_PROGRAMS += plugin_test_1 | |
2160 | check_SCRIPTS += plugin_test_1.sh | |
2161 | check_DATA += plugin_test_1.err | |
2162 | MOSTLYCLEANFILES += plugin_test_1.err | |
2cfbf2fe CC |
2163 | 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 |
2164 | $(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 |
2165 | plugin_test_1.err: plugin_test_1 |
2166 | @touch plugin_test_1.err | |
2167 | ||
2168 | check_PROGRAMS += plugin_test_2 | |
2169 | check_SCRIPTS += plugin_test_2.sh | |
2170 | check_DATA += plugin_test_2.err | |
2171 | MOSTLYCLEANFILES += plugin_test_2.err | |
2cfbf2fe CC |
2172 | 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 |
2173 | $(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 |
2174 | plugin_test_2.err: plugin_test_2 |
2175 | @touch plugin_test_2.err | |
2176 | ||
d66a9eb3 CC |
2177 | check_PROGRAMS += plugin_test_3 |
2178 | check_SCRIPTS += plugin_test_3.sh | |
2179 | check_DATA += plugin_test_3.err | |
2180 | MOSTLYCLEANFILES += plugin_test_3.err | |
2cfbf2fe CC |
2181 | 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 |
2182 | $(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 |
2183 | plugin_test_3.err: plugin_test_3 |
2184 | @touch plugin_test_3.err | |
2185 | ||
0f7c0701 CC |
2186 | check_PROGRAMS += plugin_test_4 |
2187 | check_SCRIPTS += plugin_test_4.sh | |
2188 | check_DATA += plugin_test_4.err | |
72fef11a | 2189 | MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err |
0f7c0701 CC |
2190 | plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so |
2191 | $(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 | |
2192 | plugin_test_4.err: plugin_test_4 | |
2193 | @touch plugin_test_4.err | |
2194 | ||
2cfbf2fe | 2195 | plugin_test_4.a: two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms |
0f7c0701 CC |
2196 | $(TEST_AR) cr $@ $^ |
2197 | ||
24998053 | 2198 | check_PROGRAMS += plugin_test_5 |
2cfbf2fe CC |
2199 | 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 |
2200 | $(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 | 2201 | |
be234d88 CC |
2202 | check_PROGRAMS += plugin_test_6 |
2203 | check_SCRIPTS += plugin_test_6.sh | |
2204 | check_DATA += plugin_test_6.err | |
2205 | MOSTLYCLEANFILES += plugin_test_6.err | |
2cfbf2fe CC |
2206 | plugin_test_6: plugin_common_test_1.o.syms plugin_common_test_2.o.syms gcctestdir/ld plugin_test.so |
2207 | $(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 |
2208 | plugin_test_6.err: plugin_test_6 |
2209 | @touch plugin_test_6.err | |
2210 | ||
5e0f337e RÁE |
2211 | check_PROGRAMS += plugin_test_7 |
2212 | check_SCRIPTS += plugin_test_7.sh | |
2cfbf2fe | 2213 | check_DATA += plugin_test_7.err plugin_test_7.o.syms |
5e0f337e | 2214 | MOSTLYCLEANFILES += plugin_test_7.err |
2cfbf2fe CC |
2215 | plugin_test_7: plugin_test_7_1.o plugin_test_7_1.o.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so |
2216 | $(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 | |
2217 | plugin_test_7.o.syms: plugin_test_7 | |
5e0f337e RÁE |
2218 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2219 | plugin_test_7_1.o: plugin_test_7_1.c | |
2220 | $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
2221 | plugin_test_7_1_orig.o: plugin_test_7_1.c | |
2222 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
2cfbf2fe | 2223 | plugin_test_7_1.o.syms: plugin_test_7_1_orig.o |
5e0f337e RÁE |
2224 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2225 | plugin_test_7_2.o: plugin_test_7_2.c | |
2226 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< | |
2227 | plugin_test_7.err: plugin_test_7 | |
2228 | ||
f3a2388f CC |
2229 | # Test plugins with -r. |
2230 | check_PROGRAMS += plugin_test_8 | |
2cfbf2fe CC |
2231 | 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 |
2232 | ../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 |
2233 | plugin_test_8: plugin_test_8.o gcctestdir/ld |
2234 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o | |
2235 | ||
2236 | # Test that symbols known in the IR file but not in the replacement file | |
2237 | # produce an unresolved symbol error. | |
2238 | check_DATA += plugin_test_9.err | |
2239 | MOSTLYCLEANFILES += plugin_test_9.err | |
2cfbf2fe CC |
2240 | 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 |
2241 | @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>$@" | |
2242 | @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 |
2243 | echo 1>&2 "Link of plugin_test_9 should have failed"; \ |
2244 | rm -f $@; \ | |
2245 | exit 1; \ | |
2246 | fi | |
2247 | # Make a .syms file that claims to define the symbol _Z4t16av. | |
2cfbf2fe CC |
2248 | two_file_test_1c.o.syms: two_file_test_1.o.syms two_file_test_1c.o |
2249 | cp two_file_test_1.o.syms $@.tmp | |
2250 | grep "_Z4t16av" two_file_test_1b.o.syms >> $@.tmp | |
f3a2388f CC |
2251 | mv -f $@.tmp $@ |
2252 | # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. | |
2253 | MOSTLYCLEANFILES += two_file_test_1c.o | |
2254 | two_file_test_1c.o: two_file_test_1.o | |
2255 | cp two_file_test_1.o $@ | |
2256 | ||
648c5cbb CC |
2257 | # As above, but check COMDAT case, where a non-IR file contains a duplicate |
2258 | # of a COMDAT group in an IR file. | |
2259 | check_DATA += plugin_test_9b.err | |
2260 | MOSTLYCLEANFILES += plugin_test_9b.err | |
2261 | plugin_test_9b.err: plugin_test_9b_ir.o.syms plugin_test_9b_ir.o plugin_test_9b_elf.o gcctestdir/ld plugin_test.so | |
2262 | @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9b -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_ZN1A5printEv" plugin_test_9b_ir.o plugin_test_9b_elf.o "2>$@" | |
2263 | @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9b -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_ZN1A5printEv" plugin_test_9b_ir.o plugin_test_9b_elf.o 2>$@; then \ | |
2264 | echo 1>&2 "Link of plugin_test_9b should have failed"; \ | |
2265 | rm -f $@; \ | |
2266 | exit 1; \ | |
2267 | fi | |
2268 | # Make a .syms file that claims to define a method in class A in a COMDAT group. | |
2269 | # The real plugin_test_9b_ir.o will be compiled without the -D, and will not | |
2270 | # define any methods in class A. | |
2271 | plugin_test_9b_ir.o.syms: plugin_test_9b_ir_witha.o | |
2272 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2273 | plugin_test_9b_ir_witha.o: plugin_test_9b_ir.cc | |
2274 | $(CXXCOMPILE) -c -DUSE_CLASS_A -o $@ $< | |
2275 | ||
c0c71592 RÁE |
2276 | check_PROGRAMS += plugin_test_10 |
2277 | check_SCRIPTS += plugin_test_10.sh | |
2278 | check_DATA += plugin_test_10.sections | |
2279 | MOSTLYCLEANFILES += plugin_test_10.sections | |
2cfbf2fe CC |
2280 | plugin_test_10: plugin_common_test_1.o.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so |
2281 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o | |
c0c71592 RÁE |
2282 | plugin_test_10.sections: plugin_test_10 |
2283 | $(TEST_READELF) -SW $< >$@ 2>/dev/null | |
2284 | ||
2cfbf2fe CC |
2285 | check_PROGRAMS += plugin_test_11 |
2286 | check_SCRIPTS += plugin_test_11.sh | |
2287 | check_DATA += plugin_test_11.err | |
dddcc5b9 | 2288 | MOSTLYCLEANFILES += plugin_test_11.err plugin_test_thin.a |
2cfbf2fe CC |
2289 | PLUGIN_TEST_11_SYMS = two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms |
2290 | plugin_test_11: two_file_test_main.o plugin_test_thin.a gcctestdir/ld plugin_test.so $(PLUGIN_TEST_11_SYMS) | |
2291 | $(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 | |
2292 | plugin_test_11.err: plugin_test_11 | |
2293 | @touch plugin_test_11.err | |
2294 | plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
2295 | rm -f $@ | |
2296 | $(TEST_AR) crT $@ $^ | |
c0c71592 | 2297 | |
ca464aac TJ |
2298 | check_PROGRAMS += plugin_test_12 |
2299 | check_SCRIPTS += plugin_test_12.sh | |
2300 | check_DATA += plugin_test_12.err | |
2301 | MOSTLYCLEANFILES += plugin_test_12.err | |
2302 | export_dynamic_plugin.o.syms: export_dynamic_plugin.o | |
2303 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2304 | export_dynamic_plugin.o: export_dynamic_plugin.cc | |
2305 | $(COMPILE) -c -o $@ $< | |
2306 | plugin_test_12: export_dynamic_plugin.o gcctestdir/ld plugin_test.so export_dynamic_plugin.o.syms | |
2307 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z3foov" -Wl,--export-dynamic-symbol,"_Z3foov" export_dynamic_plugin.o.syms 2>plugin_test_12.err | |
2308 | plugin_test_12.err: plugin_test_12 | |
2309 | @touch plugin_test_12.err | |
95ecdfbf ES |
2310 | |
2311 | check_PROGRAMS += plugin_test_start_lib | |
2312 | check_SCRIPTS += plugin_test_start_lib.sh | |
2313 | check_DATA += plugin_test_start_lib.err | |
2314 | MOSTLYCLEANFILES += plugin_test_start_lib.err | |
2315 | plugin_test_start_lib: unused.o plugin_start_lib_test.o plugin_start_lib_test_2.syms gcctestdir/ld plugin_test.so | |
2316 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_start_lib_test.o \ | |
2317 | -Wl,--start-lib plugin_start_lib_test_2.syms -Wl,--end-lib 2>plugin_test_start_lib.err | |
2318 | plugin_test_start_lib.err: plugin_test_start_lib | |
2319 | @touch plugin_test_start_lib.err | |
2320 | ||
2321 | ||
2322 | plugin_start_lib_test_2.syms: plugin_start_lib_test_2.o | |
2323 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2324 | ||
2325 | ||
78d9f182 | 2326 | plugin_test.so: plugin_test.o gcctestdir/ld |
89fc3421 CC |
2327 | $(LINK) -Bgcctestdir/ -shared plugin_test.o |
2328 | plugin_test.o: plugin_test.c | |
2329 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
2330 | ||
2cfbf2fe | 2331 | two_file_test_main.o.syms: two_file_test_main.o |
89fc3421 | 2332 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2cfbf2fe | 2333 | two_file_test_1.o.syms: two_file_test_1.o |
89fc3421 | 2334 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2cfbf2fe | 2335 | two_file_test_1b.o.syms: two_file_test_1b.o |
89fc3421 | 2336 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2cfbf2fe | 2337 | two_file_test_2.o.syms: two_file_test_2.o |
89fc3421 | 2338 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2cfbf2fe | 2339 | plugin_common_test_1.o.syms: plugin_common_test_1.o |
be234d88 | 2340 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2cfbf2fe | 2341 | plugin_common_test_2.o.syms: plugin_common_test_2.o |
be234d88 | 2342 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
24998053 | 2343 | |
2cfbf2fe | 2344 | empty.o.syms: |
24998053 CC |
2345 | @echo "" >$@ |
2346 | @echo "Symbol table" >>$@ | |
2347 | ||
32364e50 CC |
2348 | if TLS |
2349 | ||
2350 | check_PROGRAMS += plugin_test_tls | |
2351 | check_SCRIPTS += plugin_test_tls.sh | |
2352 | check_DATA += plugin_test_tls.err | |
2353 | MOSTLYCLEANFILES += plugin_test_tls.err | |
2cfbf2fe CC |
2354 | 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 |
2355 | $(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 |
2356 | plugin_test_tls.err: plugin_test_tls |
2357 | @touch plugin_test_tls.err | |
2358 | ||
2cfbf2fe | 2359 | two_file_test_2_tls.o.syms: two_file_test_2_tls.o |
32364e50 CC |
2360 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2361 | ||
2362 | endif TLS | |
2363 | ||
24998053 | 2364 | MOSTLYCLEANFILES += unused.c |
2cfbf2fe | 2365 | unused.o.syms: unused.o |
24998053 CC |
2366 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
2367 | @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ | |
2368 | unused.o: unused.c | |
2369 | $(COMPILE) -c -o $@ $< | |
2370 | unused.c: | |
2371 | @cp /dev/null $@ | |
89fc3421 | 2372 | |
f0558624 | 2373 | check_SCRIPTS += plugin_final_layout.sh |
16164a6b | 2374 | check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout |
0ec6429b | 2375 | MOSTLYCLEANFILES += plugin_final_layout |
f0558624 ST |
2376 | plugin_final_layout.o: plugin_final_layout.cc |
2377 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< | |
2378 | plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld | |
2379 | $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o | |
2380 | plugin_final_layout.stdout: plugin_final_layout | |
864a1b56 | 2381 | $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout |
16164a6b ST |
2382 | plugin_final_layout_readelf.stdout: plugin_final_layout |
2383 | $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout | |
f0558624 | 2384 | |
78d9f182 | 2385 | plugin_section_order.so: plugin_section_order.o gcctestdir/ld |
f0558624 ST |
2386 | $(LINK) -Bgcctestdir/ -shared plugin_section_order.o |
2387 | plugin_section_order.o: plugin_section_order.c | |
2388 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
2389 | ||
82838bd6 CC |
2390 | check_SCRIPTS += plugin_layout_with_alignment.sh |
2391 | check_DATA += plugin_layout_with_alignment.stdout | |
2392 | MOSTLYCLEANFILES += plugin_layout_with_alignment | |
fd91f002 L |
2393 | plugin_layout_with_alignment.o: plugin_layout_with_alignment.c |
2394 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< | |
82838bd6 | 2395 | plugin_layout_with_alignment: plugin_layout_with_alignment.o plugin_section_alignment.so gcctestdir/ld |
fd91f002 | 2396 | $(LINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_alignment.so" plugin_layout_with_alignment.o |
82838bd6 CC |
2397 | plugin_layout_with_alignment.stdout: plugin_layout_with_alignment |
2398 | $(TEST_NM) -n --synthetic plugin_layout_with_alignment > plugin_layout_with_alignment.stdout | |
2399 | ||
78d9f182 | 2400 | plugin_section_alignment.so: plugin_section_alignment.o gcctestdir/ld |
82838bd6 CC |
2401 | $(CXXLINK) -Bgcctestdir/ -shared plugin_section_alignment.o |
2402 | plugin_section_alignment.o: plugin_section_alignment.cc | |
2403 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< | |
2404 | ||
89fc3421 CC |
2405 | endif PLUGINS |
2406 | ||
65514900 CC |
2407 | check_PROGRAMS += exclude_libs_test |
2408 | check_SCRIPTS += exclude_libs_test.sh | |
2409 | check_DATA += exclude_libs_test.syms | |
2410 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ | |
2fdd743f | 2411 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
65514900 CC |
2412 | exclude_libs_test_SOURCES = exclude_libs_test.c |
2413 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ | |
2fdd743f DK |
2414 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
2415 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ | |
2416 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ | |
2417 | -Wl,--exclude-libs,libexclude_libs_test_3 | |
2418 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ | |
2419 | alt/libexclude_libs_test_3.a | |
65514900 CC |
2420 | exclude_libs_test.syms: exclude_libs_test |
2421 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2422 | libexclude_libs_test_1.a: exclude_libs_test_1.o | |
2423 | $(TEST_AR) rc $@ $^ | |
2424 | libexclude_libs_test_2.a: exclude_libs_test_2.o | |
2425 | $(TEST_AR) rc $@ $^ | |
2fdd743f DK |
2426 | alt/libexclude_libs_test_3.a: exclude_libs_test_3.o |
2427 | test -d alt || mkdir -p alt | |
2428 | $(TEST_AR) rc $@ $^ | |
65514900 | 2429 | |
805bb01c DK |
2430 | check_PROGRAMS += local_labels_test |
2431 | local_labels_test.o: ver_test_6.c | |
2432 | $(COMPILE) -g -c -Wa,-L -o $@ $< | |
78d9f182 | 2433 | local_labels_test: local_labels_test.o gcctestdir/ld |
805bb01c DK |
2434 | $(LINK) -Bgcctestdir/ local_labels_test.o |
2435 | ||
bb04269c DK |
2436 | check_PROGRAMS += discard_locals_test |
2437 | check_SCRIPTS += discard_locals_test.sh | |
d3bbad62 ILT |
2438 | check_DATA += discard_locals_test.syms \ |
2439 | discard_locals_relocatable_test1.syms \ | |
2440 | discard_locals_relocatable_test2.syms | |
2441 | MOSTLYCLEANFILES += discard_locals_test.syms \ | |
2442 | discard_locals_relocatable_test1.syms \ | |
2443 | discard_locals_relocatable_test2.syms \ | |
2444 | discard_locals_relocatable_test1.out \ | |
2445 | discard_locals_relocatable_test2.out | |
bb04269c DK |
2446 | discard_locals_test_SOURCES = discard_locals_test.c |
2447 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals | |
2448 | discard_locals_test.syms: discard_locals_test | |
2449 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2450 | # '-Wa,-L' is required to preserve the local label used for testing. | |
2451 | discard_locals_test.o: discard_locals_test.c | |
2452 | $(COMPILE) -c -Wa,-L -o $@ $< | |
2453 | ||
d3bbad62 ILT |
2454 | discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out |
2455 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2456 | discard_locals_relocatable_test.o: discard_locals_relocatable_test.c | |
2457 | $(COMPILE) -c -Wa,-L -fPIC -o $@ $< | |
2458 | discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new | |
2459 | ../ld-new --discard-locals -relocatable -o $@ $< | |
2460 | ||
2461 | discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out | |
2462 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
2463 | discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new | |
2464 | ../ld-new --discard-all -relocatable -o $@ $< | |
2465 | ||
8a5e3e08 ILT |
2466 | if MCMODEL_MEDIUM |
2467 | check_PROGRAMS += large | |
2468 | large_SOURCES = large.c | |
2469 | large_CFLAGS = -mcmodel=medium | |
2470 | large_DEPENDENCIES = gcctestdir/ld | |
2471 | large_LDFLAGS = -Bgcctestdir/ | |
1abce4a6 | 2472 | large_LDADD = |
8a5e3e08 ILT |
2473 | endif MCMODEL_MEDIUM |
2474 | ||
645afe0c CC |
2475 | # Test that hidden and internal symbols in the main program cannot be |
2476 | # referenced by a shared library. | |
2477 | check_SCRIPTS += hidden_test.sh | |
2478 | check_DATA += hidden_test.err | |
c20ceeb2 | 2479 | MOSTLYCLEANFILES += hidden_test hidden_test.err hidden_test.syms |
645afe0c CC |
2480 | libhidden.so: hidden_test_1.c gcctestdir/ld |
2481 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c | |
2482 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld | |
2483 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err | |
c20ceeb2 YW |
2484 | hidden_test.syms: hidden_test |
2485 | $(TEST_NM) -D hidden_test > $@ | |
645afe0c CC |
2486 | hidden_test.err: hidden_test |
2487 | @touch hidden_test.err | |
2488 | ||
8c604651 CS |
2489 | # Test -retain-symbols-file. |
2490 | check_SCRIPTS += retain_symbols_file_test.sh | |
2491 | check_DATA += retain_symbols_file_test.stdout | |
2492 | MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \ | |
2493 | retain_symbols_file_test.stdout | |
2494 | retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld | |
2495 | echo 'main' > retain_symbols_file_test.in | |
2496 | echo 't1' >> retain_symbols_file_test.in | |
8c604651 CS |
2497 | echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in |
2498 | echo '_Z3t18v' >> retain_symbols_file_test.in | |
2b64b551 | 2499 | echo '__tcf_0' >> retain_symbols_file_test.in |
8c604651 CS |
2500 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o |
2501 | retain_symbols_file_test.stdout: retain_symbols_file_test.so | |
2502 | $(TEST_NM) -C retain_symbols_file_test.so > $@ | |
2503 | ||
2504 | ||
6a89f575 CC |
2505 | # Test that if the output file already exists and is empty, |
2506 | # it will get execute permission. | |
2507 | check_PROGRAMS += permission_test | |
2508 | permission_test: basic_test.o gcctestdir/ld | |
2509 | umask 022; \ | |
2510 | rm -f $@; \ | |
2511 | touch $@; \ | |
2512 | chmod 600 $@; \ | |
2513 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
2514 | ||
ae3b5189 CD |
2515 | # Check -l:foo.a |
2516 | check_PROGRAMS += searched_file_test | |
2517 | MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \ | |
2518 | alt/searched_file_test_lib.a | |
2519 | searched_file_test_SOURCES = searched_file_test.cc | |
78d9f182 | 2520 | searched_file_test_DEPENDENCIES = gcctestdir/ld alt/searched_file_test_lib.a |
ae3b5189 CD |
2521 | searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt |
2522 | searched_file_test_LDADD = -l:searched_file_test_lib.a | |
2523 | searched_file_test_lib.o: searched_file_test_lib.cc | |
2524 | $(CXXCOMPILE) -c -o $@ $< | |
2525 | alt/searched_file_test_lib.a: searched_file_test_lib.o | |
2526 | test -d alt || mkdir -p alt | |
2527 | $(TEST_AR) rc $@ $^ | |
2528 | ||
2b64b551 | 2529 | # Test that no .gnu.version sections are created when |
c5617f2f DK |
2530 | # symbol versioning is not used. |
2531 | check_SCRIPTS += no_version_test.sh | |
2532 | check_DATA += no_version_test.stdout | |
2533 | MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout | |
2534 | # We invoke the linker directly since gcc may include additional objects that | |
2535 | # uses symbol versioning. | |
2536 | libno_version_test.so: no_version_test.o gcctestdir/ld | |
2537 | gcctestdir/ld -shared -o $@ no_version_test.o | |
2538 | no_version_test.o: no_version_test.c | |
2539 | $(COMPILE) -o $@ -c -fPIC $< | |
2540 | no_version_test.stdout: libno_version_test.so | |
2541 | $(TEST_OBJDUMP) -h $< > $@ | |
2542 | ||
7223e9ca ILT |
2543 | # Test STT_GNU_IFUNC symbols. |
2544 | if IFUNC | |
2545 | ||
2546 | ifuncmod1.o: ifuncmod1.c | |
661d7a80 | 2547 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2548 | ifuncmod1.so: ifuncmod1.o gcctestdir/ld |
2549 | $(LINK) -Bgcctestdir/ -shared ifuncmod1.o | |
2550 | ||
2551 | ifuncdep1.o: ifuncmod1.c | |
2552 | $(COMPILE) -c -o $@ $< | |
2553 | ||
2554 | ifuncmain1pic.o: ifuncmain1.c | |
661d7a80 | 2555 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 2556 | ifuncmain1pie.o: ifuncmain1.c |
661d7a80 | 2557 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca | 2558 | |
328c7c2f | 2559 | if HAVE_STATIC |
ebb300b2 | 2560 | if IFUNC_STATIC |
7223e9ca ILT |
2561 | check_PROGRAMS += ifuncmain1static |
2562 | ifuncmain1static_SOURCES = ifuncmain1.c | |
2563 | ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o | |
2564 | ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static | |
2565 | ifuncmain1static_LDADD = ifuncdep1.o | |
2566 | ||
2567 | check_PROGRAMS += ifuncmain1picstatic | |
2568 | ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
2569 | $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o | |
c4d5a762 CC |
2570 | |
2571 | check_SCRIPTS += ifuncmod1.sh | |
2572 | check_DATA += ifuncmod1.so.stderr | |
2573 | ifuncmod1.so.stderr: ifuncmod1.so | |
2574 | $(TEST_READELF) -s $< > /dev/null 2> $@ | |
328c7c2f | 2575 | endif |
ebb300b2 | 2576 | endif |
7223e9ca ILT |
2577 | |
2578 | check_PROGRAMS += ifuncmain1 | |
2579 | ifuncmain1_SOURCES = ifuncmain1.c | |
2580 | ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
2581 | ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
2582 | ifuncmain1_LDADD = ifuncmod1.so | |
2583 | ||
2584 | check_PROGRAMS += ifuncmain1pic | |
2585 | ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld | |
2586 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
2587 | ||
2588 | check_PROGRAMS += ifuncmain1vis | |
2589 | ifuncmain1vis_SOURCES = ifuncmain1vis.c | |
2590 | ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so | |
2591 | ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
2592 | ifuncmain1vis_LDADD = ifuncmod1.so | |
2593 | ||
2594 | check_PROGRAMS += ifuncmain1vispic | |
2595 | ifuncmain1vispic.o: ifuncmain1vis.c | |
661d7a80 | 2596 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2597 | ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld |
2598 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. | |
2599 | ||
2600 | check_PROGRAMS += ifuncmain1staticpic | |
2601 | ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld | |
2602 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o | |
2603 | ||
2604 | check_PROGRAMS += ifuncmain1pie | |
2605 | ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld | |
2606 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,. | |
2607 | ||
2608 | check_PROGRAMS += ifuncmain1vispie | |
2609 | ifuncmain1vispie.o: ifuncmain1vis.c | |
661d7a80 | 2610 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
2611 | ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld |
2612 | $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. | |
2613 | ||
2614 | check_PROGRAMS += ifuncmain1staticpie | |
2615 | ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld | |
2616 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o | |
2617 | ||
2618 | ifuncmain2pic.o: ifuncmain2.c | |
661d7a80 | 2619 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2620 | |
2621 | ifuncdep2pic.o: ifuncdep2.c | |
661d7a80 | 2622 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 2623 | |
328c7c2f | 2624 | if HAVE_STATIC |
ebb300b2 | 2625 | if IFUNC_STATIC |
7223e9ca ILT |
2626 | check_PROGRAMS += ifuncmain2static |
2627 | ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c | |
2628 | ifuncmain2static_DEPENDENCIES = gcctestdir/ld | |
2629 | ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 2630 | ifuncmain2static_LDADD = |
7223e9ca ILT |
2631 | |
2632 | check_PROGRAMS += ifuncmain2picstatic | |
2633 | ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
2634 | $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o | |
328c7c2f | 2635 | endif |
ebb300b2 | 2636 | endif |
7223e9ca ILT |
2637 | |
2638 | check_PROGRAMS += ifuncmain2 | |
2639 | ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c | |
2640 | ifuncmain2_DEPENDENCIES = gcctestdir/ld | |
2641 | ifuncmain2_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 2642 | ifuncmain2_LDADD = |
7223e9ca ILT |
2643 | |
2644 | check_PROGRAMS += ifuncmain2pic | |
2645 | ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld | |
2646 | $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o | |
2647 | ||
2648 | ifuncmod3.o: ifuncmod3.c | |
661d7a80 | 2649 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2650 | ifuncmod3.so: ifuncmod3.o gcctestdir/ld |
2651 | $(LINK) -Bgcctestdir/ -shared ifuncmod3.o | |
2652 | ||
2653 | check_PROGRAMS += ifuncmain3 | |
2654 | ifuncmain3_SOURCES = ifuncmain3.c | |
2655 | ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so | |
2656 | ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,. | |
2657 | ifuncmain3_LDADD = -ldl | |
2658 | ||
2659 | ifuncmain4pic.o: ifuncmain4.c | |
661d7a80 | 2660 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca | 2661 | |
328c7c2f | 2662 | if HAVE_STATIC |
ebb300b2 | 2663 | if IFUNC_STATIC |
7223e9ca ILT |
2664 | check_PROGRAMS += ifuncmain4static |
2665 | ifuncmain4static_SOURCES = ifuncmain4.c | |
2666 | ifuncmain4static_DEPENDENCIES = gcctestdir/ld | |
2667 | ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 2668 | ifuncmain4static_LDADD = |
7223e9ca ILT |
2669 | |
2670 | check_PROGRAMS += ifuncmain4picstatic | |
2671 | ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld | |
2672 | $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o | |
328c7c2f | 2673 | endif |
ebb300b2 | 2674 | endif |
7223e9ca ILT |
2675 | |
2676 | check_PROGRAMS += ifuncmain4 | |
2677 | ifuncmain4_SOURCES = ifuncmain4.c | |
2678 | ifuncmain4_DEPENDENCIES = gcctestdir/ld | |
2679 | ifuncmain4_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 2680 | ifuncmain4_LDADD = |
7223e9ca ILT |
2681 | |
2682 | ifuncmain5pic.o: ifuncmain5.c | |
661d7a80 | 2683 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2684 | |
2685 | ifuncmain5pie.o: ifuncmain5.c | |
661d7a80 | 2686 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
2687 | |
2688 | ifuncmod5.o: ifuncmod5.c | |
661d7a80 | 2689 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2690 | ifuncmod5.so: ifuncmod5.o gcctestdir/ld |
2691 | $(LINK) -Bgcctestdir/ -shared ifuncmod5.o | |
2692 | ||
2693 | ifuncdep5.o: ifuncmod5.c | |
2694 | $(COMPILE) -c -o $@ $< | |
2695 | ||
328c7c2f | 2696 | if HAVE_STATIC |
ebb300b2 | 2697 | if IFUNC_STATIC |
7223e9ca ILT |
2698 | check_PROGRAMS += ifuncmain5static |
2699 | ifuncmain5static_SOURCES = ifuncmain5.c | |
2700 | ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o | |
2701 | ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static | |
2702 | ifuncmain5static_LDADD = ifuncdep5.o | |
2703 | ||
2704 | check_PROGRAMS += ifuncmain5picstatic | |
2705 | ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
2706 | $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o | |
328c7c2f | 2707 | endif |
ebb300b2 | 2708 | endif |
7223e9ca ILT |
2709 | |
2710 | check_PROGRAMS += ifuncmain5 | |
2711 | ifuncmain5_SOURCES = ifuncmain5.c | |
2712 | ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so | |
2713 | ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
2714 | ifuncmain5_LDADD = ifuncmod5.so | |
2715 | ||
2716 | check_PROGRAMS += ifuncmain5pic | |
2717 | ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld | |
2718 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,. | |
2719 | ||
2720 | check_PROGRAMS += ifuncmain5staticpic | |
2721 | ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld | |
2722 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o | |
2723 | ||
2724 | check_PROGRAMS += ifuncmain5pie | |
2725 | ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld | |
2726 | $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. | |
2727 | ||
2728 | ifuncmain6pie.o: ifuncmain6pie.c | |
661d7a80 | 2729 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca ILT |
2730 | |
2731 | ifuncmod6.o: ifuncmod6.c | |
661d7a80 | 2732 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2733 | ifuncmod6.so: ifuncmod6.o gcctestdir/ld |
2734 | $(LINK) -Bgcctestdir/ -shared ifuncmod6.o | |
2735 | ||
2736 | check_PROGRAMS += ifuncmain6pie | |
2737 | ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld | |
2738 | $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. | |
2739 | ||
2740 | ifuncmain7pic.o: ifuncmain7.c | |
661d7a80 | 2741 | $(COMPILE) -c -fPIC -o $@ $< |
7223e9ca ILT |
2742 | |
2743 | ifuncmain7pie.o: ifuncmain7.c | |
661d7a80 | 2744 | $(COMPILE) -c -fPIE -o $@ $< |
7223e9ca | 2745 | |
328c7c2f | 2746 | if HAVE_STATIC |
ebb300b2 | 2747 | if IFUNC_STATIC |
7223e9ca ILT |
2748 | check_PROGRAMS += ifuncmain7static |
2749 | ifuncmain7static_SOURCES = ifuncmain7.c | |
2750 | ifuncmain7static_DEPENDENCIES = gcctestdir/ld | |
2751 | ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static | |
f8e9a930 | 2752 | ifuncmain7static_LDADD = |
7223e9ca ILT |
2753 | |
2754 | check_PROGRAMS += ifuncmain7picstatic | |
2755 | ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld | |
2756 | $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o | |
328c7c2f | 2757 | endif |
ebb300b2 | 2758 | endif |
7223e9ca ILT |
2759 | |
2760 | check_PROGRAMS += ifuncmain7 | |
2761 | ifuncmain7_SOURCES = ifuncmain7.c | |
2762 | ifuncmain7_DEPENDENCIES = gcctestdir/ld | |
2763 | ifuncmain7_LDFLAGS = -Bgcctestdir/ | |
f8e9a930 | 2764 | ifuncmain7_LDADD = |
7223e9ca ILT |
2765 | |
2766 | check_PROGRAMS += ifuncmain7pic | |
2767 | ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld | |
2768 | $(LINK) -Bgcctestdir/ ifuncmain7pic.o | |
2769 | ||
2770 | check_PROGRAMS += ifuncmain7pie | |
2771 | ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld | |
2772 | $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o | |
2773 | ||
67181c72 ILT |
2774 | check_PROGRAMS += ifuncvar |
2775 | ifuncvar1_pic.o: ifuncvar1.c | |
661d7a80 | 2776 | $(COMPILE) -c -fPIC -o $@ $< |
2b64b551 | 2777 | ifuncvar2_pic.o: ifuncvar2.c |
661d7a80 | 2778 | $(COMPILE) -c -fPIC -o $@ $< |
67181c72 ILT |
2779 | ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld |
2780 | $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o | |
2781 | ifuncvar_SOURCES = ifuncvar3.c | |
2782 | ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so | |
2783 | ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
2784 | ifuncvar_LDADD = ifuncvar.so | |
2785 | ||
7223e9ca ILT |
2786 | endif IFUNC |
2787 | ||
74f67560 DK |
2788 | # Test that strong reference to a weak symbol in a DSO remains strong. |
2789 | check_SCRIPTS += strong_ref_weak_def.sh | |
2790 | check_DATA += strong_ref_weak_def.stdout | |
2791 | MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \ | |
2792 | strong_ref_weak_def.stdout | |
2793 | strong_ref_weak_def_2.o: strong_ref_weak_def_2.c | |
2794 | $(COMPILE) -o $@ -c -fPIC $< | |
2795 | strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld | |
2796 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o | |
2797 | strong_ref_weak_def_1.o: strong_ref_weak_def_1.c | |
2798 | $(COMPILE) -o $@ -c -fPIC $< | |
2799 | strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \ | |
2800 | gcctestdir/ld | |
2801 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \ | |
2802 | strong_ref_weak_def_2.so | |
2803 | strong_ref_weak_def.stdout: strong_ref_weak_def_1.so | |
2804 | $(TEST_READELF) -sWD $< > $@ | |
2805 | ||
a4649286 DK |
2806 | # Test that a strong weak reference remains strong if there is another |
2807 | # weak reference in a DSO. | |
2808 | check_SCRIPTS += dyn_weak_ref.sh | |
2809 | check_DATA += dyn_weak_ref.stdout | |
2810 | MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \ | |
2811 | dyn_weak_ref.stdout | |
2812 | dyn_weak_ref_2.o: dyn_weak_ref_2.c | |
2813 | $(COMPILE) -o $@ -c -fPIC $< | |
2814 | dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld | |
2815 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o | |
2816 | dyn_weak_ref_1.o: dyn_weak_ref_1.c | |
2817 | $(COMPILE) -o $@ -c -fPIC $< | |
2818 | # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o | |
2819 | # so that the weak ref there goes to gold's symbol table first. | |
2820 | dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld | |
2821 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o | |
2822 | dyn_weak_ref.stdout: dyn_weak_ref_1.so | |
2823 | $(TEST_READELF) -sWD $< > $@ | |
2824 | ||
2825 | ||
97b4be1c CC |
2826 | # Test that --start-lib and --end-lib function correctly. |
2827 | check_PROGRAMS += start_lib_test | |
0ec6429b | 2828 | MOSTLYCLEANFILES += libstart_lib_test.a |
97b4be1c CC |
2829 | start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \ |
2830 | gcctestdir/ld | |
2831 | $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \ | |
2832 | -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib | |
2833 | libstart_lib_test.a: start_lib_test_1.o | |
2834 | $(TEST_AR) rc $@ $^ | |
2835 | ||
7f8cd844 NC |
2836 | # Test that MEMORY region support works. |
2837 | check_SCRIPTS += memory_test.sh | |
2838 | check_DATA += memory_test.stdout | |
2839 | MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o | |
d4d91489 ILT |
2840 | memory_test.o: memory_test.s |
2841 | $(COMPILE) -o $@ -c $< | |
2842 | memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t | |
068e05ba | 2843 | $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-z,common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o |
7f8cd844 | 2844 | memory_test.stdout: memory_test |
41a8542a | 2845 | $(TEST_READELF) -lWS $< > $@ |
7f8cd844 | 2846 | |
410da591 CC |
2847 | # Test INCLUDE directives in linker scripts. |
2848 | # The binary isn't runnable, so we just check that we can build it without errors. | |
2849 | check_DATA += memory_test_2 | |
0863441e | 2850 | MOSTLYCLEANFILES += memory_test_inc_1.t memory_test_inc_2.t memory_test_inc_3.t memory_test_2 |
410da591 CC |
2851 | memory_test_inc_1.t: $(srcdir)/memory_test_inc_1.t.src |
2852 | cp $< $@ | |
2853 | memory_test_inc_2.t: $(srcdir)/memory_test_inc_2.t.src | |
2854 | cp $< $@ | |
2855 | memory_test_inc_3.t: $(srcdir)/memory_test_inc_3.t.src | |
2856 | cp $< $@ | |
2857 | 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 | |
068e05ba | 2858 | $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-z,common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o |
410da591 | 2859 | |
f1415016 CC |
2860 | if HAVE_PUBNAMES |
2861 | ||
2862 | # Test that --gdb-index functions correctly without gcc-generated pubnames. | |
c1027032 CC |
2863 | check_SCRIPTS += gdb_index_test_1.sh |
2864 | check_DATA += gdb_index_test_1.stdout | |
2865 | MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1 | |
2866 | gdb_index_test.o: gdb_index_test.cc | |
f1415016 | 2867 | $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $< |
c1027032 CC |
2868 | gdb_index_test_1: gdb_index_test.o gcctestdir/ld |
2869 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2870 | gdb_index_test_1.stdout: gdb_index_test_1 | |
2871 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2872 | ||
f1415016 | 2873 | # Test that --gdb-index functions correctly with compressed debug sections. |
c1027032 CC |
2874 | check_SCRIPTS += gdb_index_test_2.sh |
2875 | check_DATA += gdb_index_test_2.stdout | |
0863441e | 2876 | MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 gdb_index_test_2_gabi |
c1027032 CC |
2877 | gdb_index_test_cdebug.o: gdb_index_test.cc |
2878 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $< | |
2879 | gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld | |
2880 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2881 | gdb_index_test_2.stdout: gdb_index_test_2 | |
2882 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
48058663 L |
2883 | check_SCRIPTS += gdb_index_test_2_gabi.sh |
2884 | check_DATA += gdb_index_test_2_gabi.stdout | |
2885 | MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 | |
2886 | gdb_index_test_cdebug_gabi.o: gdb_index_test.cc | |
2887 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -o $@ $< | |
2888 | gdb_index_test_2_gabi: gdb_index_test_cdebug_gabi.o gcctestdir/ld | |
2889 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2890 | gdb_index_test_2_gabi.stdout: gdb_index_test_2_gabi | |
2891 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
c1027032 | 2892 | |
f1415016 | 2893 | # Another simple C test (DW_AT_high_pc encoding) for --gdb-index. |
57923f48 MW |
2894 | check_SCRIPTS += gdb_index_test_3.sh |
2895 | check_DATA += gdb_index_test_3.stdout | |
2896 | MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3 | |
2897 | gdb_index_test_3.o: gdb_index_test_3.c | |
2898 | $(COMPILE) -O0 -g -c -o $@ $< | |
2899 | gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld | |
2900 | $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $< | |
2901 | gdb_index_test_3.stdout: gdb_index_test_3 | |
2902 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2903 | ||
f1415016 CC |
2904 | # Test that --gdb-index functions correctly with gcc-generated pubnames. |
2905 | check_SCRIPTS += gdb_index_test_4.sh | |
2906 | check_DATA += gdb_index_test_4.stdout | |
2907 | MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4 | |
2908 | gdb_index_test_pub.o: gdb_index_test.cc | |
2909 | $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $< | |
2910 | gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld | |
2911 | $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< | |
2912 | gdb_index_test_4.stdout: gdb_index_test_4 | |
2913 | $(TEST_READELF) --debug-dump=gdb_index $< > $@ | |
2914 | ||
2915 | endif HAVE_PUBNAMES | |
57923f48 | 2916 | |
d1bddd3c CC |
2917 | # Test that __ehdr_start is defined correctly. |
2918 | check_PROGRAMS += ehdr_start_test_1 | |
2919 | ehdr_start_test_1_SOURCES = ehdr_start_test.cc | |
2920 | ehdr_start_test_1_DEPENDENCIES = gcctestdir/ld | |
2921 | ehdr_start_test_1_CXXFLAGS = | |
2922 | ehdr_start_test_1_LDFLAGS = -Bgcctestdir/ | |
2923 | ehdr_start_test_1_LDADD = | |
2924 | ||
2925 | # Test that __ehdr_start is defined correctly with a weak reference. | |
2926 | check_PROGRAMS += ehdr_start_test_2 | |
2927 | ehdr_start_test_2_SOURCES = ehdr_start_test.cc | |
2928 | ehdr_start_test_2_DEPENDENCIES = gcctestdir/ld | |
2929 | ehdr_start_test_2_CXXFLAGS = -DEHDR_START_WEAK | |
2930 | ehdr_start_test_2_LDFLAGS = -Bgcctestdir/ | |
2931 | ehdr_start_test_2_LDADD = | |
2932 | ||
2933 | # Test that __ehdr_start is defined correctly when used with a linker script. | |
2934 | check_PROGRAMS += ehdr_start_test_3 | |
2935 | ehdr_start_test_3_SOURCES = ehdr_start_test.cc | |
2936 | ehdr_start_test_3_DEPENDENCIES = gcctestdir/ld $(srcdir)/ehdr_start_test.t | |
2937 | ehdr_start_test_3_CXXFLAGS = -DEHDR_START_WEAK | |
2938 | ehdr_start_test_3_LDFLAGS = -Bgcctestdir/ -Wl,-T,$(srcdir)/ehdr_start_test.t | |
2939 | ehdr_start_test_3_LDADD = | |
2940 | ||
2941 | # Test that __ehdr_start is left undefined when the text segment is not | |
2942 | # appropriately aligned. | |
2943 | check_SCRIPTS += ehdr_start_test_4.sh | |
2944 | check_DATA += ehdr_start_test_4.syms | |
2945 | MOSTLYCLEANFILES += ehdr_start_test_4 | |
2946 | ehdr_start_test_4.syms: ehdr_start_test_4 | |
2947 | $(TEST_NM) ehdr_start_test_4 > $@ | |
2948 | ehdr_start_test_4: ehdr_start_test_4.o gcctestdir/ld | |
f6fb8322 | 2949 | $(CXXLINK) -Bgcctestdir/ -Wl,-Ttext=0x100100 $< |
d1bddd3c CC |
2950 | ehdr_start_test_4.o: ehdr_start_test.cc |
2951 | $(CXXCOMPILE) -c -DEHDR_START_WEAK -o $@ $< | |
2952 | ||
2953 | # Test that __ehdr_start is not overridden when supplied by the user. | |
2954 | check_PROGRAMS += ehdr_start_test_5 | |
2955 | ehdr_start_test_5_SOURCES = ehdr_start_test.cc ehdr_start_def.cc | |
2956 | ehdr_start_test_5_DEPENDENCIES = gcctestdir/ld | |
2957 | ehdr_start_test_5_CXXFLAGS = -DEHDR_START_USER_DEF | |
2958 | ehdr_start_test_5_LDFLAGS = -Bgcctestdir/ | |
2959 | ehdr_start_test_5_LDADD = | |
2960 | ||
e051745c CC |
2961 | # Test that the --defsym option copies the symbol type and visibility. |
2962 | check_SCRIPTS += defsym_test.sh | |
2963 | check_DATA += defsym_test.syms | |
dddcc5b9 | 2964 | MOSTLYCLEANFILES += defsym_test defsym_test.syms |
e051745c CC |
2965 | defsym_test.syms: defsym_test |
2966 | $(TEST_READELF) -sW $< > $@ | |
2967 | defsym_test: defsym_test.o gcctestdir/ld | |
2968 | $(LINK) -Bgcctestdir/ -Wl,--defsym=bar=foo defsym_test.o | |
2969 | defsym_test.o: defsym_test.c | |
2970 | $(COMPILE) -c -o $@ $< | |
2971 | ||
89ede9f5 CC |
2972 | # Test that the -d option (force common allocation) works correctly. |
2973 | check_PROGRAMS += pr20976 | |
2974 | pr20976: pr20976-d.o gcctestdir/ld | |
2975 | $(LINK) -Bgcctestdir/ pr20976-d.o | |
2976 | pr20976-d.o: pr20976.o gcctestdir/ld | |
2977 | gcctestdir/ld -r -d -o $@ pr20976.o | |
2978 | ||
2eedd706 CC |
2979 | # End-to-end incremental linking tests. |
2980 | # Incremental linking is currently supported only on the x86_64 target. | |
2981 | ||
2982 | if DEFAULT_TARGET_X86_64 | |
2983 | ||
33c15b45 CC |
2984 | two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc |
2985 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2986 | two_file_test_1_ndebug.o: two_file_test_1.cc | |
2987 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2988 | two_file_test_1b_ndebug.o: two_file_test_1b.cc | |
2989 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2990 | two_file_test_2_ndebug.o: two_file_test_2.cc | |
2991 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2992 | two_file_test_main_ndebug.o: two_file_test_main.cc | |
2993 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< | |
2994 | ||
2eedd706 | 2995 | check_PROGRAMS += incremental_test_2 |
c49875be | 2996 | MOSTLYCLEANFILES += two_file_test_tmp_2.o |
33c15b45 CC |
2997 | incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \ |
2998 | two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld | |
2999 | cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o | |
943c8b43 | 3000 | $(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 | 3001 | @sleep 1 |
33c15b45 | 3002 | cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o |
943c8b43 | 3003 | $(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 |
3004 | |
3005 | check_PROGRAMS += incremental_test_3 | |
c49875be | 3006 | MOSTLYCLEANFILES += two_file_test_tmp_3.o |
2eedd706 CC |
3007 | incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ |
3008 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
c49875be | 3009 | cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o |
943c8b43 | 3010 | $(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 | 3011 | @sleep 1 |
c49875be | 3012 | cp -f two_file_test_1b.o two_file_test_tmp_3.o |
943c8b43 | 3013 | $(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 |
3014 | |
3015 | check_PROGRAMS += incremental_test_4 | |
c49875be | 3016 | MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o |
2eedd706 CC |
3017 | incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ |
3018 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
c49875be | 3019 | cp -f two_file_test_2_v1.o two_file_test_tmp_4.o |
943c8b43 | 3020 | $(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 | 3021 | mv -f incremental_test_4 incremental_test_4.base |
2eedd706 | 3022 | @sleep 1 |
c49875be | 3023 | cp -f two_file_test_2.o two_file_test_tmp_4.o |
943c8b43 | 3024 | $(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 | 3025 | |
e24719f6 CC |
3026 | check_PROGRAMS += incremental_test_5 |
3027 | MOSTLYCLEANFILES += two_file_test_5.a | |
3028 | incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
3029 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
3030 | cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o | |
3031 | $(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 | 3032 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a |
e24719f6 CC |
3033 | @sleep 1 |
3034 | cp -f two_file_test_1b.o two_file_test_tmp_5.o | |
3035 | $(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 | 3036 | $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a |
e24719f6 CC |
3037 | |
3038 | # Test the --incremental-unchanged flag with an archive library. | |
3039 | # The second link should not update the library. | |
3040 | check_PROGRAMS += incremental_test_6 | |
3041 | MOSTLYCLEANFILES += two_file_test_6.a | |
3042 | incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ | |
3043 | two_file_test_2.o two_file_test_main.o gcctestdir/ld | |
3044 | cp -f two_file_test_1b.o two_file_test_tmp_6.o | |
3045 | $(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 | 3046 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_6.a |
e24719f6 CC |
3047 | @sleep 1 |
3048 | cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o | |
3049 | $(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 | 3050 | $(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 | 3051 | |
a5ee4d5d CC |
3052 | check_PROGRAMS += incremental_copy_test |
3053 | incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so | |
3054 | cp -f copy_test_v1.o copy_test_tmp.o | |
943c8b43 | 3055 | $(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 |
3056 | @sleep 1 |
3057 | cp -f copy_test.o copy_test_tmp.o | |
943c8b43 | 3058 | $(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 |
3059 | |
3060 | check_PROGRAMS += incremental_common_test_1 | |
3061 | incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld | |
3062 | cp -f common_test_1_v1.o common_test_1_tmp.o | |
943c8b43 | 3063 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o |
a5ee4d5d CC |
3064 | @sleep 1 |
3065 | cp -f common_test_1_v2.o common_test_1_tmp.o | |
943c8b43 | 3066 | $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o |
a5ee4d5d | 3067 | |
1206d0d5 CC |
3068 | check_PROGRAMS += incremental_comdat_test_1 |
3069 | 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 | |
3070 | cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o | |
943c8b43 | 3071 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o |
1206d0d5 CC |
3072 | @sleep 1 |
3073 | cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o | |
943c8b43 | 3074 | $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o |
1206d0d5 CC |
3075 | @sleep 1 |
3076 | cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o | |
943c8b43 | 3077 | $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o |
1206d0d5 | 3078 | |
2eedd706 CC |
3079 | endif DEFAULT_TARGET_X86_64 |
3080 | ||
f49fe902 L |
3081 | if DEFAULT_TARGET_X86_64 |
3082 | check_PROGRAMS += exception_x86_64_bnd_test | |
3083 | exception_x86_64_bnd_test_SOURCES = exception_test_main.cc | |
635aa30e | 3084 | exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o |
7a0c0a14 | 3085 | exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -Wl,-z,bndplt |
635aa30e | 3086 | exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o |
0c075858 | 3087 | exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as |
f49fe902 | 3088 | $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< |
0c075858 | 3089 | exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as |
f49fe902 L |
3090 | $(CXXCOMPILE) -c -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< |
3091 | endif DEFAULT_TARGET_X86_64 | |
3092 | ||
351a8000 ILT |
3093 | endif GCC |
3094 | endif NATIVE_LINKER | |
364c7fa5 | 3095 | |
eb373049 ILT |
3096 | # These tests work with native and cross linkers. |
3097 | ||
3098 | if NATIVE_OR_CROSS_LINKER | |
3099 | ||
3100 | # Test script section order. | |
3101 | check_SCRIPTS += script_test_10.sh | |
3102 | check_DATA += script_test_10.stdout | |
0ec6429b | 3103 | MOSTLYCLEANFILES += script_test_10 |
eb373049 ILT |
3104 | script_test_10.o: script_test_10.s |
3105 | $(TEST_AS) -o $@ $< | |
3106 | script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld | |
52dc3f9c | 3107 | gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t |
eb373049 ILT |
3108 | script_test_10.stdout: script_test_10 |
3109 | $(TEST_READELF) -SW script_test_10 > $@ | |
3110 | ||
3111 | # These tests work with cross linkers only. | |
364c7fa5 ILT |
3112 | |
3113 | if DEFAULT_TARGET_I386 | |
3114 | ||
3115 | check_SCRIPTS += split_i386.sh | |
3116 | check_DATA += split_i386_1.stdout split_i386_2.stdout \ | |
3117 | split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout | |
3118 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
3119 | split_i386_1.o: split_i386_1.s | |
3120 | $(TEST_AS) -o $@ $< | |
3121 | split_i386_2.o: split_i386_2.s | |
3122 | $(TEST_AS) -o $@ $< | |
3123 | split_i386_3.o: split_i386_3.s | |
3124 | $(TEST_AS) -o $@ $< | |
3125 | split_i386_4.o: split_i386_4.s | |
3126 | $(TEST_AS) -o $@ $< | |
3127 | split_i386_n.o: split_i386_n.s | |
3128 | $(TEST_AS) -o $@ $< | |
3129 | split_i386_1: split_i386_1.o split_i386_n.o ../ld-new | |
3130 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o | |
3131 | split_i386_1.stdout: split_i386_1 | |
3132 | $(TEST_OBJDUMP) -d $< > $@ | |
3133 | split_i386_2: split_i386_2.o split_i386_n.o ../ld-new | |
3134 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o | |
3135 | split_i386_2.stdout: split_i386_2 | |
3136 | $(TEST_OBJDUMP) -d $< > $@ | |
3137 | split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new | |
3138 | ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0 | |
3139 | split_i386_4: split_i386_4.o split_i386_n.o ../ld-new | |
3140 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o | |
3141 | split_i386_4.stdout: split_i386_4 | |
3142 | $(TEST_OBJDUMP) -d $< > $@ | |
3143 | split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new | |
3144 | ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0 | |
3145 | MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \ | |
3146 | split_i386_4 split_i386_r | |
3147 | ||
3148 | endif DEFAULT_TARGET_I386 | |
3149 | ||
3150 | if DEFAULT_TARGET_X86_64 | |
3151 | ||
3152 | check_SCRIPTS += split_x86_64.sh | |
3153 | check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \ | |
3154 | split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout | |
3155 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
3156 | split_x86_64_1.o: split_x86_64_1.s | |
3157 | $(TEST_AS) -o $@ $< | |
3158 | split_x86_64_2.o: split_x86_64_2.s | |
3159 | $(TEST_AS) -o $@ $< | |
3160 | split_x86_64_3.o: split_x86_64_3.s | |
3161 | $(TEST_AS) -o $@ $< | |
3162 | split_x86_64_4.o: split_x86_64_4.s | |
3163 | $(TEST_AS) -o $@ $< | |
3164 | split_x86_64_n.o: split_x86_64_n.s | |
3165 | $(TEST_AS) -o $@ $< | |
3166 | split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
3167 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o | |
3168 | split_x86_64_1.stdout: split_x86_64_1 | |
3169 | $(TEST_OBJDUMP) -d $< > $@ | |
3170 | split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new | |
3171 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o | |
3172 | split_x86_64_2.stdout: split_x86_64_2 | |
3173 | $(TEST_OBJDUMP) -d $< > $@ | |
3174 | split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new | |
3175 | ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0 | |
3176 | split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new | |
3177 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o | |
3178 | split_x86_64_4.stdout: split_x86_64_4 | |
3179 | $(TEST_OBJDUMP) -d $< > $@ | |
3180 | split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new | |
3181 | ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 | |
3182 | MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ | |
3183 | split_x86_64_4 split_x86_64_r | |
3184 | ||
7a0c0a14 CC |
3185 | check_SCRIPTS += bnd_plt_1.sh |
3186 | check_DATA += bnd_plt_1.stdout | |
3187 | bnd_plt_1.o: bnd_plt_1.s | |
3188 | $(TEST_AS) --64 -o $@ $< | |
3189 | bnd_plt_1.so: bnd_plt_1.o ../ld-new | |
3190 | ../ld-new -shared -z bndplt bnd_plt_1.o -o $@ | |
3191 | bnd_plt_1.stdout: bnd_plt_1.so | |
3192 | $(TEST_OBJDUMP) -dw $< > $@ | |
3193 | ||
3194 | check_SCRIPTS += bnd_ifunc_1.sh | |
3195 | check_DATA += bnd_ifunc_1.stdout | |
3196 | bnd_ifunc_1.o: bnd_ifunc_1.s | |
3197 | $(TEST_AS) --64 -madd-bnd-prefix -o $@ $< | |
3198 | bnd_ifunc_1.so: bnd_ifunc_1.o ../ld-new | |
3199 | ../ld-new -shared -z bndplt bnd_ifunc_1.o -o $@ | |
3200 | bnd_ifunc_1.stdout: bnd_ifunc_1.so | |
3201 | $(TEST_OBJDUMP) -dw $< > $@ | |
3202 | ||
3203 | check_SCRIPTS += bnd_ifunc_2.sh | |
3204 | check_DATA += bnd_ifunc_2.stdout | |
3205 | bnd_ifunc_2.o: bnd_ifunc_2.s | |
3206 | $(TEST_AS) --64 -madd-bnd-prefix -o $@ $< | |
3207 | bnd_ifunc_2.so: bnd_ifunc_2.o ../ld-new | |
3208 | ../ld-new -shared -z bndplt bnd_ifunc_2.o -o $@ | |
3209 | bnd_ifunc_2.stdout: bnd_ifunc_2.so | |
3210 | $(TEST_OBJDUMP) -dw $< > $@ | |
3211 | ||
364c7fa5 | 3212 | endif DEFAULT_TARGET_X86_64 |
e4782e83 | 3213 | |
4fc1b9d4 L |
3214 | if DEFAULT_TARGET_X32 |
3215 | ||
3216 | check_SCRIPTS += split_x32.sh | |
3217 | check_DATA += split_x32_1.stdout split_x32_2.stdout \ | |
3218 | split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout | |
3219 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
3220 | split_x32_1.o: split_x32_1.s | |
3221 | $(TEST_AS) -o $@ $< | |
3222 | split_x32_2.o: split_x32_2.s | |
3223 | $(TEST_AS) -o $@ $< | |
3224 | split_x32_3.o: split_x32_3.s | |
3225 | $(TEST_AS) -o $@ $< | |
3226 | split_x32_4.o: split_x32_4.s | |
3227 | $(TEST_AS) -o $@ $< | |
3228 | split_x32_n.o: split_x32_n.s | |
3229 | $(TEST_AS) -o $@ $< | |
3230 | split_x32_1: split_x32_1.o split_x32_n.o ../ld-new | |
3231 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_1.o split_x32_n.o | |
3232 | split_x32_1.stdout: split_x32_1 | |
3233 | $(TEST_OBJDUMP) -d $< > $@ | |
3234 | split_x32_2: split_x32_2.o split_x32_n.o ../ld-new | |
3235 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_2.o split_x32_n.o | |
3236 | split_x32_2.stdout: split_x32_2 | |
3237 | $(TEST_OBJDUMP) -d $< > $@ | |
3238 | split_x32_3.stdout: split_x32_3.o split_x32_n.o ../ld-new | |
3239 | ../ld-new $(SPLIT_DEFSYMS) -o split_x32_3 split_x32_3.o split_x32_n.o > $@ 2>&1 || exit 0 | |
3240 | split_x32_4: split_x32_4.o split_x32_n.o ../ld-new | |
3241 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_4.o split_x32_n.o | |
3242 | split_x32_4.stdout: split_x32_4 | |
3243 | $(TEST_OBJDUMP) -d $< > $@ | |
3244 | split_x32_r.stdout: split_x32_1.o split_x32_n.o ../ld-new | |
3245 | ../ld-new -r split_x32_1.o split_x32_n.o -o split_x32_r > $@ 2>&1 || exit 0 | |
3246 | MOSTLYCLEANFILES += split_x32_1 split_x32_2 split_x32_3 \ | |
3247 | split_x32_4 split_x32_r | |
3248 | ||
3249 | endif DEFAULT_TARGET_X32 | |
3250 | ||
e4782e83 DK |
3251 | if DEFAULT_TARGET_ARM |
3252 | ||
3253 | check_SCRIPTS += arm_abs_global.sh | |
3254 | check_DATA += arm_abs_global.stdout | |
3255 | arm_abs_lib.o: arm_abs_lib.s | |
3256 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 3257 | libarm_abs.so: arm_abs_lib.o ../ld-new |
e4782e83 DK |
3258 | ../ld-new -shared -o $@ arm_abs_lib.o |
3259 | arm_abs_global.o: arm_abs_global.s | |
3260 | $(TEST_AS) -march=armv7-a -o $@ $< | |
d3bbad62 | 3261 | arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new |
e4782e83 DK |
3262 | ../ld-new -o $@ arm_abs_global.o -L. -larm_abs |
3263 | arm_abs_global.stdout: arm_abs_global | |
3264 | $(TEST_READELF) -r $< > $@ | |
3265 | ||
3266 | MOSTLYCLEANFILES += arm_abs_global | |
3267 | ||
aa98ff75 | 3268 | check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh |
2a2b6d42 DK |
3269 | check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \ |
3270 | thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \ | |
a2c7281b DK |
3271 | thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \ |
3272 | thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \ | |
aa98ff75 | 3273 | thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \ |
57eb9b50 DK |
3274 | thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \ |
3275 | arm_thm_jump8.stdout | |
2a2b6d42 DK |
3276 | |
3277 | arm_bl_in_range.stdout: arm_bl_in_range | |
3278 | $(TEST_OBJDUMP) -D $< > $@ | |
3279 | ||
d3bbad62 | 3280 | arm_bl_in_range: arm_bl_in_range.o ../ld-new |
52dc3f9c | 3281 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
2a2b6d42 DK |
3282 | |
3283 | arm_bl_in_range.o: arm_bl_in_range.s | |
3284 | $(TEST_AS) -o $@ $< | |
3285 | ||
3286 | arm_bl_out_of_range.stdout: arm_bl_out_of_range | |
3287 | $(TEST_OBJDUMP) -S $< > $@ | |
3288 | ||
d3bbad62 | 3289 | arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new |
52dc3f9c | 3290 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
2a2b6d42 DK |
3291 | |
3292 | arm_bl_out_of_range.o: arm_bl_out_of_range.s | |
3293 | $(TEST_AS) -o $@ $< | |
3294 | ||
3295 | thumb_bl_in_range.stdout: thumb_bl_in_range | |
3296 | $(TEST_OBJDUMP) -D $< > $@ | |
3297 | ||
d3bbad62 | 3298 | thumb_bl_in_range: thumb_bl_in_range.o ../ld-new |
52dc3f9c | 3299 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2a2b6d42 DK |
3300 | |
3301 | thumb_bl_in_range.o: thumb_bl_in_range.s | |
3302 | $(TEST_AS) -o $@ -march=armv5te $< | |
3303 | ||
3304 | thumb_bl_out_of_range.stdout: thumb_bl_out_of_range | |
3305 | $(TEST_OBJDUMP) -D $< > $@ | |
3306 | ||
a2c7281b | 3307 | thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new |
52dc3f9c | 3308 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
2a2b6d42 | 3309 | |
a2c7281b | 3310 | thumb_bl_out_of_range.o: thumb_bl_out_of_range.s |
2a2b6d42 DK |
3311 | $(TEST_AS) -o $@ -march=armv5te $< |
3312 | ||
3313 | thumb2_bl_in_range.stdout: thumb2_bl_in_range | |
3314 | $(TEST_OBJDUMP) -D $< > $@ | |
3315 | ||
d3bbad62 | 3316 | thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new |
52dc3f9c | 3317 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2a2b6d42 DK |
3318 | |
3319 | thumb2_bl_in_range.o: thumb_bl_in_range.s | |
3320 | $(TEST_AS) -o $@ -march=armv7-a $< | |
3321 | ||
3322 | thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range | |
3323 | $(TEST_OBJDUMP) -D $< > $@ | |
3324 | ||
a2c7281b | 3325 | thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new |
52dc3f9c | 3326 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
2a2b6d42 | 3327 | |
a2c7281b DK |
3328 | thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s |
3329 | $(TEST_AS) -o $@ -march=armv7-a $< | |
3330 | ||
3331 | thumb_blx_in_range.stdout: thumb_blx_in_range | |
3332 | $(TEST_OBJDUMP) -D $< > $@ | |
3333 | ||
3334 | thumb_blx_in_range: thumb_blx_in_range.o ../ld-new | |
52dc3f9c | 3335 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
a2c7281b DK |
3336 | |
3337 | thumb_blx_in_range.o: thumb_blx_in_range.s | |
3338 | $(TEST_AS) -o $@ -march=armv5te $< | |
3339 | ||
3340 | thumb_blx_out_of_range.stdout: thumb_blx_out_of_range | |
3341 | $(TEST_OBJDUMP) -D $< > $@ | |
3342 | ||
3343 | thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new | |
52dc3f9c | 3344 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
a2c7281b DK |
3345 | |
3346 | thumb_blx_out_of_range.o: thumb_blx_out_of_range.s | |
3347 | $(TEST_AS) -o $@ -march=armv5te $< | |
3348 | ||
3349 | thumb2_blx_in_range.stdout: thumb2_blx_in_range | |
3350 | $(TEST_OBJDUMP) -D $< > $@ | |
3351 | ||
3352 | thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new | |
52dc3f9c | 3353 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
a2c7281b DK |
3354 | |
3355 | thumb2_blx_in_range.o: thumb_blx_in_range.s | |
3356 | $(TEST_AS) -o $@ -march=armv7-a $< | |
3357 | ||
3358 | thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range | |
3359 | $(TEST_OBJDUMP) -D $< > $@ | |
3360 | ||
3361 | thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new | |
52dc3f9c | 3362 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
a2c7281b DK |
3363 | |
3364 | thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s | |
2a2b6d42 DK |
3365 | $(TEST_AS) -o $@ -march=armv7-a $< |
3366 | ||
aa98ff75 DK |
3367 | thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local |
3368 | $(TEST_OBJDUMP) -D $< > $@ | |
3369 | ||
3370 | thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new | |
52dc3f9c | 3371 | ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $< |
aa98ff75 DK |
3372 | |
3373 | thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s | |
3374 | $(TEST_AS) -o $@ -march=armv5te $< | |
3375 | ||
57eb9b50 DK |
3376 | arm_thm_jump11.stdout: arm_thm_jump11 |
3377 | $(TEST_OBJDUMP) -D $< > $@ | |
3378 | ||
3379 | arm_thm_jump11: arm_thm_jump11.o ../ld-new | |
52dc3f9c | 3380 | ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $< |
57eb9b50 DK |
3381 | |
3382 | arm_thm_jump11.o: arm_thm_jump11.s | |
3383 | $(TEST_AS) -o $@ $< | |
3384 | ||
3385 | arm_thm_jump8.stdout: arm_thm_jump8 | |
3386 | $(TEST_OBJDUMP) -D $< > $@ | |
3387 | ||
3388 | arm_thm_jump8: arm_thm_jump8.o ../ld-new | |
52dc3f9c | 3389 | ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $< |
57eb9b50 DK |
3390 | |
3391 | arm_thm_jump8.o: arm_thm_jump8.s | |
3392 | $(TEST_AS) -o $@ $< | |
3393 | ||
2a2b6d42 | 3394 | MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \ |
a2c7281b DK |
3395 | thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \ |
3396 | thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \ | |
57eb9b50 DK |
3397 | thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \ |
3398 | arm_thm_jump8 | |
2a2b6d42 | 3399 | |
2fd9ae7a DK |
3400 | check_SCRIPTS += arm_fix_v4bx.sh |
3401 | check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \ | |
3402 | arm_no_fix_v4bx.stdout | |
3403 | ||
3404 | arm_fix_v4bx.stdout: arm_fix_v4bx | |
3405 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3406 | ||
d3bbad62 | 3407 | arm_fix_v4bx: arm_fix_v4bx.o ../ld-new |
a8e2273b | 3408 | ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $< |
2fd9ae7a DK |
3409 | |
3410 | arm_fix_v4bx.o: arm_fix_v4bx.s | |
3411 | $(TEST_AS) -o $@ $< | |
3412 | ||
3413 | arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking | |
3414 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3415 | ||
d3bbad62 | 3416 | arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new |
a8e2273b | 3417 | ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $< |
2fd9ae7a DK |
3418 | |
3419 | arm_no_fix_v4bx.stdout: arm_no_fix_v4bx | |
3420 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3421 | ||
d3bbad62 | 3422 | arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new |
a8e2273b | 3423 | ../ld-new --no-fix-arm1176 -o $@ $< |
2fd9ae7a DK |
3424 | |
3425 | MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx | |
3426 | ||
da59ad79 DK |
3427 | check_SCRIPTS += arm_attr_merge.sh |
3428 | check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \ | |
3429 | arm_attr_merge_7.stdout | |
3430 | ||
3431 | arm_attr_merge_6.stdout: arm_attr_merge_6 | |
3432 | $(TEST_READELF) -A $< > $@ | |
3433 | ||
78d9f182 | 3434 | arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o ../ld-new |
da59ad79 DK |
3435 | ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o |
3436 | ||
3437 | arm_attr_merge_6a.o: arm_attr_merge_6a.s | |
3438 | $(TEST_AS) -o $@ $< | |
3439 | ||
3440 | arm_attr_merge_6b.o: arm_attr_merge_6b.s | |
3441 | $(TEST_AS) -o $@ $< | |
3442 | ||
3443 | arm_attr_merge_6r.stdout: arm_attr_merge_6r | |
3444 | $(TEST_READELF) -A $< > $@ | |
3445 | ||
78d9f182 | 3446 | arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o ../ld-new |
da59ad79 DK |
3447 | ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o |
3448 | ||
3449 | arm_attr_merge_7.stdout: arm_attr_merge_7 | |
3450 | $(TEST_READELF) -A $< > $@ | |
3451 | ||
78d9f182 | 3452 | arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o ../ld-new |
da59ad79 DK |
3453 | ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o |
3454 | ||
3455 | arm_attr_merge_7a.o: arm_attr_merge_7a.s | |
3456 | $(TEST_AS) -o $@ $< | |
3457 | ||
3458 | arm_attr_merge_7b.o: arm_attr_merge_7b.s | |
3459 | $(TEST_AS) -o $@ $< | |
3460 | ||
3461 | MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7 | |
3462 | ||
a8e2273b ILT |
3463 | # ARM1176 workaround test. |
3464 | check_SCRIPTS += arm_fix_1176.sh | |
3465 | check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \ | |
3466 | arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \ | |
3467 | arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout | |
3468 | ||
3469 | arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z | |
3470 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
3471 | ||
3472 | arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new | |
3473 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
3474 | ||
3475 | arm_fix_1176_default_v6z.o: arm_fix_1176.s | |
3476 | $(TEST_AS) -march=armv6z -o $@ $< | |
3477 | ||
3478 | arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z | |
3479 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
3480 | ||
3481 | arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new | |
3482 | ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $< | |
3483 | ||
3484 | arm_fix_1176_on_v6z.o: arm_fix_1176.s | |
3485 | $(TEST_AS) -march=armv6z -o $@ $< | |
3486 | ||
3487 | arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z | |
3488 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
3489 | ||
3490 | arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new | |
3491 | ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $< | |
3492 | ||
3493 | arm_fix_1176_off_v6z.o: arm_fix_1176.s | |
3494 | $(TEST_AS) -march=armv6z -o $@ $< | |
3495 | ||
3496 | arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te | |
3497 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
3498 | ||
3499 | arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new | |
3500 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
3501 | ||
3502 | arm_fix_1176_default_v5te.o: arm_fix_1176.s | |
3503 | $(TEST_AS) -march=armv5te -o $@ $< | |
3504 | ||
3505 | arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a | |
3506 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
3507 | ||
3508 | arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new | |
3509 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
3510 | ||
3511 | arm_fix_1176_default_v7a.o: arm_fix_1176.s | |
3512 | $(TEST_AS) -march=armv7-a -o $@ $< | |
3513 | ||
3514 | arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s | |
3515 | $(TEST_OBJDUMP) -D -j.foo $< > $@ | |
3516 | ||
3517 | arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new | |
3518 | ../ld-new --section-start=.foo=0x2001014 -o $@ $< | |
3519 | ||
3520 | arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s | |
3521 | $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $< | |
3522 | ||
3523 | MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \ | |
3524 | arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s | |
3525 | ||
aa98ff75 DK |
3526 | # Cortex-A8 workaround test. |
3527 | ||
3528 | check_SCRIPTS += arm_cortex_a8.sh | |
3529 | check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \ | |
3530 | arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \ | |
3531 | arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout | |
3532 | ||
3533 | arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond | |
3534 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3535 | ||
3536 | arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new | |
3537 | ../ld-new -o $@ $< | |
3538 | ||
3539 | arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s | |
3540 | $(TEST_AS) -o $@ $< | |
3541 | ||
3542 | arm_cortex_a8_b.stdout: arm_cortex_a8_b | |
3543 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3544 | ||
3545 | arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new | |
3546 | ../ld-new --fix-cortex-a8 -o $@ $< | |
3547 | ||
3548 | arm_cortex_a8_b.o: arm_cortex_a8_b.s | |
3549 | $(TEST_AS) -o $@ $< | |
3550 | ||
3551 | arm_cortex_a8_bl.stdout: arm_cortex_a8_bl | |
3552 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3553 | ||
3554 | arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new | |
3555 | ../ld-new -o $@ $< | |
3556 | ||
3557 | arm_cortex_a8_bl.o: arm_cortex_a8_bl.s | |
3558 | $(TEST_AS) -o $@ $< | |
3559 | ||
3560 | arm_cortex_a8_blx.stdout: arm_cortex_a8_blx | |
3561 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3562 | ||
3563 | arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new | |
3564 | ../ld-new -o $@ $< | |
3565 | ||
3566 | arm_cortex_a8_blx.o: arm_cortex_a8_blx.s | |
3567 | $(TEST_AS) -o $@ $< | |
3568 | ||
3569 | arm_cortex_a8_local.stdout: arm_cortex_a8_local | |
3570 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3571 | ||
3572 | arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new | |
3573 | ../ld-new -o $@ $< | |
3574 | ||
3575 | arm_cortex_a8_local.o: arm_cortex_a8_local.s | |
3576 | $(TEST_AS) -o $@ $< | |
3577 | ||
3578 | arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc | |
3579 | $(TEST_OBJDUMP) -D -j.text $< > $@ | |
3580 | ||
3581 | arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new | |
3582 | ../ld-new -o $@ $< | |
3583 | ||
3584 | arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s | |
3585 | $(TEST_AS) -o $@ $< | |
3586 | ||
3587 | MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \ | |
3588 | arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc | |
3589 | ||
c87e4302 DK |
3590 | check_SCRIPTS += arm_exidx_test.sh |
3591 | check_DATA += arm_exidx_test.stdout | |
3592 | ||
3593 | arm_exidx_test.stdout: arm_exidx_test.so | |
647f1574 | 3594 | $(TEST_READELF) -Sr $< > $@ |
c87e4302 DK |
3595 | |
3596 | arm_exidx_test.so: arm_exidx_test.o ../ld-new | |
3597 | ../ld-new -shared -o $@ $< | |
3598 | ||
3599 | arm_exidx_test.o: arm_exidx_test.s | |
3600 | $(TEST_AS) -o $@ $< | |
3601 | ||
f62a3ca7 DK |
3602 | check_SCRIPTS += pr12826.sh |
3603 | check_DATA += pr12826.stdout | |
3604 | ||
3605 | pr12826.stdout: pr12826.so | |
3606 | $(TEST_READELF) -A $< > $@ | |
3607 | ||
3608 | pr12826.so: pr12826_1.o pr12826_2.o ../ld-new | |
3609 | ../ld-new -shared -o $@ $< | |
3610 | ||
3611 | pr12826_1.o: pr12826_1.s | |
3612 | $(TEST_AS) -o $@ $< | |
3613 | ||
3614 | pr12826_2.o: pr12826_2.s | |
3615 | $(TEST_AS) -o $@ $< | |
c87e4302 | 3616 | |
f6cccc2c | 3617 | check_SCRIPTS += arm_unaligned_reloc.sh |
2c339f71 | 3618 | check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout |
f6cccc2c DK |
3619 | |
3620 | arm_unaligned_reloc.stdout: arm_unaligned_reloc | |
3621 | $(TEST_OBJDUMP) -D $< > $@ | |
3622 | ||
2c339f71 DK |
3623 | arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r |
3624 | $(TEST_OBJDUMP) -Dr $< > $@ | |
3625 | ||
f6cccc2c DK |
3626 | arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new |
3627 | ../ld-new -o $@ $< | |
3628 | ||
2c339f71 DK |
3629 | arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new |
3630 | ../ld-new -r -o $@ $< | |
3631 | ||
f6cccc2c DK |
3632 | arm_unaligned_reloc.o: arm_unaligned_reloc.s |
3633 | $(TEST_AS) -o $@ $< | |
3634 | ||
2c339f71 | 3635 | MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r |
f6cccc2c | 3636 | |
cd6eab1c ILT |
3637 | # Check ARM to ARM farcall veneers |
3638 | ||
3639 | check_SCRIPTS += arm_farcall_arm_arm.sh | |
3640 | check_DATA += arm_farcall_arm_arm.stdout | |
3641 | ||
3642 | arm_farcall_arm_arm.stdout: arm_farcall_arm_arm | |
3643 | $(TEST_OBJDUMP) -d $< > $@ | |
3644 | ||
3645 | arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new | |
a8e2273b | 3646 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $< |
cd6eab1c ILT |
3647 | |
3648 | arm_farcall_arm_arm.o: arm_farcall_arm_arm.s | |
3649 | $(TEST_AS) -o $@ $< | |
3650 | ||
3651 | MOSTLYCLEANFILES += arm_farcall_arm_arm | |
3652 | ||
3653 | # Check ARM to Thumb farcall veneers | |
3654 | ||
3655 | check_SCRIPTS += arm_farcall_arm_thumb.sh | |
3656 | check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout | |
3657 | ||
3658 | arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb | |
3659 | $(TEST_OBJDUMP) -D $< > $@ | |
3660 | ||
3661 | arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new | |
3662 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
3663 | ||
3664 | arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s | |
3665 | $(TEST_AS) -o $@ $< | |
3666 | ||
3667 | arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t | |
3668 | $(TEST_OBJDUMP) -D $< > $@ | |
3669 | ||
3670 | arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new | |
a8e2273b | 3671 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
3672 | |
3673 | arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s | |
3674 | $(TEST_AS) -march=armv5t -o $@ $< | |
3675 | ||
3676 | MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t | |
3677 | ||
3678 | # Check Thumb to Thumb farcall veneers | |
3679 | ||
3680 | check_SCRIPTS += arm_farcall_thumb_thumb.sh | |
3681 | check_DATA += arm_farcall_thumb_thumb.stdout \ | |
3682 | arm_farcall_thumb_thumb_5t.stdout \ | |
3683 | arm_farcall_thumb_thumb_7m.stdout \ | |
3684 | arm_farcall_thumb_thumb_6m.stdout | |
3685 | ||
3686 | arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb | |
3687 | $(TEST_OBJDUMP) -D $< > $@ | |
3688 | ||
3689 | arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new | |
3690 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
3691 | ||
3692 | arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s | |
3693 | $(TEST_AS) -march=armv4t -o $@ $< | |
3694 | ||
3695 | arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t | |
3696 | $(TEST_OBJDUMP) -D $< > $@ | |
3697 | ||
3698 | arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new | |
a8e2273b | 3699 | ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
3700 | |
3701 | arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s | |
3702 | $(TEST_AS) -march=armv5t -o $@ $< | |
3703 | ||
3704 | arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m | |
3705 | $(TEST_OBJDUMP) -D $< > $@ | |
3706 | ||
3707 | arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new | |
3708 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
3709 | ||
3710 | arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s | |
3711 | $(TEST_AS) -march=armv7-m -o $@ $< | |
3712 | ||
3713 | arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m | |
3714 | $(TEST_OBJDUMP) -D $< > $@ | |
3715 | ||
3716 | arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new | |
3717 | ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< | |
3718 | ||
3719 | arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s | |
3720 | $(TEST_AS) -march=armv6-m -o $@ $< | |
3721 | ||
3722 | MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \ | |
3723 | arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m | |
3724 | ||
3725 | # Check Thumb to ARM farcall veneers | |
3726 | ||
3727 | check_SCRIPTS += arm_farcall_thumb_arm.sh | |
3728 | check_DATA += arm_farcall_thumb_arm.stdout \ | |
3729 | arm_farcall_thumb_arm_5t.stdout | |
3730 | ||
3731 | arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm | |
3732 | $(TEST_OBJDUMP) -D $< > $@ | |
3733 | ||
3734 | arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new | |
3735 | ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< | |
3736 | ||
3737 | arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s | |
3738 | $(TEST_AS) -o $@ $< | |
3739 | ||
3740 | arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t | |
3741 | $(TEST_OBJDUMP) -D $< > $@ | |
3742 | ||
3743 | arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new | |
a8e2273b | 3744 | ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< |
cd6eab1c ILT |
3745 | |
3746 | arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s | |
3747 | $(TEST_AS) -march=armv5t -o $@ $< | |
3748 | ||
3749 | MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t | |
3750 | ||
bc99685c DK |
3751 | # Check handling of --target1-abs, --target1-rel and --target2 options |
3752 | ||
3753 | check_SCRIPTS += arm_target1_abs.sh arm_target1_rel.sh \ | |
3754 | arm_target2_rel.sh arm_target2_abs.sh arm_target2_got_rel.sh | |
3755 | check_DATA += arm_target1_abs.stdout arm_target1_rel.stdout \ | |
3756 | arm_target2_rel.stdout arm_target2_abs.stdout arm_target2_got_rel.stdout | |
3757 | ||
3758 | arm_target1_abs.stdout: arm_target1_abs | |
3759 | $(TEST_OBJDUMP) -s $< > $@ | |
3760 | ||
3761 | arm_target1_abs: arm_target1.o ../ld-new | |
3762 | ../ld-new --target1-abs --section-start .text=0x8000 -o $@ $< | |
3763 | ||
3764 | arm_target1_rel.stdout: arm_target1_rel | |
3765 | $(TEST_OBJDUMP) -s $< > $@ | |
3766 | ||
3767 | arm_target1_rel: arm_target1.o ../ld-new | |
3768 | ../ld-new --target1-rel --section-start .text=0x8000 -o $@ $< | |
3769 | ||
3770 | arm_target1.o: arm_target1.s | |
3771 | $(TEST_AS) -o $@ $< | |
3772 | ||
3773 | arm_target2_rel.stdout: arm_target2_rel | |
3774 | $(TEST_OBJDUMP) -s $< > $@ | |
3775 | ||
3776 | arm_target2_rel: arm_target2.o ../ld-new | |
3777 | ../ld-new --target2=rel --section-start .text=0x8000 -o $@ $< | |
3778 | ||
3779 | arm_target2_abs.stdout: arm_target2_abs | |
3780 | $(TEST_OBJDUMP) -s $< > $@ | |
3781 | ||
3782 | arm_target2_abs: arm_target2.o ../ld-new | |
3783 | ../ld-new --target2=abs --section-start .text=0x8000 -o $@ $< | |
3784 | ||
3785 | arm_target2_got_rel.stdout: arm_target2_got_rel | |
3786 | $(TEST_OBJDUMP) -s $< > $@ | |
3787 | ||
3788 | arm_target2_got_rel: arm_target2.o ../ld-new | |
3789 | ../ld-new --target2=got-rel --section-start .text=0x8000 --section-start .got=0x9000 -o $@ $< | |
3790 | ||
3791 | arm_target2.o: arm_target2.s | |
3792 | $(TEST_AS) -o $@ $< | |
3793 | ||
3794 | MOSTLYCLEANFILES += arm_target1_abs arm_target1_rel \ | |
3795 | arm_target2_rel arm_target2_abs arm_target2_got_rel | |
3796 | ||
ee7ef219 IK |
3797 | # The test demonstrates why the constructor of a target object should not access options. |
3798 | check_DATA += arm_target_lazy_init | |
3799 | MOSTLYCLEANFILES += arm_target_lazy_init | |
3800 | arm_target_lazy_init: arm_target_lazy_init.o arm_target_lazy_init.t ../ld-new | |
3801 | ../ld-new -T $(srcdir)/arm_target_lazy_init.t -o $@ $< | |
3802 | arm_target_lazy_init.o: arm_target_lazy_init.s | |
3803 | $(TEST_AS) -EL -o $@ $< | |
3804 | ||
e4782e83 | 3805 | endif DEFAULT_TARGET_ARM |
eb373049 | 3806 | |
5627d875 IK |
3807 | if DEFAULT_TARGET_AARCH64 |
3808 | ||
3809 | check_SCRIPTS += aarch64_reloc_none.sh | |
3810 | check_DATA += aarch64_reloc_none.stdout | |
3811 | aarch64_reloc_none.o: aarch64_reloc_none.s | |
3812 | $(TEST_AS) -o $@ $< | |
3813 | aarch64_reloc_none: aarch64_reloc_none.o ../ld-new | |
3814 | ../ld-new -o $@ aarch64_reloc_none.o --gc-sections | |
3815 | aarch64_reloc_none.stdout: aarch64_reloc_none | |
3816 | $(TEST_NM) $< > $@ | |
3817 | ||
3818 | MOSTLYCLEANFILES += aarch64_reloc_none | |
3819 | ||
8769bc4b HS |
3820 | check_SCRIPTS += aarch64_relocs.sh |
3821 | check_DATA += aarch64_relocs.stdout | |
3822 | aarch64_globals.o: aarch64_globals.s | |
3823 | $(TEST_AS) -o $@ $< | |
3824 | aarch64_relocs.o: aarch64_relocs.s | |
3825 | $(TEST_AS) -o $@ $< | |
3826 | aarch64_relocs: aarch64_relocs.o aarch64_globals.o ../ld-new | |
3827 | ../ld-new -o $@ aarch64_relocs.o aarch64_globals.o -e0 --emit-relocs | |
3828 | aarch64_relocs.stdout: aarch64_relocs | |
3829 | $(TEST_OBJDUMP) -dr $< > $@ | |
3830 | ||
3831 | MOSTLYCLEANFILES += aarch64_relocs | |
3832 | ||
6bf56e74 IK |
3833 | check_SCRIPTS += pr21430.sh |
3834 | check_DATA += pr21430.stdout | |
3835 | pr21430.o: pr21430.s | |
3836 | $(TEST_AS) -o $@ $< | |
3837 | pr21430: pr21430.o ../ld-new | |
3838 | ../ld-new -o $@ $< | |
3839 | pr21430.stdout: pr21430 | |
3840 | $(TEST_NM) -S $< > $@ | |
3841 | ||
3842 | MOSTLYCLEANFILES += pr21430 | |
3843 | ||
cefdd1cd IK |
3844 | check_SCRIPTS += aarch64_tlsdesc.sh |
3845 | check_DATA += aarch64_tlsdesc.stdout | |
3846 | aarch64_tlsdesc.o: aarch64_tlsdesc.s | |
3847 | $(TEST_AS) -o $@ $< | |
3848 | aarch64_tlsdesc: aarch64_tlsdesc.o $(srcdir)/aarch64_tlsdesc.t ../ld-new | |
3849 | ../ld-new $< -shared -T $(srcdir)/aarch64_tlsdesc.t -o $@ | |
3850 | aarch64_tlsdesc.stdout: aarch64_tlsdesc | |
3851 | $(TEST_OBJDUMP) -dR -j.text -j.got.plt $< > $@ | |
3852 | ||
3853 | MOSTLYCLEANFILES += aarch64_tlsdesc | |
3854 | ||
5627d875 IK |
3855 | endif DEFAULT_TARGET_AARCH64 |
3856 | ||
2b63aca3 MK |
3857 | if DEFAULT_TARGET_S390 |
3858 | ||
3859 | check_SCRIPTS += split_s390.sh | |
3860 | check_DATA += split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \ | |
3861 | split_s390_z4.stdout split_s390_n1.stdout split_s390_n2.stdout \ | |
3862 | split_s390_a1.stdout split_s390_a2.stdout split_s390_z1_ns.stdout \ | |
3863 | split_s390_z2_ns.stdout split_s390_z3_ns.stdout split_s390_z4_ns.stdout \ | |
3864 | split_s390_n1_ns.stdout split_s390_n2_ns.stdout split_s390_r.stdout \ | |
3865 | split_s390x_z1.stdout split_s390x_z2.stdout split_s390x_z3.stdout \ | |
3866 | split_s390x_z4.stdout split_s390x_n1.stdout split_s390x_n2.stdout \ | |
3867 | split_s390x_a1.stdout split_s390x_a2.stdout split_s390x_z1_ns.stdout \ | |
3868 | split_s390x_z2_ns.stdout split_s390x_z3_ns.stdout \ | |
3869 | split_s390x_z4_ns.stdout split_s390x_n1_ns.stdout \ | |
3870 | split_s390x_n2_ns.stdout split_s390x_r.stdout | |
3871 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 | |
3872 | split_s390_1_z1.o: split_s390_1_z1.s | |
3873 | $(TEST_AS) -m31 -o $@ $< | |
3874 | split_s390_1_z2.o: split_s390_1_z2.s | |
3875 | $(TEST_AS) -m31 -o $@ $< | |
3876 | split_s390_1_z3.o: split_s390_1_z3.s | |
3877 | $(TEST_AS) -m31 -o $@ $< | |
3878 | split_s390_1_z4.o: split_s390_1_z4.s | |
3879 | $(TEST_AS) -m31 -o $@ $< | |
3880 | split_s390_1_n1.o: split_s390_1_n1.s | |
3881 | $(TEST_AS) -m31 -o $@ $< | |
3882 | split_s390_1_n2.o: split_s390_1_n2.s | |
3883 | $(TEST_AS) -m31 -o $@ $< | |
3884 | split_s390_1_a1.o: split_s390_1_a1.s | |
3885 | $(TEST_AS) -m31 -o $@ $< | |
3886 | split_s390_1_a2.o: split_s390_1_a2.s | |
3887 | $(TEST_AS) -m31 -o $@ $< | |
3888 | split_s390_2_s.o: split_s390_2_s.s | |
3889 | $(TEST_AS) -m31 -o $@ $< | |
3890 | split_s390_2_ns.o: split_s390_2_ns.s | |
3891 | $(TEST_AS) -m31 -o $@ $< | |
3892 | split_s390_z1: split_s390_1_z1.o split_s390_2_s.o ../ld-new | |
3893 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z1.o split_s390_2_s.o | |
3894 | split_s390_z1.stdout: split_s390_z1 | |
3895 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3896 | split_s390_z2: split_s390_1_z2.o split_s390_2_s.o ../ld-new | |
3897 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z2.o split_s390_2_s.o | |
3898 | split_s390_z2.stdout: split_s390_z2 | |
3899 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3900 | split_s390_z3: split_s390_1_z3.o split_s390_2_s.o ../ld-new | |
3901 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z3.o split_s390_2_s.o | |
3902 | split_s390_z3.stdout: split_s390_z3 | |
3903 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3904 | split_s390_z4: split_s390_1_z4.o split_s390_2_s.o ../ld-new | |
3905 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z4.o split_s390_2_s.o | |
3906 | split_s390_z4.stdout: split_s390_z4 | |
3907 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3908 | split_s390_n1: split_s390_1_n1.o split_s390_2_s.o ../ld-new | |
3909 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n1.o split_s390_2_s.o | |
3910 | split_s390_n1.stdout: split_s390_n1 | |
3911 | $(TEST_OBJDUMP) -d $< > $@ | |
3912 | split_s390_n2: split_s390_1_n2.o split_s390_2_s.o ../ld-new | |
3913 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n2.o split_s390_2_s.o | |
3914 | split_s390_n2.stdout: split_s390_n2 | |
3915 | $(TEST_OBJDUMP) -d $< > $@ | |
3916 | split_s390_z1_ns: split_s390_1_z1.o split_s390_2_ns.o ../ld-new | |
3917 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z1.o split_s390_2_ns.o | |
3918 | split_s390_z1_ns.stdout: split_s390_z1_ns | |
3919 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3920 | split_s390_z2_ns: split_s390_1_z2.o split_s390_2_ns.o ../ld-new | |
3921 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z2.o split_s390_2_ns.o | |
3922 | split_s390_z2_ns.stdout: split_s390_z2_ns | |
3923 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3924 | split_s390_z3_ns: split_s390_1_z3.o split_s390_2_ns.o ../ld-new | |
3925 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z3.o split_s390_2_ns.o | |
3926 | split_s390_z3_ns.stdout: split_s390_z3_ns | |
3927 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3928 | split_s390_z4_ns: split_s390_1_z4.o split_s390_2_ns.o ../ld-new | |
3929 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z4.o split_s390_2_ns.o | |
3930 | split_s390_z4_ns.stdout: split_s390_z4_ns | |
3931 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3932 | split_s390_n1_ns: split_s390_1_n1.o split_s390_2_ns.o ../ld-new | |
3933 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n1.o split_s390_2_ns.o | |
3934 | split_s390_n1_ns.stdout: split_s390_n1_ns | |
3935 | $(TEST_OBJDUMP) -d $< > $@ | |
3936 | split_s390_n2_ns.stdout: split_s390_1_n2.o split_s390_2_ns.o ../ld-new | |
3937 | ../ld-new $(SPLIT_DEFSYMS) -o split_s390_n2 split_s390_1_n2.o split_s390_2_ns.o > $@ 2>&1 || exit 0 | |
3938 | split_s390_a1.stdout: split_s390_1_a1.o split_s390_2_ns.o ../ld-new | |
3939 | ../ld-new $(SPLIT_DEFSYMS) -o split_s390_a1 split_s390_1_a1.o split_s390_2_ns.o > $@ 2>&1 || exit 0 | |
3940 | split_s390_a2: split_s390_1_a2.o split_s390_2_ns.o ../ld-new | |
3941 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_a2.o split_s390_2_ns.o | |
3942 | split_s390_a2.stdout: split_s390_a2 | |
3943 | $(TEST_OBJDUMP) -d $< > $@ | |
3944 | split_s390_r.stdout: split_s390_1_z1.o split_s390_2_ns.o ../ld-new | |
3945 | ../ld-new -r split_s390_1_z1.o split_s390_2_ns.o -o split_s390_r > $@ 2>&1 || exit 0 | |
3946 | split_s390x_1_z1.o: split_s390x_1_z1.s | |
3947 | $(TEST_AS) -m64 -o $@ $< | |
3948 | split_s390x_1_z2.o: split_s390x_1_z2.s | |
3949 | $(TEST_AS) -m64 -o $@ $< | |
3950 | split_s390x_1_z3.o: split_s390x_1_z3.s | |
3951 | $(TEST_AS) -m64 -o $@ $< | |
3952 | split_s390x_1_z4.o: split_s390x_1_z4.s | |
3953 | $(TEST_AS) -m64 -o $@ $< | |
3954 | split_s390x_1_n1.o: split_s390x_1_n1.s | |
3955 | $(TEST_AS) -m64 -o $@ $< | |
3956 | split_s390x_1_n2.o: split_s390x_1_n2.s | |
3957 | $(TEST_AS) -m64 -o $@ $< | |
3958 | split_s390x_1_a1.o: split_s390x_1_a1.s | |
3959 | $(TEST_AS) -m64 -o $@ $< | |
3960 | split_s390x_1_a2.o: split_s390x_1_a2.s | |
3961 | $(TEST_AS) -m64 -o $@ $< | |
3962 | split_s390x_2_s.o: split_s390x_2_s.s | |
3963 | $(TEST_AS) -m64 -o $@ $< | |
3964 | split_s390x_2_ns.o: split_s390x_2_ns.s | |
3965 | $(TEST_AS) -m64 -o $@ $< | |
3966 | split_s390x_z1: split_s390x_1_z1.o split_s390x_2_s.o ../ld-new | |
3967 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z1.o split_s390x_2_s.o | |
3968 | split_s390x_z1.stdout: split_s390x_z1 | |
3969 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3970 | split_s390x_z2: split_s390x_1_z2.o split_s390x_2_s.o ../ld-new | |
3971 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z2.o split_s390x_2_s.o | |
3972 | split_s390x_z2.stdout: split_s390x_z2 | |
3973 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3974 | split_s390x_z3: split_s390x_1_z3.o split_s390x_2_s.o ../ld-new | |
3975 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z3.o split_s390x_2_s.o | |
3976 | split_s390x_z3.stdout: split_s390x_z3 | |
3977 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3978 | split_s390x_z4: split_s390x_1_z4.o split_s390x_2_s.o ../ld-new | |
3979 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z4.o split_s390x_2_s.o | |
3980 | split_s390x_z4.stdout: split_s390x_z4 | |
3981 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3982 | split_s390x_n1: split_s390x_1_n1.o split_s390x_2_s.o ../ld-new | |
3983 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n1.o split_s390x_2_s.o | |
3984 | split_s390x_n1.stdout: split_s390x_n1 | |
3985 | $(TEST_OBJDUMP) -d $< > $@ | |
3986 | split_s390x_n2: split_s390x_1_n2.o split_s390x_2_s.o ../ld-new | |
3987 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n2.o split_s390x_2_s.o | |
3988 | split_s390x_n2.stdout: split_s390x_n2 | |
3989 | $(TEST_OBJDUMP) -d $< > $@ | |
3990 | split_s390x_z1_ns: split_s390x_1_z1.o split_s390x_2_ns.o ../ld-new | |
3991 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z1.o split_s390x_2_ns.o | |
3992 | split_s390x_z1_ns.stdout: split_s390x_z1_ns | |
3993 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3994 | split_s390x_z2_ns: split_s390x_1_z2.o split_s390x_2_ns.o ../ld-new | |
3995 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z2.o split_s390x_2_ns.o | |
3996 | split_s390x_z2_ns.stdout: split_s390x_z2_ns | |
3997 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
3998 | split_s390x_z3_ns: split_s390x_1_z3.o split_s390x_2_ns.o ../ld-new | |
3999 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z3.o split_s390x_2_ns.o | |
4000 | split_s390x_z3_ns.stdout: split_s390x_z3_ns | |
4001 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
4002 | split_s390x_z4_ns: split_s390x_1_z4.o split_s390x_2_ns.o ../ld-new | |
4003 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z4.o split_s390x_2_ns.o | |
4004 | split_s390x_z4_ns.stdout: split_s390x_z4_ns | |
4005 | $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@ | |
4006 | split_s390x_n1_ns: split_s390x_1_n1.o split_s390x_2_ns.o ../ld-new | |
4007 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n1.o split_s390x_2_ns.o | |
4008 | split_s390x_n1_ns.stdout: split_s390x_n1_ns | |
4009 | $(TEST_OBJDUMP) -d $< > $@ | |
4010 | split_s390x_n2_ns.stdout: split_s390x_1_n2.o split_s390x_2_ns.o ../ld-new | |
4011 | ../ld-new $(SPLIT_DEFSYMS) -o split_s390x_n2 split_s390x_1_n2.o split_s390x_2_ns.o > $@ 2>&1 || exit 0 | |
4012 | split_s390x_a1.stdout: split_s390x_1_a1.o split_s390x_2_ns.o ../ld-new | |
4013 | ../ld-new $(SPLIT_DEFSYMS) -o split_s390x_a1 split_s390x_1_a1.o split_s390x_2_ns.o > $@ 2>&1 || exit 0 | |
4014 | split_s390x_a2: split_s390x_1_a2.o split_s390x_2_ns.o ../ld-new | |
4015 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_a2.o split_s390x_2_ns.o | |
4016 | split_s390x_a2.stdout: split_s390x_a2 | |
4017 | $(TEST_OBJDUMP) -d $< > $@ | |
4018 | split_s390x_r.stdout: split_s390x_1_z1.o split_s390x_2_ns.o ../ld-new | |
4019 | ../ld-new -r split_s390x_1_z1.o split_s390x_2_ns.o -o split_s390x_r > $@ 2>&1 || exit 0 | |
4020 | MOSTLYCLEANFILES += split_s390_z1 split_s390_z2 split_s390_z3 \ | |
4021 | split_s390_z4 split_s390_n1 split_s390_n2 split_s390_a1 \ | |
4022 | split_s390_a2 split_s390_z1_ns split_s390_z2_ns split_s390_z3_ns \ | |
4023 | split_s390_z4_ns split_s390_n1_ns split_s390_n2_ns split_s390_r \ | |
4024 | split_s390x_z1 split_s390x_z2 split_s390x_z3 split_s390x_z4 \ | |
4025 | split_s390x_n1 split_s390x_n2 split_s390x_a1 split_s390x_a2 \ | |
4026 | split_s390x_z1_ns split_s390x_z2_ns split_s390x_z3_ns \ | |
4027 | split_s390x_z4_ns split_s390x_n1_ns split_s390x_n2_ns split_s390x_r | |
4028 | ||
4029 | endif DEFAULT_TARGET_S390 | |
4030 | ||
eb373049 ILT |
4031 | endif NATIVE_OR_CROSS_LINKER |
4032 | ||
35c813e2 CC |
4033 | # Tests for the dwp tool. |
4034 | # We don't want to rely yet on GCC support for -gsplit-dwarf, | |
4035 | # so we use (for now) test cases in x86 assembly language, | |
4036 | # compiled from the dwp_test_*.cc sources. | |
4037 | ||
4038 | if DEFAULT_TARGET_X86_64 | |
4039 | ||
4040 | dwp_test_main.o: dwp_test_main.s | |
4041 | $(TEST_AS) -o $@ $< | |
4042 | dwp_test_1.o: dwp_test_1.s | |
4043 | $(TEST_AS) -o $@ $< | |
4044 | dwp_test_1b.o: dwp_test_1b.s | |
4045 | $(TEST_AS) -o $@ $< | |
4046 | dwp_test_2.o: dwp_test_2.s | |
4047 | $(TEST_AS) -o $@ $< | |
4048 | ||
4049 | dwp_test_main.dwo: dwp_test_main.o | |
4050 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
4051 | dwp_test_1.dwo: dwp_test_1.o | |
4052 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
4053 | dwp_test_1b.dwo: dwp_test_1b.o | |
4054 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
4055 | dwp_test_2.dwo: dwp_test_2.o | |
4056 | $(TEST_OBJCOPY) --extract-dwo $< $@ | |
4057 | ||
0ec6429b | 4058 | MOSTLYCLEANFILES += *.dwo *.dwp |
35c813e2 CC |
4059 | check_SCRIPTS += dwp_test_1.sh |
4060 | check_DATA += dwp_test_1.stdout | |
4061 | dwp_test_1.stdout: dwp_test_1.dwp | |
4062 | $(TEST_READELF) -wi $< > $@ | |
4063 | dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo | |
4064 | ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo | |
4065 | ||
4066 | check_SCRIPTS += dwp_test_2.sh | |
4067 | check_DATA += dwp_test_2.stdout | |
4068 | dwp_test_2.stdout: dwp_test_2.dwp | |
4069 | $(TEST_READELF) -wi $< > $@ | |
4070 | dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp | |
4071 | ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp | |
4072 | dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo | |
4073 | ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo | |
4074 | dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo | |
4075 | ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo | |
4076 | ||
4077 | endif DEFAULT_TARGET_X86_64 |