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