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