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