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