1 # Process this file with automake to generate Makefile.in
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.
7 # Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS
8 AUTOMAKE_OPTIONS = foreign -Wno-portability
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
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)
22 -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
23 -I$(srcdir)/../../elfcpp -I.. \
24 -DLOCALEDIR="\"$(datadir)/locale\"" \
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
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 differ in newer automake used by gold, but note the
36 # addition of OPT_NO_PLUGINS and use of CC and CXX in LINK1 and CXXLINK1.
37 COMPILE1 = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
38 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
39 LINK1 = $(CC) $(AM_CFLAGS) $(CFLAGS) $(OPT_NO_PLUGINS) \
40 $(AM_LDFLAGS) $(LDFLAGS) -o $@
41 CXXCOMPILE1 = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
42 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
43 CXXLINK1 = $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) $(OPT_NO_PLUGINS) \
44 $(AM_LDFLAGS) $(LDFLAGS) -o $@
46 # Put our -B option before any other -B that might be in $CC or $CXX
47 editcc = -e 's/\([^ ]*\)\(.*\)/\1 -Bgcctestdir\/\2/'
49 # Strip out -Wp,-D_FORTIFY_SOURCE=, which is irrelevant for the gold
50 # testsuite and incompatible with -O0 used in gold tests.
51 editcc1 = -e 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'
53 CCLD = `echo $(CC) | sed $(editcc)`
54 CXXLD = `echo $(CXX) | sed $(editcc)`
55 COMPILE = `echo $(COMPILE1) | sed $(editcc) $(editcc1)`
56 LINK = `echo $(LINK1) | sed $(editcc) $(editcc1)`
57 CXXCOMPILE = `echo $(CXXCOMPILE1) | sed $(editcc) $(editcc1)`
58 CXXLINK = `echo $(CXXLINK1) | sed $(editcc) $(editcc1)`
60 # Strip out -static-libgcc and -static-libstdc++ options, for tests
61 # that must have these libraries linked dynamically. The -shared-libgcc
62 # option does not work correctly, and there is no -shared-libstdc++ option.
63 # (See GCC PR 55781 and PR 55782.)
64 editcc2 = -e 's/-static-lib\(gcc\|stdc++\) *//g'
65 CXXLINK_S = `echo $(CXXLINK1) | sed $(editcc) $(editcc1) $(editcc2)`
67 TEST_READELF = $(top_builddir)/../binutils/readelf
68 TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
69 TEST_OBJCOPY = $(top_builddir)/../binutils/objcopy
70 TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
71 TEST_STRIP = $(top_builddir)/../binutils/strip-new
72 TEST_AR = $(top_builddir)/../binutils/ar
73 TEST_NM = $(top_builddir)/../binutils/nm-new
74 TEST_AS = $(top_builddir)/../gas/as-new
81 THREADFLAGS = @PTHREAD_CFLAGS@
82 THREADLIBS = @PTHREAD_LIBS@
86 TLS_TEST_C_CFLAGS = -fopenmp
89 # Since GCC 10 defaults to -fno-common, add -fcommon to common tests to
90 # force common behavior.
91 COMMON_TEST_C_CFLAGS = -fcommon
93 # 'make clean' is good about deleting some intermediate files (such as
94 # .o's), but not all of them (such as .so's and .err files). We
95 # improve on that here. automake-1.9 info docs say "mostlyclean" is
96 # the right choice for files 'make' builds that people rebuild.
97 MOSTLYCLEANFILES = *.so *.syms *.stdout *.stderr
99 # Export make variables to the shell scripts so that they can see
100 # (for example) DEFAULT_TARGET.
101 .EXPORT_ALL_VARIABLES:
103 # We will add to these later, for each individual test. Note
104 # that we add each test under check_SCRIPTS or check_PROGRAMS;
105 # the TESTS variable is automatically populated from these.
111 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
113 # ---------------------------------------------------------------------
114 # These tests test the internals of gold (unittests).
116 # Infrastucture needed for the unittests
117 check_LIBRARIES = libgoldtest.a
118 libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
121 libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
123 # The unittests themselves
124 if NATIVE_OR_CROSS_LINKER
127 # Infrastucture needed for the unittests: a directory where the linker
128 # is named 'ld'. This is because the -B flag appends 'ld' to its arg.
129 gcctestdir/ld: ../ld-new gcctestdir/collect-ld
130 test -d gcctestdir || mkdir -p gcctestdir
132 $(LN_S) $(abs_top_builddir)/ld-new $@
134 # Needed when using uninstalled compiler
135 gcctestdir/collect-ld: ../ld-new
136 test -d gcctestdir || mkdir -p gcctestdir
138 $(LN_S) $(abs_top_builddir)/ld-new $@
140 # Some tests require the latest features of an in-tree assembler.
141 gcctestdir/as: $(TEST_AS)
142 test -d gcctestdir || mkdir -p gcctestdir
144 $(LN_S) $(abs_top_builddir)/../gas/as-new $@
148 check_PROGRAMS += object_unittest
149 object_unittest_SOURCES = object_unittest.cc
150 object_unittest_LDFLAGS = $(THREADFLAGS)
151 object_unittest_LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
152 $(THREADLIBS) $(LIBDL) $(ZLIB) $(ZSTD_LIBS) $(JANSSON_LIBS)
154 check_PROGRAMS += binary_unittest
155 binary_unittest_SOURCES = binary_unittest.cc
156 binary_unittest_LDFLAGS = $(THREADFLAGS)
157 binary_unittest_LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
158 $(THREADLIBS) $(LIBDL) $(ZLIB) $(ZSTD_LIBS) $(JANSSON_LIBS)
160 check_PROGRAMS += leb128_unittest
161 leb128_unittest_SOURCES = leb128_unittest.cc
162 leb128_unittest_LDFLAGS = $(THREADFLAGS)
163 leb128_unittest_LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
164 $(THREADLIBS) $(LIBDL) $(ZLIB) $(ZSTD_LIBS) $(JANSSON_LIBS)
166 check_PROGRAMS += overflow_unittest
167 overflow_unittest_SOURCES = overflow_unittest.cc
168 overflow_unittest_LDFLAGS = $(THREADFLAGS)
169 overflow_unittest_LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
170 $(THREADLIBS) $(LIBDL) $(ZLIB) $(ZSTD_LIBS) $(JANSSON_LIBS)
171 overflow_unittest.o: overflow_unittest.cc
172 $(CXXCOMPILE) -O3 -c -o $@ $<
174 endif NATIVE_OR_CROSS_LINKER
176 # ---------------------------------------------------------------------
177 # These tests test the output of gold (end-to-end tests). In
178 # particular, they make sure that gold can link "difficult" object
179 # files, and the resulting object files run correctly. These can only
180 # run if we've built ld-new for the native architecture (that is,
181 # we're not cross-compiling it), since we run ld-new as part of these
182 # tests. We use the gcc-specific flag '-B' to use our linker instead
183 # of the default linker, which is why we only run our tests under gcc.
188 # Test empty command line error conditions.
189 check_SCRIPTS += empty_command_line_test.sh
190 empty_command_line_test.sh: gcctestdir/ld
192 # Each of these .o's is a useful, small complete program. They're
193 # particularly useful for making sure ld-new's flags do what they're
194 # supposed to (hence their names), but are used for many tests that
195 # don't actually involve analyzing input data.
196 flagstest_debug.o: constructor_test.cc
197 $(CXXCOMPILE) -O0 -g -c -o $@ $<
198 flagstest_ndebug.o: constructor_test.cc
199 $(CXXCOMPILE) -O0 -c -o $@ $<
201 check_SCRIPTS += incremental_test.sh
202 check_DATA += incremental_test.stdout
203 MOSTLYCLEANFILES += incremental_test incremental_test.cmdline
204 incremental_test_1.o: incremental_test_1.c
205 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
206 incremental_test_2.o: incremental_test_2.c
207 $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
208 incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
209 $(LINK) -Wl,--incremental-full -Wl,-z,norelro,-no-pie incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
210 incremental_test.stdout: incremental_test ../incremental-dump
211 ../incremental-dump incremental_test > $@
213 check_SCRIPTS += gc_comdat_test.sh
214 check_DATA += gc_comdat_test.stdout
215 MOSTLYCLEANFILES += gc_comdat_test
216 gc_comdat_test_1.o: gc_comdat_test_1.cc
217 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
218 gc_comdat_test_2.o: gc_comdat_test_2.cc
219 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
220 gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
221 $(CXXLINK) -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
222 gc_comdat_test.stdout: gc_comdat_test
223 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
225 check_SCRIPTS += gc_tls_test.sh
226 check_DATA += gc_tls_test.stdout
227 MOSTLYCLEANFILES += gc_tls_test
228 gc_tls_test.o: gc_tls_test.cc
229 $(CXXCOMPILE) -O0 -c -g -o $@ $<
230 gc_tls_test:gc_tls_test.o gcctestdir/ld
231 $(CXXLINK) -Wl,--gc-sections gc_tls_test.o
232 gc_tls_test.stdout: gc_tls_test
233 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
235 check_SCRIPTS += gc_orphan_section_test.sh
236 check_DATA += gc_orphan_section_test.stdout
237 MOSTLYCLEANFILES += gc_orphan_section_test
238 gc_orphan_section_test.o: gc_orphan_section_test.cc
239 $(CXXCOMPILE) -O0 -c -g -o $@ $<
240 gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
241 $(CXXLINK) -Wl,--gc-sections gc_orphan_section_test.o
242 gc_orphan_section_test.stdout: gc_orphan_section_test
243 $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout
245 check_SCRIPTS += pr14265.sh
246 check_DATA += pr14265.stdout
247 MOSTLYCLEANFILES += pr14265
249 $(COMPILE) -O0 -c -o $@ $<
250 pr14265: pr14265.o gcctestdir/ld $(srcdir)/pr14265.t
251 $(LINK) -Wl,--gc-sections -Wl,-T,$(srcdir)/pr14265.t -o $@ $<
252 pr14265.stdout: pr14265
253 $(TEST_NM) --format=bsd --numeric-sort $< > $@
255 check_SCRIPTS += pr20717.sh
256 check_DATA += pr20717.stdout
257 MOSTLYCLEANFILES += pr20717
259 $(COMPILE) -O0 -ffunction-sections -c -o $@ $<
260 pr20717: pr20717.o gcctestdir/ld $(srcdir)/pr20717.t
261 $(LINK) -Wl,--gc-sections -Wl,-T,$(srcdir)/pr20717.t -o $@ $<
262 pr20717.stdout: pr20717
265 check_SCRIPTS += gc_dynamic_list_test.sh
266 check_DATA += gc_dynamic_list_test.stdout
267 MOSTLYCLEANFILES += gc_dynamic_list_test
268 gc_dynamic_list_test.o: gc_dynamic_list_test.c
269 $(COMPILE) -c -ffunction-sections -o $@ $<
270 gc_dynamic_list_test: gc_dynamic_list_test.o gcctestdir/ld $(srcdir)/gc_dynamic_list_test.t
271 $(LINK) -Wl,--gc-sections -Wl,--dynamic-list,$(srcdir)/gc_dynamic_list_test.t gc_dynamic_list_test.o
272 gc_dynamic_list_test.stdout: gc_dynamic_list_test
273 $(TEST_NM) gc_dynamic_list_test > $@
275 check_SCRIPTS += icf_test.sh
276 check_DATA += icf_test.map
277 MOSTLYCLEANFILES += icf_test icf_test.map
278 icf_test.o: icf_test.cc
279 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
280 icf_test: icf_test.o gcctestdir/ld
281 $(CXXLINK) -o icf_test -Wl,--icf=all,-Map,icf_test.map icf_test.o
282 icf_test.map: icf_test
285 check_SCRIPTS += icf_test_pr21066.sh
286 check_DATA += icf_test_pr21066.map
287 MOSTLYCLEANFILES += icf_test_pr21066 icf_test_pr21066.map
288 icf_test_pr21066.o: icf_test_pr21066.cc
289 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
290 icf_test_pr21066: icf_test_pr21066.o gcctestdir/ld
291 $(CXXLINK) -o icf_test_pr21066 -Bgcctestdir/ -Wl,--icf=all,-Map,icf_test_pr21066.map icf_test_pr21066.o
292 icf_test_pr21066.map: icf_test_pr21066
293 @touch icf_test_pr21066.map
295 check_SCRIPTS += icf_keep_unique_test.sh
296 check_DATA += icf_keep_unique_test.stdout
297 MOSTLYCLEANFILES += icf_keep_unique_test
298 icf_keep_unique_test.o: icf_keep_unique_test.cc
299 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
300 icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
301 $(CXXLINK) -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
302 icf_keep_unique_test.stdout: icf_keep_unique_test
303 $(TEST_NM) -C $< > $@
305 check_SCRIPTS += icf_safe_test.sh
306 check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout icf_safe_test.map
307 MOSTLYCLEANFILES += icf_safe_test icf_safe_test.map
308 icf_safe_test.o: icf_safe_test.cc
309 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
310 icf_safe_test: icf_safe_test.o gcctestdir/ld
311 $(CXXLINK) -o icf_safe_test -Wl,--icf=safe,-Map,icf_safe_test.map icf_safe_test.o
312 icf_safe_test.map: icf_safe_test
313 @touch icf_safe_test.map
314 icf_safe_test_1.stdout: icf_safe_test
316 icf_safe_test_2.stdout: icf_safe_test
317 $(TEST_READELF) -h $< > $@
319 check_SCRIPTS += icf_safe_pie_test.sh
320 check_DATA += icf_safe_pie_test_1.stdout icf_safe_pie_test_2.stdout icf_safe_pie_test.map
321 MOSTLYCLEANFILES += icf_safe_pie_test icf_safe_pie_test.map
322 icf_safe_pie_test.o: icf_safe_test.cc
323 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
324 icf_safe_pie_test: icf_safe_pie_test.o gcctestdir/ld
325 $(CXXLINK) -o icf_safe_pie_test -Wl,--icf=safe,-Map,icf_safe_pie_test.map icf_safe_pie_test.o -pie
326 icf_safe_pie_test.map: icf_safe_pie_test
327 @touch icf_safe_pie_test.map
328 icf_safe_pie_test_1.stdout: icf_safe_pie_test
330 icf_safe_pie_test_2.stdout: icf_safe_pie_test
331 $(TEST_READELF) -h $< > $@
333 check_SCRIPTS += icf_safe_so_test.sh
334 check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout icf_safe_so_test.map
335 MOSTLYCLEANFILES += icf_safe_so_test icf_safe_so_test.map
336 icf_safe_so_test.o: icf_safe_so_test.cc
337 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
338 icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
339 $(CXXLINK) -o icf_safe_so_test -Wl,--icf=safe,-Map,icf_safe_so_test.map icf_safe_so_test.o -fPIC -shared
340 icf_safe_so_test.map:
341 @touch icf_safe_so_test.map
342 icf_safe_so_test_1.stdout: icf_safe_so_test
344 icf_safe_so_test_2.stdout: icf_safe_so_test
345 $(TEST_READELF) -h $< > $@
347 check_SCRIPTS += final_layout.sh
348 check_DATA += final_layout.stdout
349 MOSTLYCLEANFILES += final_layout final_layout_sequence.txt final_layout_script.lds
350 final_layout.o: final_layout.cc
351 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
352 final_layout_sequence.txt:
353 (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
354 final_layout_script.lds:
355 (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .sbss : { *(.sbss*) } .bss : { *(.bss*) } }") > final_layout_script.lds
356 final_layout: final_layout.o final_layout_sequence.txt final_layout_script.lds gcctestdir/ld
357 $(CXXLINK) -Wl,--section-ordering-file,final_layout_sequence.txt -Wl,-T,final_layout_script.lds final_layout.o
358 final_layout.stdout: final_layout
359 $(TEST_NM) -n --synthetic final_layout > final_layout.stdout
361 check_SCRIPTS += text_section_grouping.sh
362 check_DATA += text_section_grouping.stdout text_section_no_grouping.stdout
363 MOSTLYCLEANFILES += text_section_grouping text_section_no_grouping
364 text_section_grouping.o: text_section_grouping.cc
365 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
366 text_section_grouping: text_section_grouping.o gcctestdir/ld
367 $(CXXLINK) text_section_grouping.o
368 text_section_no_grouping: text_section_grouping.o gcctestdir/ld
369 $(CXXLINK) -Wl,--no-text-reorder text_section_grouping.o
370 text_section_grouping.stdout: text_section_grouping
371 $(TEST_NM) -n --synthetic text_section_grouping > text_section_grouping.stdout
372 text_section_no_grouping.stdout: text_section_no_grouping
373 $(TEST_NM) -n --synthetic text_section_no_grouping > text_section_no_grouping.stdout
375 check_SCRIPTS += section_sorting_name.sh
376 check_DATA += section_sorting_name.stdout
377 MOSTLYCLEANFILES += section_sorting_name
378 section_sorting_name.o: section_sorting_name.cc
379 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
380 section_sorting_name: section_sorting_name.o gcctestdir/ld
381 $(CXXLINK) -Wl,--sort-section=name section_sorting_name.o
382 section_sorting_name.stdout: section_sorting_name
383 $(TEST_NM) -n --synthetic section_sorting_name > section_sorting_name.stdout
385 check_SCRIPTS += text_unlikely_segment.sh
386 check_DATA += text_unlikely_segment_readelf.stdout
387 MOSTLYCLEANFILES += text_unlikely_segment
388 text_unlikely_segment.o: text_unlikely_segment.cc
389 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
390 text_unlikely_segment: text_unlikely_segment.o gcctestdir/ld
391 $(CXXLINK) -Wl,-z,text-unlikely-segment text_unlikely_segment.o
392 text_unlikely_segment_readelf.stdout: text_unlikely_segment
393 $(TEST_READELF) -Wl $< >$@
395 check_SCRIPTS += keep_text_section_prefix.sh
396 check_DATA += keep_text_section_prefix_readelf.stdout keep_text_section_prefix_nm.stdout
397 MOSTLYCLEANFILES += keep_text_section_prefix
398 keep_text_section_prefix.o: keep_text_section_prefix.cc
399 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
400 keep_text_section_prefix: keep_text_section_prefix.o gcctestdir/ld
401 $(CXXLINK) -Wl,-z,keep-text-section-prefix keep_text_section_prefix.o
402 keep_text_section_prefix_readelf.stdout: keep_text_section_prefix
403 $(TEST_READELF) -Wl $< >$@
404 keep_text_section_prefix_nm.stdout: keep_text_section_prefix
405 $(TEST_NM) -n --synthetic $< >$@
407 check_PROGRAMS += icf_virtual_function_folding_test
408 MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map
409 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
410 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
411 icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld
412 $(CXXLINK) -Wl,--icf=all icf_virtual_function_folding_test.o -pie
414 check_SCRIPTS += icf_preemptible_functions_test.sh
415 check_DATA += icf_preemptible_functions_test.stdout
416 MOSTLYCLEANFILES += icf_preemptible_functions_test
417 icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
418 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
419 icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
420 $(CXXLINK) -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared
421 icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
422 $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout
424 check_SCRIPTS += icf_string_merge_test.sh
425 check_DATA += icf_string_merge_test.stdout
426 MOSTLYCLEANFILES += icf_string_merge_test
427 icf_string_merge_test.o: icf_string_merge_test.cc
428 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
429 icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
430 $(CXXLINK) -Wl,--icf=all icf_string_merge_test.o
431 icf_string_merge_test.stdout: icf_string_merge_test
432 $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout
434 check_SCRIPTS += icf_sht_rel_addend_test.sh
435 check_DATA += icf_sht_rel_addend_test.stdout
436 MOSTLYCLEANFILES += icf_sht_rel_addend_test
437 icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
438 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
439 icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
440 $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
441 icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld
442 $(CXXLINK) -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o
443 icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
444 $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
446 check_PROGRAMS += large_symbol_alignment
447 large_symbol_alignment_SOURCES = large_symbol_alignment.cc
448 large_symbol_alignment_DEPENDENCIES = gcctestdir/ld
449 large_symbol_alignment_LDADD =
451 check_SCRIPTS += merge_string_literals.sh
452 check_DATA += merge_string_literals.stdout
453 MOSTLYCLEANFILES += merge_string_literals
454 merge_string_literals_1.o: merge_string_literals_1.cc
455 $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $<
456 merge_string_literals_2.o: merge_string_literals_2.cc
457 $(CXXCOMPILE) -O2 -c -fPIC -g -o $@ $<
458 merge_string_literals: merge_string_literals_1.o merge_string_literals_2.o gcctestdir/ld
459 $(CXXLINK) merge_string_literals_1.o merge_string_literals_2.o -O2 -shared -nostdlib
460 merge_string_literals.stdout: merge_string_literals
461 $(TEST_OBJDUMP) -s -j.rodata merge_string_literals > merge_string_literals.stdout
463 check_PROGRAMS += basic_test
464 check_PROGRAMS += basic_pic_test
465 basic_test.o: basic_test.cc
466 $(CXXCOMPILE) -O0 -c -o $@ $<
467 basic_test: basic_test.o gcctestdir/ld
468 $(CXXLINK) basic_test.o
470 check_PROGRAMS += eh_test
471 eh_test_a.o: eh_test_a.cc
472 $(CXXCOMPILE) -O0 -c -o $@ $<
473 eh_test_b.o: eh_test_b.cc
474 $(CXXCOMPILE) -O0 -c -o $@ $<
475 eh_test: eh_test_a.o eh_test_b.o gcctestdir/ld
476 $(CXXLINK_S) eh_test_a.o eh_test_b.o
478 check_SCRIPTS += eh_test_2.sh
479 check_DATA += eh_test_2.sects
480 MOSTLYCLEANFILES += eh_test_2 eh_test_2.sects
481 eh_test_r.o: eh_test_a.o eh_test_b.o gcctestdir/ld
482 gcctestdir/ld -r -o $@ eh_test_a.o eh_test_b.o
483 eh_test_2: eh_test_r.o gcctestdir/ld
484 $(CXXLINK_S) -Wl,--eh-frame-hdr eh_test_r.o
485 eh_test_2.sects: eh_test_2
486 $(TEST_READELF) -SW $< >$@ 2>/dev/null
489 check_PROGRAMS += basic_static_test
490 basic_static_test: basic_test.o gcctestdir/ld
491 $(CXXLINK) -static basic_test.o
494 basic_pic_test.o: basic_test.cc
495 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
496 basic_pic_test: basic_pic_test.o gcctestdir/ld
497 $(CXXLINK) basic_pic_test.o
500 check_PROGRAMS += basic_static_pic_test
501 basic_static_pic_test: basic_pic_test.o gcctestdir/ld
502 $(CXXLINK) -static basic_pic_test.o
505 check_PROGRAMS += basic_pie_test
506 basic_pie_test.o: basic_test.cc
507 $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
508 basic_pie_test: basic_pie_test.o gcctestdir/ld
509 $(CXXLINK) -pie basic_pie_test.o
512 check_PROGRAMS += basic_threads_test
513 basic_threads_test: basic_test.o gcctestdir/ld
514 $(CXXLINK) -Wl,--threads basic_test.o
517 check_PROGRAMS += constructor_test
518 constructor_test_SOURCES = constructor_test.cc
519 constructor_test_DEPENDENCIES = gcctestdir/ld
520 constructor_test_LDADD =
523 check_PROGRAMS += constructor_static_test
524 constructor_static_test_SOURCES = $(constructor_test_SOURCES)
525 constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
526 constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
527 constructor_static_test_LDADD = $(constructor_test_LDADD)
530 check_PROGRAMS += two_file_test
531 check_PROGRAMS += two_file_pic_test
532 two_file_test_SOURCES = \
534 two_file_test_1b.cc \
536 two_file_test_main.cc \
538 two_file_test_DEPENDENCIES = gcctestdir/ld
539 two_file_test_LDADD =
542 check_PROGRAMS += two_file_static_test
543 two_file_static_test_SOURCES = $(two_file_test_SOURCES)
544 two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
545 two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
546 two_file_static_test_LDADD = $(two_file_test_LDADD)
549 two_file_pic_test_SOURCES = two_file_test_main.cc
550 two_file_pic_test_DEPENDENCIES = \
551 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
552 two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
555 check_PROGRAMS += two_file_shared_1_test
556 check_PROGRAMS += two_file_shared_2_test
557 check_PROGRAMS += two_file_shared_1_pic_2_test
558 check_PROGRAMS += two_file_shared_2_pic_1_test
559 check_PROGRAMS += two_file_same_shared_test
560 check_PROGRAMS += two_file_separate_shared_12_test
561 check_PROGRAMS += two_file_separate_shared_21_test
562 two_file_test_1_pic.o: two_file_test_1.cc
563 $(CXXCOMPILE) -c -fpic -o $@ $<
564 two_file_test_1b_pic.o: two_file_test_1b.cc
565 $(CXXCOMPILE) -c -fpic -o $@ $<
566 two_file_test_2_pic.o: two_file_test_2.cc
567 $(CXXCOMPILE) -c -fpic -o $@ $<
568 two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
569 $(CXXLINK) -shared two_file_test_1_pic.o two_file_test_1b_pic.o
570 two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
571 $(CXXLINK) -shared two_file_test_2_pic.o
572 two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
573 $(CXXLINK) -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
575 two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
576 two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
577 two_file_shared_1_test_LDFLAGS = -Wl,-R,.
578 two_file_shared_1_test_LDADD = two_file_shared_1.so
580 two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
581 two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
582 two_file_shared_2_test_LDFLAGS = -Wl,-R,.
583 two_file_shared_2_test_LDADD = two_file_shared_2.so
585 two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
586 two_file_shared_1_pic_2_test_DEPENDENCIES = \
587 gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o
588 two_file_shared_1_pic_2_test_LDFLAGS = -Wl,-R,.
589 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
591 two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
592 two_file_shared_2_pic_1_test_DEPENDENCIES = \
593 gcctestdir/ld two_file_shared_1.so two_file_test_2_pic.o
594 two_file_shared_2_pic_1_test_LDFLAGS = -Wl,-R,.
595 two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
597 two_file_same_shared_test_SOURCES = two_file_test_main.cc
598 two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
599 two_file_same_shared_test_LDFLAGS = -Wl,-R,.
600 two_file_same_shared_test_LDADD = two_file_shared.so
602 two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
603 two_file_separate_shared_12_test_DEPENDENCIES = \
604 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
605 two_file_separate_shared_12_test_LDFLAGS = -Wl,-R,.
606 two_file_separate_shared_12_test_LDADD = \
607 two_file_shared_1.so two_file_shared_2.so
609 two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
610 two_file_separate_shared_21_test_DEPENDENCIES = \
611 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
612 two_file_separate_shared_21_test_LDFLAGS = -Wl,-R,.
613 two_file_separate_shared_21_test_LDADD = \
614 two_file_shared_2.so two_file_shared_1.so
616 check_PROGRAMS += two_file_relocatable_test
617 two_file_relocatable_test_SOURCES = two_file_test_main.cc
618 two_file_relocatable_test_DEPENDENCIES = \
619 gcctestdir/ld two_file_relocatable.o
620 two_file_relocatable_test_LDFLAGS = -Wl,-R,.
621 two_file_relocatable_test_LDADD = two_file_relocatable.o
622 two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
623 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
625 check_PROGRAMS += two_file_pie_test
626 two_file_test_1_pie.o: two_file_test_1.cc
627 $(CXXCOMPILE) -c -fpie -o $@ $<
628 two_file_test_1b_pie.o: two_file_test_1b.cc
629 $(CXXCOMPILE) -c -fpie -o $@ $<
630 two_file_test_2_pie.o: two_file_test_2.cc
631 $(CXXCOMPILE) -c -fpie -o $@ $<
632 two_file_test_main_pie.o: two_file_test_main.cc
633 $(CXXCOMPILE) -c -fpie -o $@ $<
634 two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
635 two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
636 $(CXXLINK) -pie two_file_test_1_pie.o two_file_test_1b_pie.o two_file_test_2_pie.o two_file_test_main_pie.o
638 check_PROGRAMS += pie_copyrelocs_test
639 pie_copyrelocs_test_SOURCES = pie_copyrelocs_test.cc
640 pie_copyrelocs_test_DEPENDENCIES = gcctestdir/ld pie_copyrelocs_shared_test.so
641 pie_copyrelocs_test_CXXFLAGS = -fno-exceptions -fno-asynchronous-unwind-tables
642 pie_copyrelocs_test_LDFLAGS = -Wl,-R,. -pie
643 pie_copyrelocs_test_LDADD = pie_copyrelocs_shared_test.so
644 pie_copyrelocs_shared_test.o: pie_copyrelocs_shared_test.cc
645 $(CXXCOMPILE) -O2 -fpic -c -o $@ $<
646 pie_copyrelocs_shared_test.so: pie_copyrelocs_shared_test.o gcctestdir/ld
647 $(CXXLINK) -shared pie_copyrelocs_shared_test.o
649 check_PROGRAMS += weak_unresolved_symbols_test
650 weak_unresolved_symbols_test_SOURCES = weak_unresolved_symbols_test.cc
651 weak_unresolved_symbols_test_CXXFLAGS = -fPIE
652 weak_unresolved_symbols_test_LDFLAGS = -pie -Wl,--weak-unresolved-symbols
654 check_SCRIPTS += two_file_shared.sh
655 check_DATA += two_file_shared.dbg
656 MOSTLYCLEANFILES += two_file_shared.dbg
657 two_file_shared.dbg: two_file_shared.so
658 $(TEST_READELF) -w $< >$@ 2>/dev/null
660 # The nonpic tests will fail on platforms which can not put non-PIC
661 # code into shared libraries, so we just don't run them in that case.
662 if FN_PTRS_IN_SO_WITHOUT_PIC
664 check_PROGRAMS += two_file_shared_1_nonpic_test
665 check_PROGRAMS += two_file_shared_2_nonpic_test
666 check_PROGRAMS += two_file_same_shared_nonpic_test
667 check_PROGRAMS += two_file_separate_shared_12_nonpic_test
668 check_PROGRAMS += two_file_separate_shared_21_nonpic_test
669 check_PROGRAMS += two_file_mixed_shared_test
670 check_PROGRAMS += two_file_mixed_2_shared_test
671 two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
672 $(CXXLINK) -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext
673 two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
674 $(CXXLINK) -shared two_file_test_2.o
675 two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
676 $(CXXLINK) -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext
677 two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
678 $(CXXLINK) -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext
679 two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
680 $(CXXLINK) -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext
682 two_file_shared_1_nonpic_test_SOURCES = \
683 two_file_test_2.cc two_file_test_main.cc
684 two_file_shared_1_nonpic_test_DEPENDENCIES = \
685 gcctestdir/ld two_file_shared_1_nonpic.so
686 two_file_shared_1_nonpic_test_LDFLAGS = -Wl,-R,.
687 two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
689 two_file_shared_2_nonpic_test_SOURCES = \
690 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
691 two_file_shared_2_nonpic_test_DEPENDENCIES = \
692 gcctestdir/ld two_file_shared_2_nonpic.so
693 two_file_shared_2_nonpic_test_LDFLAGS = -Wl,-R,.
694 two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
696 two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
697 two_file_same_shared_nonpic_test_DEPENDENCIES = \
698 gcctestdir/ld two_file_shared_nonpic.so
699 two_file_same_shared_nonpic_test_LDFLAGS = -Wl,-R,.
700 two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
702 two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
703 two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
704 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
705 two_file_separate_shared_12_nonpic_test_LDFLAGS = -Wl,-R,.
706 two_file_separate_shared_12_nonpic_test_LDADD = \
707 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
709 two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
710 two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
711 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
712 two_file_separate_shared_21_nonpic_test_LDFLAGS = -Wl,-R,.
713 two_file_separate_shared_21_nonpic_test_LDADD = \
714 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
716 two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
717 two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
718 two_file_mixed_shared_test_LDFLAGS = -Wl,-R,.
719 two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
721 two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
722 two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
723 two_file_mixed_2_shared_test_LDFLAGS = -Wl,-R,.
724 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
726 check_PROGRAMS += two_file_mixed_pie_test
727 two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
728 two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
729 $(CXXLINK) -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so
731 endif FN_PTRS_IN_SO_WITHOUT_PIC
733 check_PROGRAMS += two_file_strip_test
734 two_file_strip_test: two_file_test
735 $(TEST_STRIP) -o two_file_strip_test two_file_test
737 check_PROGRAMS += two_file_same_shared_strip_test
738 two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
739 two_file_same_shared_strip_test_DEPENDENCIES = \
740 gcctestdir/ld two_file_shared_strip.so
741 two_file_same_shared_strip_test_LDFLAGS = -Wl,-R.
742 two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
743 two_file_shared_strip.so: two_file_shared.so
744 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
746 check_PROGRAMS += common_test_1
747 common_test_1_SOURCES = common_test_1.c
748 common_test_1_DEPENDENCIES = gcctestdir/ld
749 common_test_1_LDADD =
750 common_test_1.o: common_test_1.c
751 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
753 check_PROGRAMS += common_test_2
754 common_test_2_SOURCES = common_test_1.c
755 common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
756 common_test_2_LDFLAGS = -Wl,-R,.
757 common_test_2_LDADD = common_test_2.so common_test_3.so
758 common_test_2.o: common_test_2.c
759 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
760 common_test_2_pic.o: common_test_2.c
761 $(COMPILE) -c -fpic $(COMMON_TEST_C_CFLAGS) -o $@ $<
762 common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld
763 $(LINK) -shared common_test_2_pic.o common_test_3.so
764 common_test_3.o: common_test_3.c
765 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
766 common_test_3_pic.o: common_test_3.c
767 $(COMPILE) -c -fpic $(COMMON_TEST_C_CFLAGS) -o $@ $<
768 common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld
769 $(LINK) -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script
771 check_PROGRAMS += exception_test
772 check_PROGRAMS += exception_shared_1_test
773 check_PROGRAMS += exception_shared_2_test
774 check_PROGRAMS += exception_same_shared_test
775 check_PROGRAMS += exception_separate_shared_12_test
776 check_PROGRAMS += exception_separate_shared_21_test
777 exception_test_1_pic.o: exception_test_1.cc
778 $(CXXCOMPILE) -c -fpic -o $@ $<
779 exception_test_2_pic.o: exception_test_2.cc
780 $(CXXCOMPILE) -c -fpic -o $@ $<
781 exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
782 $(CXXLINK) -shared exception_test_1_pic.o
783 exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
784 $(CXXLINK) -shared exception_test_2_pic.o
785 exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
786 $(CXXLINK) -shared exception_test_1_pic.o exception_test_2_pic.o
788 exception_test_SOURCES = \
789 exception_test_main.cc \
790 exception_test_1.cc \
791 exception_test_2.cc \
793 exception_test_DEPENDENCIES = gcctestdir/ld
794 exception_test_LDADD =
797 check_PROGRAMS += exception_static_test
798 exception_static_test_SOURCES = $(exception_test_SOURCES)
799 exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
800 exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
801 exception_static_test_LDADD = $(exception_test_LDADD)
804 exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
805 exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
806 exception_shared_1_test_LDFLAGS = -Wl,-R,.
807 exception_shared_1_test_LDADD = exception_shared_1.so
809 exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
810 exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
811 exception_shared_2_test_LDFLAGS = -Wl,-R,.
812 exception_shared_2_test_LDADD = exception_shared_2.so
814 exception_same_shared_test_SOURCES = exception_test_main.cc
815 exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
816 exception_same_shared_test_LDFLAGS = -Wl,-R,.
817 exception_same_shared_test_LDADD = exception_shared.so
819 exception_separate_shared_12_test_SOURCES = exception_test_main.cc
820 exception_separate_shared_12_test_DEPENDENCIES = \
821 gcctestdir/ld exception_shared_1.so exception_shared_2.so
822 exception_separate_shared_12_test_LDFLAGS = -Wl,-R,. -Wl,--no-as-needed
823 exception_separate_shared_12_test_LDADD = \
824 exception_shared_1.so exception_shared_2.so
826 exception_separate_shared_21_test_SOURCES = exception_test_main.cc
827 exception_separate_shared_21_test_DEPENDENCIES = \
828 gcctestdir/ld exception_shared_1.so exception_shared_2.so
829 exception_separate_shared_21_test_LDFLAGS = -Wl,-R,. -Wl,--no-as-needed
830 exception_separate_shared_21_test_LDADD = \
831 exception_shared_2.so exception_shared_1.so
834 check_PROGRAMS += weak_test
835 weak_test_SOURCES = weak_test.cc
836 weak_test_DEPENDENCIES = gcctestdir/ld
839 check_PROGRAMS += weak_undef_test
840 MOSTLYCLEANFILES += alt/weak_undef_lib.so
841 weak_undef_test_SOURCES = weak_undef_test.cc
842 weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
843 weak_undef_test_LDFLAGS = -Wl,-R,alt
844 weak_undef_test_LDADD = -L . weak_undef_lib.so
845 weak_undef_file1.o: weak_undef_file1.cc
846 $(CXXCOMPILE) -c -fpic -o $@ $<
847 weak_undef_file2.o: weak_undef_file2.cc
848 $(CXXCOMPILE) -c -fpic -o $@ $<
849 weak_undef_lib.so: weak_undef_file1.o gcctestdir/ld
850 $(CXXLINK) -shared weak_undef_file1.o
851 alt/weak_undef_lib.so: weak_undef_file2.o gcctestdir/ld
852 test -d alt || mkdir -p alt
853 $(CXXLINK) -shared weak_undef_file2.o
855 check_PROGRAMS += weak_undef_test_2
856 weak_undef_test_2_SOURCES = weak_undef_test_2.cc
857 weak_undef_test_2_DEPENDENCIES = gcctestdir/ld libweak_undef_2.a
858 weak_undef_test_2_LDFLAGS = -u weak_undef_2
859 weak_undef_test_2_LDADD = -L . -lweak_undef_2
860 MOSTLYCLEANFILES += libweak_undef_2.a
861 libweak_undef_2.a: weak_undef_file3.o weak_undef_file4.o
863 weak_undef_file3.o: weak_undef_file3.cc
864 $(CXXCOMPILE) -c -o $@ $<
865 weak_undef_file4.o: weak_undef_file4.cc
866 $(CXXCOMPILE) -c -o $@ $<
868 check_PROGRAMS += weak_undef_test_3
869 weak_undef_test_3_SOURCES = weak_undef_test_3.c
870 weak_undef_test_3_DEPENDENCIES = gcctestdir/ld
871 weak_undef_test_3_CFLAGS = -fPIE
872 weak_undef_test_3_LDFLAGS = -pie
874 check_PROGRAMS += weak_undef_test_4
875 weak_undef_test_4_SOURCES = weak_undef_test_4.c
876 weak_undef_test_4_DEPENDENCIES = gcctestdir/ld weak_undef_lib_4.so
877 weak_undef_test_4_LDADD = weak_undef_lib_4.so
878 weak_undef_test_4_LDFLAGS = -Wl,-R,.
879 MOSTLYCLEANFILES += weak_undef_lib_4.o weak_undef_lib_4.so
880 weak_undef_lib_4.o: weak_undef_lib_4.c
881 $(COMPILE) -fPIC -c -o $@ $<
882 weak_undef_lib_4.so: gcctestdir/ld weak_undef_lib_4.o
883 $(LINK) -shared -o $@ weak_undef_lib_4.o
885 if FN_PTRS_IN_SO_WITHOUT_PIC
886 check_PROGRAMS += weak_undef_nonpic_test
887 MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so
888 weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
889 weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
890 weak_undef_nonpic_test_LDFLAGS = -Wl,-R,alt
891 weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
892 weak_undef_file1_nonpic.o: weak_undef_file1.cc
893 $(CXXCOMPILE) -c -o $@ $<
894 weak_undef_file2_nonpic.o: weak_undef_file2.cc
895 $(CXXCOMPILE) -c -o $@ $<
896 weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
897 $(CXXLINK) -shared weak_undef_file1_nonpic.o -Wl,-z,notext
898 alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
899 test -d alt || mkdir -p alt
900 $(CXXLINK) -shared weak_undef_file2_nonpic.o -Wl,-z,notext
901 endif FN_PTRS_IN_SO_WITHOUT_PIC
904 check_PROGRAMS += weak_alias_test
905 weak_alias_test_SOURCES = weak_alias_test_main.cc
906 weak_alias_test_DEPENDENCIES = \
907 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
908 weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so
909 weak_alias_test_LDFLAGS = -Wl,-R,.
910 weak_alias_test_LDADD = \
911 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
912 weak_alias_test_4.so weak_alias_test_5.so
913 weak_alias_test_1_pic.o: weak_alias_test_1.cc
914 $(CXXCOMPILE) -c -fpic -o $@ $<
915 weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
916 $(CXXLINK) -shared weak_alias_test_1_pic.o
917 weak_alias_test_2_pic.o: weak_alias_test_2.cc
918 $(CXXCOMPILE) -c -fpic -o $@ $<
919 weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
920 $(CXXLINK) -shared weak_alias_test_2_pic.o
921 weak_alias_test_3.o: weak_alias_test_3.cc
922 $(CXXCOMPILE) -c -o $@ $<
923 weak_alias_test_4_pic.o: weak_alias_test_4.cc
924 $(CXXCOMPILE) -c -fpic -o $@ $<
925 weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
926 $(CXXLINK) -shared weak_alias_test_4_pic.o
927 weak_alias_test_5_pic.o: weak_alias_test_5.cc
928 $(CXXCOMPILE) -c -fpic -o $@ $<
929 weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld
930 $(CXXLINK) -shared weak_alias_test_5_pic.o \
931 -Wl,--version-script,$(srcdir)/weak_alias_test.script
933 check_SCRIPTS += weak_plt.sh
934 check_PROGRAMS += weak_plt
935 check_DATA += weak_plt_shared.so
936 weak_plt_main_pic.o: weak_plt_main.cc
937 $(CXXCOMPILE) -c -fpic -o $@ $<
938 weak_plt: weak_plt_main_pic.o gcctestdir/ld
939 $(CXXLINK) weak_plt_main_pic.o
940 weak_plt_shared_pic.o: weak_plt_shared.cc
941 $(CXXCOMPILE) -c -fpic -o $@ $<
942 weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
943 $(CXXLINK) -shared weak_plt_shared_pic.o
945 check_PROGRAMS += copy_test
946 copy_test_SOURCES = copy_test.cc
947 copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
948 copy_test_LDFLAGS = -Wl,-R,.
949 copy_test_LDADD = copy_test_1.so copy_test_2.so
950 copy_test_1_pic.o: copy_test_1.cc
951 $(CXXCOMPILE) -c -fpic -o $@ $<
952 copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
953 $(CXXLINK) -shared copy_test_1_pic.o
954 copy_test_2_pic.o: copy_test_2.cc
955 $(CXXCOMPILE) -c -fpic -o $@ $<
956 copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
957 $(CXXLINK) -shared copy_test_2_pic.o
959 check_PROGRAMS += copy_test_relro
960 copy_test_relro_SOURCES = copy_test_relro.cc
961 copy_test_relro_DEPENDENCIES = gcctestdir/ld copy_test_relro_1.so
962 copy_test_relro_LDFLAGS = -Wl,-R,. -Wl,-z,relro
963 copy_test_relro_LDADD = copy_test_relro_1.so
964 copy_test_relro_1_pic.o: copy_test_relro_1.cc
965 $(CXXCOMPILE) -c -fpic -o $@ $<
966 copy_test_relro_1.so: gcctestdir/ld copy_test_relro_1_pic.o
967 $(CXXLINK) -shared -Wl,-z,relro copy_test_relro_1_pic.o
969 if !DEFAULT_TARGET_POWERPC
970 check_SCRIPTS += copy_test_protected.sh
971 check_DATA += copy_test_protected.err
972 MOSTLYCLEANFILES += copy_test_protected.err
973 copy_test_protected.err: copy_test_protected.o copy_test_2.so gcctestdir/ld
974 @echo $(CXXLINK) -o copy_test_protected copy_test_protected.o copy_test_2.so -Wl,-R,. "2>$@"
975 @if $(CXXLINK) -o copy_test_protected copy_test_protected.o copy_test_2.so -Wl,-R,. 2>$@; \
977 echo 1>&2 "Link of copy_test_protected should have failed"; \
985 check_PROGRAMS += tls_test
986 check_PROGRAMS += tls_pic_test
987 check_PROGRAMS += tls_pie_test
988 check_PROGRAMS += tls_pie_pic_test
989 check_PROGRAMS += tls_shared_test
990 check_PROGRAMS += tls_shared_ie_test
991 check_PROGRAMS += tls_shared_gd_to_ie_test
992 tls_test_pic.o: tls_test.cc
993 $(CXXCOMPILE) -c -fpic -o $@ $<
994 tls_test_file2_pic.o: tls_test_file2.cc
995 $(CXXCOMPILE) -c -fpic -o $@ $<
996 tls_test_c_pic.o: tls_test_c.c
997 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
998 tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
999 $(CXXLINK) -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
1000 tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
1001 $(CXXLINK) -shared tls_test_file2_pic.o
1003 tls_test_pic_ie.o: tls_test.cc
1004 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
1005 tls_test_file2_pic_ie.o: tls_test_file2.cc
1006 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
1007 tls_test_c_pic_ie.o: tls_test_c.c
1008 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
1009 tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
1010 $(CXXLINK) -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
1012 tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
1013 tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
1014 tls_test_LDFLAGS = $(THREADFLAGS)
1015 tls_test_LDADD = tls_test_c.o $(THREADLIBS)
1016 tls_test_c.o: tls_test_c.c
1017 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
1019 tls_pic_test_SOURCES = tls_test_main.cc
1020 tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
1022 tls_pic_test_LDFLAGS = $(THREADFLAGS)
1023 tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
1026 tls_test_main_pie.o: tls_test_main.cc tls_test.h
1027 $(CXXCOMPILE) -c -fpie -o $@ $<
1028 tls_test_pie.o: tls_test.cc tls_test.h
1029 $(CXXCOMPILE) -c -fpie -o $@ $<
1030 tls_test_file2_pie.o: tls_test_file2.cc tls_test.h
1031 $(CXXCOMPILE) -c -fpie -o $@ $<
1032 tls_test_c_pie.o: tls_test_c.c
1033 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
1034 tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \
1035 tls_test_c_pie.o gcctestdir/ld
1036 $(CXXLINK) $(THREADFLAGS) -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o $(THREADLIBS)
1038 check_SCRIPTS += tls_pie_test.sh
1039 check_DATA += tls_pie_test.stdout
1040 tls_pie_test.stdout: tls_pie_test
1041 $(TEST_READELF) -rW $< > $@ 2>/dev/null
1043 tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \
1044 tls_test_c_pic.o gcctestdir/ld
1045 $(CXXLINK) $(THREADFLAGS) -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o $(THREADLIBS)
1047 tls_shared_test_SOURCES = tls_test_main.cc
1048 tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
1049 tls_shared_test_LDFLAGS = -Wl,-R,. $(THREADFLAGS)
1050 tls_shared_test_LDADD = tls_test_shared.so $(THREADLIBS)
1052 tls_shared_ie_test_SOURCES = tls_test_main.cc
1053 tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
1054 tls_shared_ie_test_LDFLAGS = -Wl,-R,. $(THREADFLAGS)
1055 tls_shared_ie_test_LDADD = tls_test_ie_shared.so $(THREADLIBS)
1057 tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
1058 tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
1059 tls_test_c_pic.o tls_test_shared2.so
1060 tls_shared_gd_to_ie_test_LDFLAGS = -Wl,-R,. $(THREADFLAGS)
1061 tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
1062 tls_test_shared2.so $(THREADLIBS)
1066 check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
1068 tls_test_gnu2.o: tls_test.cc gcctestdir/as
1069 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
1070 tls_test_file2_gnu2.o: tls_test_file2.cc gcctestdir/as
1071 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
1072 tls_test_c_gnu2.o: tls_test_c.c gcctestdir/as
1073 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
1074 tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
1075 $(CXXLINK) -shared tls_test_file2_gnu2.o
1077 tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
1078 tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
1079 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
1080 tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Wl,-R,. $(THREADFLAGS)
1081 tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
1082 tls_test_gnu2_shared2.so $(THREADLIBS)
1086 check_PROGRAMS += tls_shared_gnu2_test
1088 tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
1089 $(CXXLINK) -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
1091 tls_shared_gnu2_test_SOURCES = tls_test_main.cc
1092 tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
1093 tls_shared_gnu2_test_LDFLAGS = -Wl,-R,. $(THREADFLAGS)
1094 tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so $(THREADLIBS)
1096 endif TLS_DESCRIPTORS
1098 endif TLS_GNU2_DIALECT
1102 check_PROGRAMS += tls_static_test
1103 check_PROGRAMS += tls_static_pic_test
1105 tls_static_test_SOURCES = $(tls_test_SOURCES)
1106 tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
1107 tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
1108 tls_static_test_LDADD = $(tls_test_LDADD)
1110 tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
1111 tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
1112 tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
1113 tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
1117 if FN_PTRS_IN_SO_WITHOUT_PIC
1118 check_PROGRAMS += tls_shared_nonpic_test
1119 tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
1120 $(CXXLINK) -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext
1122 tls_shared_nonpic_test_SOURCES = tls_test_main.cc
1123 tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
1124 tls_shared_nonpic_test_LDFLAGS = -Wl,-R,. $(THREADFLAGS)
1125 tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so $(THREADLIBS)
1126 endif FN_PTRS_IN_SO_WITHOUT_PIC
1130 if DEFAULT_TARGET_X86_64
1132 check_SCRIPTS += x86_64_mov_to_lea.sh
1133 check_DATA += x86_64_mov_to_lea1.stdout x86_64_mov_to_lea2.stdout \
1134 x86_64_mov_to_lea3.stdout x86_64_mov_to_lea4.stdout \
1135 x86_64_mov_to_lea5.stdout x86_64_mov_to_lea6.stdout \
1136 x86_64_mov_to_lea7.stdout x86_64_mov_to_lea8.stdout \
1137 x86_64_mov_to_lea9.stdout x86_64_mov_to_lea10.stdout \
1138 x86_64_mov_to_lea11.stdout x86_64_mov_to_lea12.stdout \
1139 x86_64_mov_to_lea13.stdout x86_64_mov_to_lea14.stdout \
1140 x86_64_mov_to_lea15.stdout x86_64_mov_to_lea16.stdout
1142 MOSTLYCLEANFILES += x86_64_mov_to_lea1 x86_64_mov_to_lea2 \
1143 x86_64_mov_to_lea3 x86_64_mov_to_lea4 x86_64_mov_to_lea5 \
1144 x86_64_mov_to_lea6 x86_64_mov_to_lea7 x86_64_mov_to_lea8 \
1145 x86_64_mov_to_lea9 x86_64_mov_to_lea10 x86_64_mov_to_lea11 \
1146 x86_64_mov_to_lea12 x86_64_mov_to_lea13 x86_64_mov_to_lea14 \
1147 x86_64_mov_to_lea15 x86_64_mov_to_lea16
1149 x86_64_mov_to_lea1.o: x86_64_mov_to_lea1.s
1150 $(TEST_AS) --64 -o $@ $<
1151 x86_64_mov_to_lea2.o: x86_64_mov_to_lea1.s
1152 $(TEST_AS) --x32 -o $@ $<
1153 x86_64_mov_to_lea3.o: x86_64_mov_to_lea2.s
1154 $(TEST_AS) --x32 -o $@ $<
1155 x86_64_mov_to_lea4.o: x86_64_mov_to_lea2.s
1156 $(TEST_AS) --64 -o $@ $<
1157 x86_64_mov_to_lea5.o: x86_64_mov_to_lea3.s
1158 $(TEST_AS) --x32 -mrelax-relocations=yes -o $@ $<
1159 x86_64_mov_to_lea6.o: x86_64_mov_to_lea3.s
1160 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1161 x86_64_mov_to_lea7.o: x86_64_mov_to_lea4.s
1162 $(TEST_AS) --x32 -o $@ $<
1163 x86_64_mov_to_lea8.o: x86_64_mov_to_lea4.s
1164 $(TEST_AS) --64 -o $@ $<
1165 x86_64_mov_to_lea9.o: x86_64_mov_to_lea5.s
1166 $(TEST_AS) --x32 -mrelax-relocations=yes -o $@ $<
1167 x86_64_mov_to_lea10.o: x86_64_mov_to_lea5.s
1168 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1169 x86_64_mov_to_lea1: x86_64_mov_to_lea1.o ../ld-new
1170 ../ld-new -Bsymbolic -shared -melf_x86_64 -o $@ $<
1171 x86_64_mov_to_lea2: x86_64_mov_to_lea1.o ../ld-new
1172 ../ld-new -pie -melf_x86_64 -o $@ $<
1173 x86_64_mov_to_lea3: x86_64_mov_to_lea1.o ../ld-new
1174 ../ld-new -melf_x86_64 -o $@ $<
1175 x86_64_mov_to_lea4: x86_64_mov_to_lea2.o ../ld-new
1176 ../ld-new -Bsymbolic -shared -melf32_x86_64 -o $@ $<
1177 x86_64_mov_to_lea5: x86_64_mov_to_lea2.o ../ld-new
1178 ../ld-new -pie -melf32_x86_64 -o $@ $<
1179 x86_64_mov_to_lea6: x86_64_mov_to_lea2.o ../ld-new
1180 ../ld-new -melf32_x86_64 -o $@ $<
1181 x86_64_mov_to_lea7: x86_64_mov_to_lea3.o ../ld-new
1182 ../ld-new -melf32_x86_64 -pie -o $@ $<
1183 x86_64_mov_to_lea8: x86_64_mov_to_lea4.o ../ld-new
1184 ../ld-new -melf_x86_64 -pie -o $@ $<
1185 x86_64_mov_to_lea9: x86_64_mov_to_lea5.o ../ld-new
1186 ../ld-new -melf32_x86_64 -o $@ $<
1187 x86_64_mov_to_lea10: x86_64_mov_to_lea6.o ../ld-new
1188 ../ld-new -melf_x86_64 -o $@ $<
1189 x86_64_mov_to_lea11: x86_64_mov_to_lea2.o ../ld-new
1190 ../ld-new -melf32_x86_64 -shared -o $@ $<
1191 x86_64_mov_to_lea12: x86_64_mov_to_lea1.o ../ld-new
1192 ../ld-new -melf_x86_64 -shared -o $@ $<
1193 x86_64_mov_to_lea13: x86_64_mov_to_lea7.o ../ld-new
1194 ../ld-new -melf32_x86_64 -shared -o $@ $<
1195 x86_64_mov_to_lea14: x86_64_mov_to_lea8.o ../ld-new
1196 ../ld-new -melf_x86_64 -shared -o $@ $<
1197 x86_64_mov_to_lea15: x86_64_mov_to_lea9.o ../ld-new
1198 ../ld-new -melf32_x86_64 -shared -o $@ $<
1199 x86_64_mov_to_lea16: x86_64_mov_to_lea10.o ../ld-new
1200 ../ld-new -melf_x86_64 -shared -o $@ $<
1201 x86_64_mov_to_lea1.stdout: x86_64_mov_to_lea1
1202 $(TEST_OBJDUMP) -dw $< > $@
1203 x86_64_mov_to_lea2.stdout: x86_64_mov_to_lea2
1204 $(TEST_OBJDUMP) -dw $< > $@
1205 x86_64_mov_to_lea3.stdout: x86_64_mov_to_lea3
1206 $(TEST_OBJDUMP) -dw $< > $@
1207 x86_64_mov_to_lea4.stdout: x86_64_mov_to_lea4
1208 $(TEST_OBJDUMP) -dw $< > $@
1209 x86_64_mov_to_lea5.stdout: x86_64_mov_to_lea5
1210 $(TEST_OBJDUMP) -dw $< > $@
1211 x86_64_mov_to_lea6.stdout: x86_64_mov_to_lea6
1212 $(TEST_OBJDUMP) -dw $< > $@
1213 x86_64_mov_to_lea7.stdout: x86_64_mov_to_lea7
1214 $(TEST_OBJDUMP) -dw $< > $@
1215 x86_64_mov_to_lea8.stdout: x86_64_mov_to_lea8
1216 $(TEST_OBJDUMP) -dw $< > $@
1217 x86_64_mov_to_lea9.stdout: x86_64_mov_to_lea9
1218 $(TEST_OBJDUMP) -dw $< > $@
1219 x86_64_mov_to_lea10.stdout: x86_64_mov_to_lea10
1220 $(TEST_OBJDUMP) -dw $< > $@
1221 x86_64_mov_to_lea11.stdout: x86_64_mov_to_lea11
1222 $(TEST_OBJDUMP) -dw $< > $@
1223 x86_64_mov_to_lea12.stdout: x86_64_mov_to_lea12
1224 $(TEST_OBJDUMP) -dw $< > $@
1225 x86_64_mov_to_lea13.stdout: x86_64_mov_to_lea13
1226 $(TEST_OBJDUMP) -dw $< > $@
1227 x86_64_mov_to_lea14.stdout: x86_64_mov_to_lea14
1228 $(TEST_OBJDUMP) -dw $< > $@
1229 x86_64_mov_to_lea15.stdout: x86_64_mov_to_lea15
1230 $(TEST_OBJDUMP) -dw $< > $@
1231 x86_64_mov_to_lea16.stdout: x86_64_mov_to_lea16
1232 $(TEST_OBJDUMP) -dw $< > $@
1234 check_SCRIPTS += x86_64_indirect_call_to_direct.sh
1235 check_DATA += x86_64_indirect_call_to_direct1.stdout \
1236 x86_64_indirect_jump_to_direct1.stdout
1237 MOSTLYCLEANFILES += x86_64_indirect_call_to_direct1 \
1238 x86_64_indirect_jump_to_direct1
1240 x86_64_indirect_call_to_direct1.o: x86_64_indirect_call_to_direct1.s
1241 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1242 x86_64_indirect_call_to_direct1: x86_64_indirect_call_to_direct1.o gcctestdir/ld
1243 gcctestdir/ld -o $@ $<
1244 x86_64_indirect_call_to_direct1.stdout: x86_64_indirect_call_to_direct1
1245 $(TEST_OBJDUMP) -dw $< > $@
1246 x86_64_indirect_jump_to_direct1.o: x86_64_indirect_jump_to_direct1.s
1247 $(TEST_AS) --64 -mrelax-relocations=yes -o $@ $<
1248 x86_64_indirect_jump_to_direct1: x86_64_indirect_jump_to_direct1.o gcctestdir/ld
1249 gcctestdir/ld -o $@ $<
1250 x86_64_indirect_jump_to_direct1.stdout: x86_64_indirect_jump_to_direct1
1251 $(TEST_OBJDUMP) -dw $< > $@
1253 check_SCRIPTS += x86_64_gd_to_le.sh
1254 check_DATA += x86_64_gd_to_le.stdout
1255 MOSTLYCLEANFILES += x86_64_gd_to_le
1257 x86_64_gd_to_le.o: x86_64_gd_to_le.s
1258 $(TEST_AS) --64 -o $@ $<
1259 x86_64_gd_to_le: x86_64_gd_to_le.o gcctestdir/ld
1260 gcctestdir/ld -o $@ $<
1261 x86_64_gd_to_le.stdout: x86_64_gd_to_le
1262 $(TEST_OBJDUMP) -dw $< > $@
1264 check_SCRIPTS += x86_64_ie_to_le.sh
1265 check_DATA += x86_64_ie_to_le.stdout
1266 MOSTLYCLEANFILES += x86_64_ie_to_le
1268 x86_64_ie_to_le.o: x86_64_ie_to_le.s
1269 $(TEST_AS) --64 -o $@ $<
1270 x86_64_ie_to_le: x86_64_ie_to_le.o gcctestdir/ld
1271 gcctestdir/ld -o $@ $<
1272 x86_64_ie_to_le.stdout: x86_64_ie_to_le
1273 $(TEST_OBJDUMP) -dw $< > $@
1275 check_SCRIPTS += x86_64_overflow_pc32.sh
1276 check_DATA += x86_64_overflow_pc32.err
1277 MOSTLYCLEANFILES += x86_64_overflow_pc32.err
1278 x86_64_overflow_pc32.o: x86_64_overflow_pc32.s
1280 x86_64_overflow_pc32.err: x86_64_overflow_pc32.o gcctestdir/ld
1281 @echo gcctestdir/ld -e bar -Tdata=0x81000000 -o x86_64_overflow_pc32 x86_64_overflow_pc32.o "2>$@"
1282 @if gcctestdir/ld -e bar -Tdata=0x81000000 -o x86_64_overflow_pc32 x86_64_overflow_pc32.o 2>$@; \
1284 echo 1>&2 "Link of x86_64_overflow_pc32 should have failed"; \
1289 check_PROGRAMS += pr17704a_test
1290 pr17704a_test.o: pr17704a_test.s
1291 $(TEST_AS) --64 -o $@ $<
1292 pr17704a_test: pr17704a_test.o gcctestdir/ld
1293 gcctestdir/ld --icf=all -o $@ $<
1295 check_SCRIPTS += x32_overflow_pc32.sh
1296 check_DATA += x32_overflow_pc32.err
1297 MOSTLYCLEANFILES += x32_overflow_pc32.err
1298 x32_overflow_pc32.o: x86_64_overflow_pc32.s
1299 $(TEST_AS) --x32 -o $@ $<
1300 x32_overflow_pc32.err: x32_overflow_pc32.o gcctestdir/ld
1301 @echo gcctestdir/ld -e bar -Tdata=0x81000000 -o x32_overflow_pc32 x32_overflow_pc32.o "2>$@"
1302 @if gcctestdir/ld -e bar -Tdata=0x81000000 -o x32_overflow_pc32 x32_overflow_pc32.o 2>$@; \
1304 echo 1>&2 "Link of x32_overflow_pc32 should have failed"; \
1309 check_SCRIPTS += pr23016_1.sh
1310 check_DATA += pr23016_1.stdout pr23016_1r.stdout
1311 pr23016_1.stdout: pr23016_1.o
1312 $(TEST_READELF) -rSW $< >$@ 2>/dev/null
1313 pr23016_1.o: pr23016_1a.o pr23016_1b.o gcctestdir/ld
1314 gcctestdir/ld -r -o $@ pr23016_1a.o pr23016_1b.o
1315 pr23016_1r.stdout: pr23016_1r.o
1316 $(TEST_READELF) -rSW $< >$@ 2>/dev/null
1317 pr23016_1r.o: pr23016_1a.o pr23016_1b.o gcctestdir/ld
1318 gcctestdir/ld -r -o $@ pr23016_1b.o pr23016_1a.o
1319 pr23016_1a.o: pr23016_1a.s
1321 pr23016_1b.o: pr23016_1b.s
1324 check_SCRIPTS += pr23016_2.sh
1325 check_DATA += pr23016_2.stdout
1326 pr23016_2.stdout: pr23016_2.o
1327 $(TEST_READELF) -rW $< >$@ 2>/dev/null
1328 pr23016_2.o: pr23016_2a.o pr23016_2b.o gcctestdir/ld
1329 gcctestdir/ld -r -o $@ pr23016_2a.o pr23016_2b.o
1330 pr23016_2a.o: pr23016_2a.s
1332 pr23016_2b.o: pr23016_2b.s
1335 endif DEFAULT_TARGET_X86_64
1337 if DEFAULT_TARGET_X86_64_OR_X32
1339 check_PROGRAMS += pr20216a_test
1340 pr20216a_test_SOURCES = pr20216_main.c pr20216_def.c
1341 pr20216a_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as
1342 pr20216a_test_CFLAGS = -fPIE
1343 pr20216a_test_LDFLAGS = -Wl,-R,.
1344 pr20216a_test_LDADD = pr20216_gd.o pr20216_ld.o
1346 check_PROGRAMS += pr20216b_test
1347 pr20216b_test_SOURCES = pr20216_main.c pr20216_def.c
1348 pr20216b_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as
1349 pr20216b_test_CFLAGS = -fPIE
1350 pr20216b_test_LDFLAGS = -pie -Wl,-R,.
1351 pr20216b_test_LDADD = pr20216_gd.o pr20216_ld.o
1353 check_PROGRAMS += pr20216c_test
1354 pr20216c_test_SOURCES = pr20216_main.c pr20216_def.c
1355 pr20216c_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o gcctestdir/ld gcctestdir/as
1356 pr20216c_test_CFLAGS = -fPIE
1357 pr20216c_test_LDFLAGS = -static -Wl,-R,.
1358 pr20216c_test_LDADD = pr20216_gd.o pr20216_ld.o
1360 check_PROGRAMS += pr20216d_test
1361 pr20216d_test_SOURCES = pr20216_main.c pr20216_def.c
1362 pr20216d_test_DEPENDENCIES = pr20216a.so gcctestdir/ld gcctestdir/as
1363 pr20216d_test_CFLAGS = -fPIE
1364 pr20216d_test_LDFLAGS = -Wl,-R,.
1365 pr20216d_test_LDADD = pr20216a.so
1367 check_PROGRAMS += pr20216e_test
1368 pr20216e_test_SOURCES = pr20216_main.c
1369 pr20216e_test_DEPENDENCIES = pr20216_gd.o pr20216_ld.o pr20216b.so gcctestdir/ld gcctestdir/as
1370 pr20216e_test_CFLAGS = -fPIE
1371 pr20216e_test_LDFLAGS = -Wl,-R,.
1372 pr20216e_test_LDADD = pr20216_gd.o pr20216_ld.o pr20216b.so
1374 MOSTLYCLEANFILES += pr20216a.so pr20216b.so
1376 pr20216a.so: pr20216_gd.o pr20216_ld.o gcctestdir/ld
1377 $(LINK) -shared pr20216_gd.o pr20216_ld.o
1379 pr20216b.so: pr20216_def.o gcctestdir/ld
1380 $(LINK) -shared pr20216_def.o
1382 pr20216_gd.o: pr20216_gd.S gcctestdir/as
1383 $(COMPILE) -c -o $@ $<
1385 pr20216_ld.o: pr20216_ld.S gcctestdir/as
1386 $(COMPILE) -c -o $@ $<
1388 endif DEFAULT_TARGET_X86_64_OR_X32
1390 if DEFAULT_TARGET_I386
1392 check_SCRIPTS += i386_mov_to_lea.sh
1393 check_DATA += i386_mov_to_lea1.stdout i386_mov_to_lea2.stdout \
1394 i386_mov_to_lea3.stdout i386_mov_to_lea4.stdout \
1395 i386_mov_to_lea5.stdout i386_mov_to_lea6.stdout \
1396 i386_mov_to_lea7.stdout i386_mov_to_lea8.stdout
1397 MOSTLYCLEANFILES += i386_mov_to_lea1 i386_mov_to_lea2 i386_mov_to_lea3 \
1398 i386_mov_to_lea4 i386_mov_to_lea5 i386_mov_to_lea6 \
1399 i386_mov_to_lea7 i386_mov_to_lea8
1401 i386_mov_to_lea1.o: i386_mov_to_lea1.s
1402 $(TEST_AS) --32 -o $@ $<
1403 i386_mov_to_lea2.o: i386_mov_to_lea2.s
1404 $(TEST_AS) --32 -o $@ $<
1405 i386_mov_to_lea3.o: i386_mov_to_lea3.s
1406 $(TEST_AS) --32 -o $@ $<
1407 i386_mov_to_lea4.o: i386_mov_to_lea4.s
1408 $(TEST_AS) --32 -o $@ $<
1409 i386_mov_to_lea5.o: i386_mov_to_lea5.s
1410 $(TEST_AS) --32 -o $@ $<
1411 i386_mov_to_lea1: i386_mov_to_lea1.o ../ld-new
1412 ../ld-new -Bsymbolic -shared -melf_i386 -o $@ $<
1413 i386_mov_to_lea2: i386_mov_to_lea1.o ../ld-new
1414 ../ld-new -pie -melf_i386 -o $@ $<
1415 i386_mov_to_lea3: i386_mov_to_lea1.o ../ld-new
1416 ../ld-new -melf_i386 -o $@ $<
1417 i386_mov_to_lea4: i386_mov_to_lea1.o ../ld-new
1418 ../ld-new -melf_i386 -shared -o $@ $<
1419 i386_mov_to_lea5: i386_mov_to_lea2.o ../ld-new
1420 ../ld-new -melf_i386 -shared -o $@ $<
1421 i386_mov_to_lea6: i386_mov_to_lea3.o ../ld-new
1422 ../ld-new -melf_i386 -shared -o $@ $<
1423 i386_mov_to_lea7: i386_mov_to_lea4.o ../ld-new
1424 ../ld-new -melf_i386 -shared -o $@ $<
1425 i386_mov_to_lea8: i386_mov_to_lea5.o ../ld-new
1426 ../ld-new -melf_i386 -shared -o $@ $<
1427 i386_mov_to_lea1.stdout: i386_mov_to_lea1
1428 $(TEST_OBJDUMP) -dw $< > $@
1429 i386_mov_to_lea2.stdout: i386_mov_to_lea2
1430 $(TEST_OBJDUMP) -dw $< > $@
1431 i386_mov_to_lea3.stdout: i386_mov_to_lea3
1432 $(TEST_OBJDUMP) -dw $< > $@
1433 i386_mov_to_lea4.stdout: i386_mov_to_lea4
1434 $(TEST_OBJDUMP) -dw $< > $@
1435 i386_mov_to_lea5.stdout: i386_mov_to_lea5
1436 $(TEST_OBJDUMP) -dw $< > $@
1437 i386_mov_to_lea6.stdout: i386_mov_to_lea6
1438 $(TEST_OBJDUMP) -dw $< > $@
1439 i386_mov_to_lea7.stdout: i386_mov_to_lea7
1440 $(TEST_OBJDUMP) -dw $< > $@
1441 i386_mov_to_lea8.stdout: i386_mov_to_lea8
1442 $(TEST_OBJDUMP) -dw $< > $@
1444 check_PROGRAMS += pr20308a_test
1445 pr20308a_test_SOURCES = pr20308_main.c pr20308_def.c
1446 pr20308a_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as
1447 pr20308a_test_CFLAGS = -fPIE
1448 pr20308a_test_LDFLAGS = -Wl,-R,.
1449 pr20308a_test_LDADD = pr20308_gd.o pr20308_ld.o
1451 check_PROGRAMS += pr20308b_test
1452 pr20308b_test_SOURCES = pr20308_main.c pr20308_def.c
1453 pr20308b_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as
1454 pr20308b_test_CFLAGS = -fPIE
1455 pr20308b_test_LDFLAGS = -pie -Wl,-R,.
1456 pr20308b_test_LDADD = pr20308_gd.o pr20308_ld.o
1458 check_PROGRAMS += pr20308c_test
1459 pr20308c_test_SOURCES = pr20308_main.c pr20308_def.c
1460 pr20308c_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o gcctestdir/ld gcctestdir/as
1461 pr20308c_test_CFLAGS = -fPIE
1462 pr20308c_test_LDFLAGS = -static -Wl,-R,.
1463 pr20308c_test_LDADD = pr20308_gd.o pr20308_ld.o
1465 check_PROGRAMS += pr20308d_test
1466 pr20308d_test_SOURCES = pr20308_main.c pr20308_def.c
1467 pr20308d_test_DEPENDENCIES = pr20308a.so gcctestdir/ld gcctestdir/as
1468 pr20308d_test_CFLAGS = -fPIE
1469 pr20308d_test_LDFLAGS = -Wl,-R,.
1470 pr20308d_test_LDADD = pr20308a.so
1472 check_PROGRAMS += pr20308e_test
1473 pr20308e_test_SOURCES = pr20308_main.c
1474 pr20308e_test_DEPENDENCIES = pr20308_gd.o pr20308_ld.o pr20308b.so gcctestdir/ld gcctestdir/as
1475 pr20308e_test_CFLAGS = -fPIE
1476 pr20308e_test_LDFLAGS = -Wl,-R,.
1477 pr20308e_test_LDADD = pr20308_gd.o pr20308_ld.o pr20308b.so
1479 MOSTLYCLEANFILES += pr20308a.so pr20308b.so
1481 pr20308a.so: pr20308_gd.o pr20308_ld.o gcctestdir/ld
1482 $(LINK) -shared pr20308_gd.o pr20308_ld.o
1484 pr20308b.so: pr20308_def.o gcctestdir/ld
1485 $(LINK) -shared pr20308_def.o
1487 pr20308_gd.o: pr20308_gd.S gcctestdir/as
1488 $(COMPILE) -c -o $@ $<
1490 pr20308_ld.o: pr20308_ld.S gcctestdir/as
1491 $(COMPILE) -c -o $@ $<
1493 endif DEFAULT_TARGET_I386
1495 check_PROGRAMS += many_sections_test
1496 many_sections_test_SOURCES = many_sections_test.cc
1497 many_sections_test_DEPENDENCIES = gcctestdir/ld
1498 many_sections_test_LDFLAGS = -rdynamic
1499 many_sections_test_LDADD =
1501 BUILT_SOURCES += many_sections_define.h
1502 MOSTLYCLEANFILES += many_sections_define.h
1503 many_sections_define.h:
1504 (for i in `seq 1 70000`; do \
1505 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
1509 BUILT_SOURCES += many_sections_check.h
1510 MOSTLYCLEANFILES += many_sections_check.h
1511 many_sections_check.h:
1512 (for i in `seq 1 1000 70000`; do \
1513 echo "assert(var_$$i == $$i);"; \
1517 check_PROGRAMS += many_sections_r_test
1518 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
1519 gcctestdir/ld -r -o $@ many_sections_test.o
1520 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
1521 $(CXXLINK) many_sections_r_test.o $(LIBS)
1523 check_SCRIPTS += file_in_many_sections_test.sh
1524 check_DATA += file_in_many_sections.stdout
1525 MOSTLYCLEANFILES += file_in_many_sections
1526 file_in_many_sections.o: file_in_many_sections.c many_sections_define.h
1527 $(COMPILE) -c -fdata-sections -o $@ $(srcdir)/file_in_many_sections.c
1528 file_in_many_sections: file_in_many_sections.o gcctestdir/ld
1529 $(LINK) file_in_many_sections.o -Wl,--gc-sections
1530 file_in_many_sections.stdout: file_in_many_sections
1531 $(TEST_READELF) -sW $< > $@
1533 check_PROGRAMS += initpri1
1534 initpri1_SOURCES = initpri1.c
1535 initpri1_DEPENDENCIES = gcctestdir/ld
1538 check_PROGRAMS += initpri2
1539 initpri2_SOURCES = initpri2.c
1540 initpri2_DEPENDENCIES = gcctestdir/ld
1541 initpri2_LDFLAGS = -Wl,--ctors-in-init-array
1544 check_PROGRAMS += initpri3a
1545 initpri3a_SOURCES = initpri3.c
1546 initpri3a_DEPENDENCIES = gcctestdir/ld
1549 # This test fails on targets not using .ctors and .dtors sections (e.g. ARM
1550 # EABI). Given that gcc is moving towards using .init_array in all cases,
1551 # this test is commented out. A better fix would be checking whether gcc
1552 # uses .ctors or .init_array sections in configure.
1554 # check_PROGRAMS += initpri3b
1555 # initpri3b_SOURCES = initpri3.c
1556 # initpri3b_DEPENDENCIES = gcctestdir/ld
1557 # initpri3b_LDFLAGS = -Wl,--no-ctors-in-init-array
1560 # Test --detect-odr-violations
1561 check_SCRIPTS += debug_msg.sh
1563 # Create the data files that debug_msg.sh analyzes.
1564 check_DATA += debug_msg.err
1565 MOSTLYCLEANFILES += debug_msg.err
1566 debug_msg.o: debug_msg.cc
1567 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
1568 odr_violation1.o: odr_violation1.cc
1569 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
1570 # Compile with different optimization flags to check that rearranged
1571 # instructions don't cause a false positive.
1572 odr_violation2.o: odr_violation2.cc
1573 $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
1574 debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
1575 @echo $(CXXLINK) -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
1576 @if $(CXXLINK) -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
1578 echo 1>&2 "Link of debug_msg should have failed"; \
1583 # Test error message when a vtable is undefined.
1584 check_SCRIPTS += missing_key_func.sh
1585 check_DATA += missing_key_func.err
1586 MOSTLYCLEANFILES += missing_key_func.err
1587 missing_key_func.o: missing_key_func.cc
1588 $(CXXCOMPILE) -O0 -g -c -o $@ $(srcdir)/missing_key_func.cc
1589 missing_key_func.err: missing_key_func.o gcctestdir/ld
1590 @echo $(CXXLINK) -o missing_key_func missing_key_func.o "2>$@"
1591 @if $(CXXLINK) -o missing_key_func missing_key_func.o 2>$@; \
1593 echo 1>&2 "Link of missing_key_func should have failed"; \
1598 # Check that --detect-odr-violations works with compressed debug sections.
1599 check_DATA += debug_msg_cdebug.err
1600 MOSTLYCLEANFILES += debug_msg_cdebug.err
1601 debug_msg_cdebug.o: debug_msg.cc gcctestdir/as
1602 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc
1603 odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as
1604 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc
1605 odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as
1606 $(CXXCOMPILE) -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc
1607 debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld
1608 @echo $(CXXLINK) -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@"
1609 @if $(CXXLINK) -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \
1611 echo 1>&2 "Link of debug_msg_cdebug should have failed"; \
1615 check_DATA += debug_msg_cdebug_gabi.err
1616 MOSTLYCLEANFILES += debug_msg_cdebug_gabi.err
1617 debug_msg_cdebug_gabi.o: debug_msg.cc gcctestdir/as
1618 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/debug_msg.cc
1619 odr_violation1_cdebug_gabi.o: odr_violation1.cc gcctestdir/as
1620 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/odr_violation1.cc
1621 odr_violation2_cdebug_gabi.o: odr_violation2.cc gcctestdir/as
1622 $(CXXCOMPILE) -O2 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/odr_violation2.cc
1623 debug_msg_cdebug_gabi.err: debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o gcctestdir/ld
1624 @echo $(CXXLINK) -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o "2>$@"
1625 @if $(CXXLINK) -Wl,--detect-odr-violations -o debug_msg_cdebug_gabi debug_msg_cdebug_gabi.o odr_violation1_cdebug_gabi.o odr_violation2_cdebug_gabi.o 2>$@; \
1627 echo 1>&2 "Link of debug_msg_cdebug_gabi should have failed"; \
1632 # See if we can also detect problems when we're linking .so's, not .o's.
1633 check_DATA += debug_msg_so.err
1634 MOSTLYCLEANFILES += debug_msg_so.err
1635 debug_msg.so: debug_msg.cc gcctestdir/ld
1636 $(CXXCOMPILE) -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
1637 odr_violation1.so: odr_violation1.cc gcctestdir/ld
1638 $(CXXCOMPILE) -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
1639 odr_violation2.so: odr_violation2.cc gcctestdir/ld
1640 $(CXXCOMPILE) -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
1641 debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
1642 @echo $(CXXLINK_S) -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
1643 @if $(CXXLINK_S) -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
1645 echo 1>&2 "Link of debug_msg_so should have failed"; \
1650 # We also want to make sure we do something reasonable when there's no
1651 # debug info available. For the best test, we use .so's.
1652 check_DATA += debug_msg_ndebug.err
1653 MOSTLYCLEANFILES += debug_msg_ndebug.err
1654 debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
1655 $(CXXCOMPILE) -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
1656 odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
1657 $(CXXCOMPILE) -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
1658 odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
1659 $(CXXCOMPILE) -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
1660 debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
1661 @echo $(CXXLINK_S) -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ "2>$@"
1662 @if $(CXXLINK_S) -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ 2>$@; \
1664 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
1670 # Similar to --detect-odr-violations: check for undefined symbols in .so's
1671 check_SCRIPTS += undef_symbol.sh
1672 check_DATA += undef_symbol.err
1673 MOSTLYCLEANFILES += undef_symbol.err
1674 undef_symbol.o: undef_symbol.cc
1675 $(CXXCOMPILE) -O0 -g -c -fPIC $<
1676 undef_symbol.so: undef_symbol.o gcctestdir/ld
1677 $(CXXLINK) -shared undef_symbol.o
1678 undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
1679 @echo $(CXXLINK) -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
1680 @if $(CXXLINK) -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
1682 echo 1>&2 "Link of undef_symbol_test should have failed"; \
1688 # Test -o when emitting to a special file (such as something in /dev).
1689 check_PROGRAMS += flagstest_o_specialfile
1690 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
1691 $(CXXLINK) -o /dev/stdout $< 2>&1 | cat > $@
1695 # Test --compress-debug-sections.
1696 check_PROGRAMS += flagstest_compress_debug_sections_none
1697 check_DATA += flagstest_compress_debug_sections_none.stdout
1698 flagstest_compress_debug_sections_none: flagstest_debug.o gcctestdir/ld
1699 $(CXXLINK) -o $@ $< -Wl,--compress-debug-sections=none
1702 # Dump DWARF debug sections.
1703 flagstest_compress_debug_sections_none.stdout: flagstest_compress_debug_sections_none
1704 $(TEST_READELF) -w $< > $@.tmp
1707 check_PROGRAMS += flagstest_compress_debug_sections
1708 check_DATA += flagstest_compress_debug_sections.stdout \
1709 flagstest_compress_debug_sections.cmp \
1710 flagstest_compress_debug_sections.check
1711 MOSTLYCLEANFILES += flagstest_compress_debug_sections.check \
1712 flagstest_compress_debug_sections.cmp
1713 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
1714 $(CXXLINK) -o $@ $< -Wl,--compress-debug-sections=zlib
1717 # Test --compress-debug-sections with --build-id=tree.
1718 check_PROGRAMS += flagstest_compress_debug_sections_and_build_id_tree
1719 flagstest_compress_debug_sections_and_build_id_tree: flagstest_debug.o gcctestdir/ld
1720 $(CXXLINK) -o $@ $< -Wl,--compress-debug-sections=zlib \
1721 -Wl,--build-id=tree \
1722 -Wl,--build-id-chunk-size-for-treehash=4096 \
1723 -Wl,--build-id-min-file-size-for-treehash=0
1726 # Dump compressed DWARF debug sections.
1727 flagstest_compress_debug_sections.stdout: flagstest_compress_debug_sections
1728 $(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
1731 # Check there are compressed DWARF .debug_* sections.
1732 flagstest_compress_debug_sections.check: flagstest_compress_debug_sections
1733 $(TEST_READELF) -SW $< | grep "\.debug_.* C" > $@.tmp
1736 # Compare DWARF debug info.
1737 flagstest_compress_debug_sections.cmp: flagstest_compress_debug_sections.stdout \
1738 flagstest_compress_debug_sections_none.stdout
1739 cmp flagstest_compress_debug_sections.stdout \
1740 flagstest_compress_debug_sections_none.stdout > $@.tmp
1743 check_PROGRAMS += flagstest_compress_debug_sections_gnu
1744 check_DATA += flagstest_compress_debug_sections_gnu.stdout \
1745 flagstest_compress_debug_sections_gnu.cmp \
1746 flagstest_compress_debug_sections_gnu.check
1747 MOSTLYCLEANFILES += flagstest_compress_debug_sections_gnu.check \
1748 flagstest_compress_debug_sections_gnu.cmp
1749 flagstest_compress_debug_sections_gnu: flagstest_debug.o gcctestdir/ld
1750 $(CXXLINK) -o $@ $< -Wl,--compress-debug-sections=zlib-gnu
1753 # Dump compressed DWARF debug sections.
1754 flagstest_compress_debug_sections_gnu.stdout: flagstest_compress_debug_sections_gnu
1755 $(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
1758 # Check there are compressed DWARF .zdebug_* sections.
1759 flagstest_compress_debug_sections_gnu.check: flagstest_compress_debug_sections_gnu
1760 $(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp
1763 # Compare DWARF debug info.
1764 flagstest_compress_debug_sections_gnu.cmp: flagstest_compress_debug_sections_gnu.stdout \
1765 flagstest_compress_debug_sections_none.stdout
1766 cmp flagstest_compress_debug_sections_gnu.stdout \
1767 flagstest_compress_debug_sections_none.stdout > $@.tmp
1770 check_PROGRAMS += flagstest_compress_debug_sections_gabi
1771 check_DATA += flagstest_compress_debug_sections_gabi.stdout \
1772 flagstest_compress_debug_sections_gabi.cmp \
1773 flagstest_compress_debug_sections_gabi.check
1774 MOSTLYCLEANFILES += flagstest_compress_debug_sections_gabi.cmp \
1775 flagstest_compress_debug_sections_gabi.check
1776 flagstest_compress_debug_sections_gabi: flagstest_debug.o gcctestdir/ld
1777 $(CXXLINK) -o $@ $< -Wl,--compress-debug-sections=zlib-gabi
1780 # Dump compressed DWARF debug sections.
1781 flagstest_compress_debug_sections_gabi.stdout: flagstest_compress_debug_sections_gabi
1782 $(TEST_READELF) -w $< > $@.tmp
1785 # Check there are compressed DWARF .debug_* sections.
1786 flagstest_compress_debug_sections_gabi.check: flagstest_compress_debug_sections_gabi
1787 $(TEST_READELF) -tW $< | grep "COMPRESSED" > $@.tmp
1790 # Compare DWARF debug info.
1791 flagstest_compress_debug_sections_gabi.cmp: flagstest_compress_debug_sections_gabi.stdout \
1792 flagstest_compress_debug_sections_none.stdout
1793 cmp flagstest_compress_debug_sections_gabi.stdout \
1794 flagstest_compress_debug_sections_none.stdout > $@.tmp
1798 check_PROGRAMS += flagstest_compress_debug_sections_zstd
1799 flagstest_compress_debug_sections_zstd: flagstest_debug.o gcctestdir/ld
1800 $(CXXLINK) -o $@ $< -Wl,--compress-debug-sections=zstd
1804 # The specialfile output has a tricky case when we also compress debug
1805 # sections, because it requires output-file resizing.
1806 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
1807 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
1809 $(CXXLINK) -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
1813 check_SCRIPTS += pr18689.sh
1814 check_DATA += pr18689.stdout
1815 MOSTLYCLEANFILES += pr18689a.o pr18689b.o
1817 pr18689.stdout: pr18689b.o
1818 $(TEST_READELF) -SW $< > $@
1820 pr18689a.o: pr18689.o ../ld-new
1821 ../ld-new -r -o $@ $<
1823 pr18689b.o: pr18689a.o ../ld-new
1824 ../ld-new -r -o $@ $<
1826 pr18689.o: pr18689.c gcctestdir/as
1827 $(COMPILE) -ggdb3 -g -Wa,--compress-debug-sections=zlib-gabi -c -w -o $@ $(srcdir)/pr18689.c
1829 # Test -TText and -Tdata.
1830 check_PROGRAMS += flagstest_o_ttext_1
1831 flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld
1832 $(CXXLINK) -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000
1834 # This version won't be runnable, because there is no way to put the
1835 # PT_PHDR segment at file offset 0. We just make sure that we can
1836 # build it without error.
1837 check_DATA += flagstest_o_ttext_2
1838 MOSTLYCLEANFILES += flagstest_o_ttext_2
1839 flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld
1840 $(CXXLINK) -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010
1842 # Test symbol versioning.
1843 check_PROGRAMS += ver_test
1844 ver_test_SOURCES = ver_test_main.cc
1845 ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
1846 ver_test_LDFLAGS = -Wl,-R,.
1847 ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
1848 ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
1849 $(CXXLINK) -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
1850 ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
1851 $(CXXLINK) -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so
1852 ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
1853 $(CXXLINK) -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
1854 ver_test_1.o: ver_test_1.cc
1855 $(CXXCOMPILE) -c -fpic -o $@ $<
1856 ver_test_2.o: ver_test_2.cc
1857 $(CXXCOMPILE) -c -fpic -o $@ $<
1858 ver_test_3.o: ver_test_3.cc
1859 $(CXXCOMPILE) -c -fpic -o $@ $<
1860 ver_test_4.o: ver_test_4.cc
1861 $(CXXCOMPILE) -c -fpic -o $@ $<
1863 check_SCRIPTS += ver_test_1.sh
1864 check_DATA += ver_test_1.syms
1865 ver_test_1.syms: ver_test_1.so
1866 $(TEST_READELF) -s $< >$@ 2>/dev/null
1868 check_PROGRAMS += ver_test_2
1869 ver_test_2_SOURCES = ver_test_main_2.cc
1870 ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
1871 ver_test_2_LDFLAGS = -Wl,-R,.
1872 ver_test_2_LDADD = ver_test_4.so ver_test_2.so
1874 check_SCRIPTS += ver_test_2.sh
1875 check_DATA += ver_test_2.syms
1876 ver_test_2.syms: ver_test_2
1877 $(TEST_READELF) -s $< >$@ 2>/dev/null
1879 check_SCRIPTS += ver_test_4.sh
1880 check_DATA += ver_test_4.syms
1881 ver_test_4.syms: ver_test_4.so
1882 $(TEST_READELF) -s $< >$@ 2>/dev/null
1884 ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
1885 $(CXXLINK) -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
1886 ver_test_5.o: ver_test_5.cc
1887 $(CXXCOMPILE) -c -fpic -o $@ $<
1888 check_SCRIPTS += ver_test_5.sh
1889 check_DATA += ver_test_5.syms
1890 ver_test_5.syms: ver_test_5.so
1891 $(TEST_READELF) -s $< >$@ 2>/dev/null
1893 check_PROGRAMS += ver_test_6
1894 ver_test_6_SOURCES = ver_test_6.c
1895 ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
1896 ver_test_6_LDFLAGS = -Wl,-R,.
1897 ver_test_6_LDADD = ver_test_2.so
1899 ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
1900 $(CXXLINK) -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
1901 ver_test_7.o: ver_test_7.cc
1902 $(CXXCOMPILE) -c -fpic -o $@ $<
1903 check_SCRIPTS += ver_test_7.sh
1904 check_DATA += ver_test_7.syms
1905 ver_test_7.syms: ver_test_7.so
1906 $(TEST_READELF) -s $< >$@ 2>/dev/null
1908 check_PROGRAMS += ver_test_8
1909 ver_test_8_SOURCES = two_file_test_main.cc
1910 ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
1911 ver_test_8_LDFLAGS = -Wl,-R,.
1912 ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
1913 ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
1914 $(CXXLINK) -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
1915 ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
1916 $(CXXLINK) -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
1918 check_SCRIPTS += ver_test_8.sh
1919 check_DATA += ver_test_8_2.so.syms
1920 ver_test_8_2.so.syms: ver_test_8_2.so
1921 $(TEST_READELF) -s $< >$@ 2>/dev/null
1923 check_PROGRAMS += ver_test_9
1924 ver_test_9_SOURCES = ver_test_main.cc
1925 ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
1926 ver_test_9_LDFLAGS = -Wl,-R,.
1927 ver_test_9_LDADD = ver_test_9.so
1928 ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
1929 $(CXXLINK) -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so
1930 ver_test_9.o: ver_test_9.cc
1931 $(CXXCOMPILE) -c -fpic -o $@ $<
1933 check_SCRIPTS += ver_test_10.sh
1934 check_DATA += ver_test_10.syms
1935 ver_test_10.syms: ver_test_10.so
1936 $(TEST_READELF) -s $< >$@ 2>/dev/null
1937 ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
1938 $(CXXLINK) -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
1940 check_PROGRAMS += ver_test_11
1941 MOSTLYCLEANFILES += ver_test_11.a
1942 ver_test_11_SOURCES = ver_test_main_2.cc
1943 ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
1944 ver_test_11_LDFLAGS = -Wl,-R,.
1945 ver_test_11_LDADD = ver_test_11.a
1946 ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
1949 check_PROGRAMS += ver_test_12
1950 ver_test_12_SOURCES = ver_test_main_2.cc
1951 ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o
1952 ver_test_12_LDFLAGS = -Wl,-R,.
1953 ver_test_12_LDADD = ver_test_12.o
1954 ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o
1955 gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o
1957 check_SCRIPTS += ver_test_13.sh
1958 check_DATA += ver_test_13.syms
1959 ver_test_13.syms: ver_test_13.so
1960 $(TEST_READELF) -s $< >$@ 2>/dev/null
1961 ver_test_13.so: gcctestdir/ld ver_test_13.o ver_test_13.script
1962 $(LINK) -shared -Wl,--version-script,$(srcdir)/ver_test_13.script ver_test_13.o
1963 ver_test_13.o: ver_test_13.c
1964 $(COMPILE) -c -fpic -o $@ $<
1966 check_SCRIPTS += ver_test_14.sh
1967 check_DATA += ver_test_14.syms
1968 MOSTLYCLEANFILES += ver_test_14
1969 ver_test_14.syms: ver_test_14
1970 $(TEST_OBJDUMP) -T $< | $(TEST_CXXFILT) >$@
1971 ver_test_14: gcctestdir/ld ver_test_main.o ver_test_1.so ver_test_2.so ver_test_4.so ver_test_14.script
1972 $(CXXLINK) -Wl,--version-script,$(srcdir)/ver_test_14.script -Wl,-E -Wl,-R,. ver_test_main.o ver_test_1.so ver_test_2.so ver_test_4.so
1974 check_SCRIPTS += ver_test_pr23409.sh
1975 check_DATA += ver_test_pr23409.syms
1976 ver_test_pr23409.syms: ver_test_pr23409_1.so
1977 $(TEST_READELF) --dyn-syms -W $< >$@
1978 ver_test_pr23409_1.so: gcctestdir/ld ver_test_1.o $(srcdir)/ver_test_pr23409_1.script ver_test_pr23409_2.so
1979 gcctestdir/ld -shared -o $@ ver_test_1.o ver_test_pr23409_2.so --version-script $(srcdir)/ver_test_pr23409_1.script
1980 ver_test_pr23409_2.so: gcctestdir/ld ver_test_1.o $(srcdir)/ver_test_pr23409_2.script
1981 gcctestdir/ld -shared -o $@ ver_test_1.o --version-script $(srcdir)/ver_test_pr23409_2.script
1983 check_SCRIPTS += ver_test_pr31830.sh
1984 check_DATA += ver_test_pr31830_a.syms ver_test_pr31830_b.syms
1985 ver_test_pr31830_a.syms: ver_test_pr31830_a.so
1986 $(TEST_READELF) --dyn-syms -W $< >$@
1987 ver_test_pr31830_b.syms: ver_test_pr31830_b.so
1988 $(TEST_READELF) --dyn-syms -W $< >$@
1989 ver_test_pr31830_a.so: gcctestdir/ld ver_test_pr31830_a.o ver_test_pr31830_b.o $(srcdir)/ver_test_pr31830.script
1990 gcctestdir/ld -shared -o $@ ver_test_pr31830_a.o ver_test_pr31830_b.o --version-script $(srcdir)/ver_test_pr31830.script
1991 ver_test_pr31830_b.so: gcctestdir/ld ver_test_pr31830_a.o ver_test_pr31830_b.o $(srcdir)/ver_test_pr31830.script
1992 gcctestdir/ld -shared -o $@ ver_test_pr31830_b.o ver_test_pr31830_a.o --version-script $(srcdir)/ver_test_pr31830.script
1994 check_SCRIPTS += ver_test_pr31830_lto.sh
1995 check_DATA += ver_test_pr31830_lto_a.syms ver_test_pr31830_lto_b.syms
1996 ver_test_pr31830_lto_a.syms: ver_test_pr31830_lto_a.so
1997 $(TEST_READELF) --dyn-syms -W $< >$@
1998 ver_test_pr31830_lto_a.so: gcctestdir/ld $(srcdir)/ver_test_pr31830_lto.c $(srcdir)/ver_test_pr31830.script
1999 $(LINK) -Bgcctestdir/ -shared -o $@ -O2 -fPIC -flto-partition=max $(srcdir)/ver_test_pr31830_lto.c -Wl,--version-script,$(srcdir)/ver_test_pr31830.script
2000 ver_test_pr31830_lto_b.syms: ver_test_pr31830_lto_b.so
2001 $(TEST_READELF) --dyn-syms -W $< >$@
2002 ver_test_pr31830_lto_b.so: gcctestdir/ld $(srcdir)/ver_test_pr31830_lto.c $(srcdir)/ver_test_pr31830.script
2003 $(LINK) -Bgcctestdir/ -shared -o $@ -O2 -fPIC -flto-partition=max -flto=2 $(srcdir)/ver_test_pr31830_lto.c -Wl,--version-script,$(srcdir)/ver_test_pr31830.script
2005 check_SCRIPTS += weak_as_needed.sh
2006 check_DATA += weak_as_needed.stdout
2007 weak_as_needed.stdout: weak_as_needed_a.so
2008 $(TEST_READELF) -dW --dyn-syms $< >$@
2009 weak_as_needed_a.so: gcctestdir/ld weak_as_needed_a.o weak_as_needed_b.so weak_as_needed_c.so
2010 gcctestdir/ld -shared -rpath . -o $@ weak_as_needed_a.o --as-needed weak_as_needed_b.so weak_as_needed_c.so
2011 weak_as_needed_b.so: gcctestdir/ld weak_as_needed_b.o weak_as_needed_b.script
2012 gcctestdir/ld -shared -rpath . -o $@ --version-script $(srcdir)/weak_as_needed_b.script weak_as_needed_b.o
2013 weak_as_needed_c.so: gcctestdir/ld weak_as_needed_c.o weak_as_needed_c.script
2014 gcctestdir/ld -shared -rpath . -o $@ --version-script $(srcdir)/weak_as_needed_c.script weak_as_needed_c.o
2015 weak_as_needed_a.o: weak_as_needed_a.c
2016 $(COMPILE) -c -fpic -o $@ $<
2017 weak_as_needed_b.o: weak_as_needed_b.c
2018 $(COMPILE) -c -fpic -o $@ $<
2019 weak_as_needed_c.o: weak_as_needed_c.c
2020 $(COMPILE) -c -fpic -o $@ $<
2022 check_PROGRAMS += protected_1
2023 protected_1_SOURCES = \
2024 protected_main_1.cc protected_main_2.cc protected_main_3.cc
2025 protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
2026 protected_1_LDFLAGS = -Wl,-R,.
2027 protected_1_LDADD = protected_1.so
2029 protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
2030 $(CXXLINK) -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
2031 protected_1_pic.o: protected_1.cc
2032 $(CXXCOMPILE) -c -fpic -o $@ $<
2033 protected_2_pic.o: protected_2.cc
2034 $(CXXCOMPILE) -c -fpic -o $@ $<
2035 protected_3_pic.o: protected_3.cc
2036 $(CXXCOMPILE) -c -fpic -o $@ $<
2038 check_PROGRAMS += protected_2
2039 protected_2_SOURCES = protected_main_1.cc protected_3.cc
2040 protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
2041 protected_2_LDFLAGS = -Wl,-R,.
2042 protected_2_LDADD = protected_1.so
2044 check_DATA += protected_3.err
2045 MOSTLYCLEANFILES += protected_3.err
2046 protected_4_pic.o: protected_4.cc
2047 $(CXXCOMPILE) -c -fpic -o $@ $<
2048 protected_3.err: protected_4_pic.o gcctestdir/ld
2049 @echo $(CXXLINK) -shared -o protected_4.so protected_4_pic.o "2>$@"
2050 @if $(CXXLINK) -shared -o protected_4.so protected_4_pic.o 2>$@; then \
2051 echo 1>&2 "Link of protected_4.so should have failed"; \
2056 check_PROGRAMS += relro_test
2057 check_SCRIPTS += relro_test.sh
2058 check_DATA += relro_test.stdout
2059 relro_test_SOURCES = relro_test_main.cc
2060 relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
2061 relro_test_LDFLAGS = -Wl,-R,.
2062 relro_test_LDADD = relro_test.so
2063 relro_test.so: gcctestdir/ld relro_test_pic.o
2064 $(CXXLINK) -shared -Wl,-z,relro relro_test_pic.o
2065 relro_test_pic.o: relro_test.cc
2066 $(CXXCOMPILE) -c -fpic -o $@ $<
2067 relro_test.stdout: relro_test.so
2068 $(TEST_READELF) -SlW relro_test.so > relro_test.stdout
2070 check_PROGRAMS += relro_now_test
2071 relro_now_test_SOURCES = relro_test_main.cc
2072 relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so
2073 relro_now_test_LDFLAGS = -Wl,-R,. -Wl,-z,relro -Wl,-z,now
2074 relro_now_test_LDADD = relro_now_test.so
2075 relro_now_test.so: gcctestdir/ld relro_test_pic.o
2076 $(CXXLINK) -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o
2078 check_PROGRAMS += relro_strip_test
2079 relro_strip_test_SOURCES = relro_test_main.cc
2080 relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so
2081 relro_strip_test_LDFLAGS = -Wl,-R,.
2082 relro_strip_test_LDADD = relro_strip_test.so
2083 relro_strip_test.so: relro_test.so
2084 $(TEST_STRIP) -o $@ $<
2086 check_PROGRAMS += relro_script_test
2087 relro_script_test_SOURCES = relro_test_main.cc
2088 relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
2089 relro_script_test_LDFLAGS = -Wl,-R,.
2090 relro_script_test_LDADD = relro_script_test.so
2091 relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
2092 $(CXXLINK) -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o
2094 check_PROGRAMS += script_test_1
2095 script_test_1_SOURCES = script_test_1a.cc script_test_1b.cc
2096 script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
2097 script_test_1_LDFLAGS = -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t
2098 script_test_1_LDADD =
2100 check_PROGRAMS += script_test_2
2101 script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
2102 script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
2103 script_test_2_LDFLAGS = -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t
2104 script_test_2_LDADD =
2106 check_PROGRAMS += justsyms
2107 justsyms_SOURCES = justsyms_1.cc
2108 justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
2109 justsyms_LDFLAGS = -Wl,-R,justsyms_2r.o
2111 justsyms_2.o: justsyms_2.cc
2112 $(CXXCOMPILE) -c -o $@ $<
2113 justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
2114 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
2116 check_PROGRAMS += justsyms_exec
2117 justsyms_exec_SOURCES = justsyms_exec.c
2118 justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib
2119 justsyms_exec_LDFLAGS = -Wl,-R,justsyms_lib
2120 justsyms_exec_LDADD =
2121 MOSTLYCLEANFILES += justsyms_lib
2122 justsyms_lib.o: justsyms_lib.c
2123 $(COMPILE) -c -o $@ $<
2124 justsyms_lib: justsyms_lib.o gcctestdir/ld
2125 gcctestdir/ld -o $@ -z norelro -T $(srcdir)/justsyms_lib.t -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o
2127 check_PROGRAMS += binary_test
2128 MOSTLYCLEANFILES += binary.txt
2129 binary_test_SOURCES = binary_test.cc
2130 binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
2131 binary_test_LDFLAGS = -Wl,--format,binary,binary.txt,--format,elf
2133 # Copy the file to the build directory to avoid worrying about the
2134 # full pathname in the generated symbols.
2135 binary.txt: $(srcdir)/binary.in
2139 check_SCRIPTS += ver_matching_test.sh
2140 check_DATA += ver_matching_test.stdout
2141 MOSTLYCLEANFILES += ver_matching_test.stdout
2142 ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld
2143 $(CXXLINK) -O0 -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map
2144 ver_matching_def_pic.o: ver_matching_def.cc
2145 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
2146 ver_matching_test.stdout: ver_matching_def.so
2147 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
2149 check_PROGRAMS += script_test_3
2150 check_SCRIPTS += script_test_3.sh
2151 check_DATA += script_test_3.stdout
2152 MOSTLYCLEANFILES += script_test_3.stdout
2153 script_test_3: basic_test.o gcctestdir/ld script_test_3.t
2154 $(CXXLINK) basic_test.o -Wl,-T,$(srcdir)/script_test_3.t
2155 script_test_3.stdout: script_test_3
2156 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
2158 check_PROGRAMS += tls_phdrs_script_test
2159 tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
2160 tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
2161 tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t
2162 tls_phdrs_script_test_LDADD = $(tls_test_LDADD)
2164 check_SCRIPTS += script_test_4.sh
2165 check_DATA += script_test_4.stdout
2166 MOSTLYCLEANFILES += script_test_4
2167 script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
2168 $(CXXLINK) basic_test.o -Wl,-T,$(srcdir)/script_test_4.t
2169 script_test_4.stdout: script_test_4
2170 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
2172 check_PROGRAMS += tls_script_test
2173 tls_script_test_SOURCES = $(tls_test_SOURCES)
2174 tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t
2175 tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_4.t
2176 tls_script_test_LDADD = $(tls_test_LDADD)
2178 check_SCRIPTS += script_test_5.sh
2179 check_DATA += script_test_5.stdout
2180 MOSTLYCLEANFILES += script_test_5
2181 script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
2182 $(CXXLINK) script_test_5.o -Wl,-T,$(srcdir)/script_test_5.t
2183 script_test_5.stdout: script_test_5
2184 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
2186 check_SCRIPTS += script_test_6.sh
2187 check_DATA += script_test_6.stdout
2188 MOSTLYCLEANFILES += script_test_6
2189 script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t
2190 $(CXXLINK) basic_test.o -Wl,-T,$(srcdir)/script_test_6.t \
2191 -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000
2192 script_test_6.stdout: script_test_6
2193 $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout
2195 check_SCRIPTS += script_test_7.sh
2196 check_DATA += script_test_7.stdout
2197 MOSTLYCLEANFILES += script_test_7
2198 script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
2199 $(CXXLINK) basic_test.o -Wl,-T,$(srcdir)/script_test_7.t
2200 script_test_7.stdout: script_test_7
2201 $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout
2203 check_SCRIPTS += script_test_8.sh
2204 check_DATA += script_test_8.stdout
2205 MOSTLYCLEANFILES += script_test_8
2206 script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t
2207 $(CXXLINK) basic_test.o -Wl,-T,$(srcdir)/script_test_7.t \
2208 -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000
2209 script_test_8.stdout: script_test_8
2210 $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout
2212 check_SCRIPTS += script_test_9.sh
2213 check_DATA += script_test_9.stdout
2214 MOSTLYCLEANFILES += script_test_9
2215 script_test_9.o: script_test_9.cc
2216 $(CXXCOMPILE) -O0 -c -o $@ $<
2217 script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
2218 $(CXXLINK) script_test_9.o -Wl,-T,$(srcdir)/script_test_9.t
2219 script_test_9.stdout: script_test_9
2220 $(TEST_READELF) -lW script_test_9 > script_test_9.stdout
2222 # Test scripts with a relocatable link.
2223 # The -g option is necessary to trigger a bug where a section
2224 # declared in a script file is assigned a non-zero starting address.
2225 check_PROGRAMS += script_test_11
2226 script_test_11: gcctestdir/ld script_test_11_r.o
2227 $(LINK) script_test_11_r.o
2228 script_test_11_r.o: gcctestdir/ld $(srcdir)/script_test_11.t script_test_11a.o script_test_11b.o
2229 gcctestdir/ld -r -o $@ -T $(srcdir)/script_test_11.t script_test_11a.o script_test_11b.o
2230 script_test_11a.o: script_test_11a.c
2231 $(COMPILE) -c -g -o $@ $<
2232 script_test_11b.o: script_test_11b.c
2233 $(COMPILE) -c -g -o $@ $<
2235 # Test difference between "*(a b)" and "*(a) *(b)" in input section spec.
2236 check_PROGRAMS += script_test_12
2237 script_test_12: gcctestdir/ld $(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o
2238 $(LINK) -Wl,-T,$(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o
2240 check_PROGRAMS += script_test_12i
2241 script_test_12i: gcctestdir/ld $(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o
2242 $(LINK) -Wl,-T,$(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o
2243 script_test_12a.o: script_test_12a.c
2244 $(COMPILE) -O0 -c -o $@ $<
2245 script_test_12b.o: script_test_12b.c
2246 $(COMPILE) -O0 -c -o $@ $<
2248 # Test for ordering internally created sections with a linker script.
2249 check_SCRIPTS += script_test_13.sh
2250 check_DATA += script_test_13.stdout
2251 MOSTLYCLEANFILES += script_test_13
2252 script_test_13.o: script_test_13.c
2253 $(COMPILE) -O0 -c -fPIC -o $@ $<
2254 script_test_13: $(srcdir)/script_test_13.t script_test_13.o gcctestdir/ld
2255 gcctestdir/ld -shared -o $@ script_test_13.o -T $(srcdir)/script_test_13.t
2256 script_test_13.stdout: script_test_13
2257 $(TEST_READELF) -SW script_test_13 > $@
2259 # Test for SORT_BY_INIT_PRIORITY.
2260 check_SCRIPTS += script_test_14.sh
2261 check_DATA += script_test_14.stdout
2262 MOSTLYCLEANFILES += script_test_14
2263 script_test_14.o: script_test_14.s
2265 script_test_14: $(srcdir)/script_test_14.t script_test_14.o gcctestdir/ld
2266 gcctestdir/ld -o $@ script_test_14.o -T $(srcdir)/script_test_14.t
2267 script_test_14.stdout: script_test_14
2268 $(TEST_OBJDUMP) -s script_test_14 > $@
2270 # Test BSS section placement at end of segment.
2271 check_SCRIPTS += script_test_15a.sh
2272 check_DATA += script_test_15a.stdout
2273 MOSTLYCLEANFILES += script_test_15a
2274 script_test_15a: $(srcdir)/script_test_15a.t script_test_15.o gcctestdir/ld
2275 gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15a.t
2276 script_test_15a.stdout: script_test_15a
2277 $(TEST_READELF) -lSW script_test_15a > $@
2279 # Test BSS section placement in middle of segment.
2280 check_SCRIPTS += script_test_15b.sh
2281 check_DATA += script_test_15b.stdout
2282 MOSTLYCLEANFILES += script_test_15b
2283 script_test_15b: $(srcdir)/script_test_15b.t script_test_15.o gcctestdir/ld
2284 gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15b.t
2285 script_test_15b.stdout: script_test_15b
2286 $(TEST_READELF) -lSW script_test_15b > $@
2288 # Test orphan BSS section placement.
2289 check_SCRIPTS += script_test_15c.sh
2290 check_DATA += script_test_15c.stdout
2291 MOSTLYCLEANFILES += script_test_15c
2292 script_test_15c: $(srcdir)/script_test_15c.t script_test_15.o gcctestdir/ld
2293 gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15c.t
2294 script_test_15c.stdout: script_test_15c
2295 $(TEST_READELF) -lSW script_test_15c > $@
2297 # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
2298 # and --dynamic-list-cpp-typeinfo
2300 check_SCRIPTS += dynamic_list.sh
2301 check_DATA += dynamic_list.stdout
2302 MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout
2303 dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
2304 $(CXXLINK) basic_test.o \
2305 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
2306 -Wl,--dynamic-list-data \
2307 -Wl,--dynamic-list-cpp-new \
2308 -Wl,--dynamic-list-cpp-typeinfo
2309 dynamic_list.stdout: dynamic_list
2310 $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout
2312 check_PROGRAMS += dynamic_list_2
2313 dynamic_list_2_SOURCES = dynamic_list_2.cc
2314 dynamic_list_2_DEPENDENCIES = gcctestdir/ld dynamic_list_lib1.so dynamic_list_lib2.so
2315 dynamic_list_2_LDFLAGS = -L. -Wl,-R,. -Wl,--no-as-needed
2316 dynamic_list_2_LDADD = dynamic_list_lib1.so dynamic_list_lib2.so
2318 dynamic_list_lib1.so: gcctestdir/ld dynamic_list_lib1.o
2319 $(CXXLINK) -shared dynamic_list_lib1.o
2320 dynamic_list_lib1.o: dynamic_list_lib1.cc
2321 $(CXXCOMPILE) -c -fpic -o $@ $<
2323 dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
2324 $(CXXLINK) -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
2325 dynamic_list_lib2.o: dynamic_list_lib2.cc
2326 $(CXXCOMPILE) -c -fpic -o $@ $<
2328 check_PROGRAMS += thin_archive_test_1
2329 MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
2330 alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
2331 alt/libthin2.a alt/libthin4.a
2332 thin_archive_test_1_SOURCES = thin_archive_main.cc
2333 thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
2334 thin_archive_test_1_LDFLAGS = -Lalt
2335 thin_archive_test_1_LDADD = libthin1.a -lthin2
2337 check_PROGRAMS += thin_archive_test_2
2338 thin_archive_test_2_SOURCES = thin_archive_main.cc
2339 thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
2340 thin_archive_test_2_LDFLAGS = -L.
2341 thin_archive_test_2_LDADD = -lthinall
2343 libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
2345 $(TEST_AR) crT $@ $^
2346 alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
2348 $(TEST_AR) crT $@ $^
2349 libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
2351 $(TEST_AR) crT $@ $^
2352 alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
2354 $(TEST_AR) crT $@ $^
2355 libthinall.a: libthin3.a alt/libthin4.a
2357 $(TEST_AR) crT $@ $^
2358 alt/thin_archive_test_2.o: thin_archive_test_2.cc
2359 test -d alt || mkdir -p alt
2360 $(CXXCOMPILE) -c -o $@ $<
2361 alt/thin_archive_test_4.o: thin_archive_test_4.cc
2362 test -d alt || mkdir -p alt
2363 $(CXXCOMPILE) -c -o $@ $<
2367 check_PROGRAMS += plugin_test_1
2368 check_SCRIPTS += plugin_test_1.sh
2369 check_DATA += plugin_test_1.err
2370 MOSTLYCLEANFILES += plugin_test_1.err
2371 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
2372 $(CXXLINK) -Wl,--no-demangle,--emit-relocs,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_1.err
2373 plugin_test_1.err: plugin_test_1
2374 @touch plugin_test_1.err
2376 check_PROGRAMS += plugin_test_2
2377 check_SCRIPTS += plugin_test_2.sh
2378 check_DATA += plugin_test_2.err
2379 MOSTLYCLEANFILES += plugin_test_2.err
2380 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
2381 $(CXXLINK) -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so 2>plugin_test_2.err
2382 plugin_test_2.err: plugin_test_2
2383 @touch plugin_test_2.err
2385 check_PROGRAMS += plugin_test_3
2386 check_SCRIPTS += plugin_test_3.sh
2387 check_DATA += plugin_test_3.err
2388 MOSTLYCLEANFILES += plugin_test_3.err
2389 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
2390 $(CXXLINK) -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_3.err
2391 plugin_test_3.err: plugin_test_3
2392 @touch plugin_test_3.err
2394 check_PROGRAMS += plugin_test_4
2395 check_SCRIPTS += plugin_test_4.sh
2396 check_DATA += plugin_test_4.err
2397 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
2398 plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
2399 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o -Wl,--whole-archive,plugin_test_4.a,--no-whole-archive 2>plugin_test_4.err
2400 plugin_test_4.err: plugin_test_4
2401 @touch plugin_test_4.err
2403 plugin_test_4.a: two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms
2406 check_PROGRAMS += plugin_test_5
2407 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
2408 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms
2410 check_PROGRAMS += plugin_test_6
2411 check_SCRIPTS += plugin_test_6.sh
2412 check_DATA += plugin_test_6.err
2413 MOSTLYCLEANFILES += plugin_test_6.err
2414 plugin_test_6: plugin_common_test_1.o.syms plugin_common_test_2.o.syms gcctestdir/ld plugin_test.so
2415 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o.syms 2>plugin_test_6.err
2416 plugin_test_6.err: plugin_test_6
2417 @touch plugin_test_6.err
2419 check_PROGRAMS += plugin_test_7
2420 check_SCRIPTS += plugin_test_7.sh
2421 check_DATA += plugin_test_7.err plugin_test_7.o.syms
2422 MOSTLYCLEANFILES += plugin_test_7.err
2423 plugin_test_7: plugin_test_7_1.o plugin_test_7_1.o.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
2424 $(LINK) -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.o.syms plugin_test_7_2.o 2>plugin_test_7.err
2425 plugin_test_7.o.syms: plugin_test_7
2426 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2427 plugin_test_7_1.o: plugin_test_7_1.c
2428 $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2429 plugin_test_7_1_orig.o: plugin_test_7_1.c
2430 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2431 plugin_test_7_1.o.syms: plugin_test_7_1_orig.o
2432 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2433 plugin_test_7_2.o: plugin_test_7_2.c
2434 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $<
2435 plugin_test_7.err: plugin_test_7
2437 # Test plugins with -r.
2438 check_PROGRAMS += plugin_test_8
2439 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
2440 ../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
2441 plugin_test_8: plugin_test_8.o gcctestdir/ld
2442 $(CXXLINK) -Wl,--no-demangle plugin_test_8.o
2444 # Test that symbols known in the IR file but not in the replacement file
2445 # produce an unresolved symbol error.
2446 check_DATA += plugin_test_9.err
2447 MOSTLYCLEANFILES += plugin_test_9.err
2448 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
2449 @echo $(CXXLINK) -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms "2>$@"
2450 @if $(CXXLINK) -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms 2>$@; then \
2451 echo 1>&2 "Link of plugin_test_9 should have failed"; \
2455 # Make a .syms file that claims to define the symbol _Z4t16av.
2456 two_file_test_1c.o.syms: two_file_test_1.o.syms two_file_test_1c.o
2457 cp two_file_test_1.o.syms $@.tmp
2458 grep "_Z4t16av" two_file_test_1b.o.syms >> $@.tmp
2460 # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
2461 MOSTLYCLEANFILES += two_file_test_1c.o
2462 two_file_test_1c.o: two_file_test_1.o
2463 cp two_file_test_1.o $@
2465 # As above, but check COMDAT case, where a non-IR file contains a duplicate
2466 # of a COMDAT group in an IR file.
2467 check_DATA += plugin_test_9b.err
2468 MOSTLYCLEANFILES += plugin_test_9b.err
2469 plugin_test_9b.err: plugin_test_9b_ir.o.syms plugin_test_9b_ir.o plugin_test_9b_elf.o gcctestdir/ld plugin_test.so
2470 @echo $(CXXLINK) -o plugin_test_9b -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_ZN1A5printEv" plugin_test_9b_ir.o plugin_test_9b_elf.o "2>$@"
2471 @if $(CXXLINK) -o plugin_test_9b -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_ZN1A5printEv" plugin_test_9b_ir.o plugin_test_9b_elf.o 2>$@; then \
2472 echo 1>&2 "Link of plugin_test_9b should have failed"; \
2476 # Make a .syms file that claims to define a method in class A in a COMDAT group.
2477 # The real plugin_test_9b_ir.o will be compiled without the -D, and will not
2478 # define any methods in class A.
2479 plugin_test_9b_ir.o.syms: plugin_test_9b_ir_witha.o
2480 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2481 plugin_test_9b_ir_witha.o: plugin_test_9b_ir.cc
2482 $(CXXCOMPILE) -c -DUSE_CLASS_A -o $@ $<
2484 check_PROGRAMS += plugin_test_10
2485 check_SCRIPTS += plugin_test_10.sh
2486 check_DATA += plugin_test_10.sections
2487 MOSTLYCLEANFILES += plugin_test_10.sections
2488 plugin_test_10: plugin_common_test_1.o.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so
2489 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o
2490 plugin_test_10.sections: plugin_test_10
2491 $(TEST_READELF) -SW $< >$@ 2>/dev/null
2493 check_PROGRAMS += plugin_test_11
2494 check_SCRIPTS += plugin_test_11.sh
2495 check_DATA += plugin_test_11.err
2496 MOSTLYCLEANFILES += plugin_test_11.err plugin_test_thin.a
2497 PLUGIN_TEST_11_SYMS = two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms
2498 plugin_test_11: two_file_test_main.o plugin_test_thin.a gcctestdir/ld plugin_test.so $(PLUGIN_TEST_11_SYMS)
2499 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o plugin_test_thin.a 2>plugin_test_11.err
2500 plugin_test_11.err: plugin_test_11
2501 @touch plugin_test_11.err
2502 plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o
2504 $(TEST_AR) crT $@ $^
2506 check_PROGRAMS += plugin_test_12
2507 check_SCRIPTS += plugin_test_12.sh
2508 check_DATA += plugin_test_12.err
2509 MOSTLYCLEANFILES += plugin_test_12.err
2510 export_dynamic_plugin.o.syms: export_dynamic_plugin.o
2511 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2512 export_dynamic_plugin.o: export_dynamic_plugin.cc
2513 $(CXXCOMPILE) -c -o $@ $<
2514 plugin_test_12: export_dynamic_plugin.o gcctestdir/ld plugin_test.so export_dynamic_plugin.o.syms
2515 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z3foov" -Wl,--export-dynamic-symbol,"_Z3foov" export_dynamic_plugin.o.syms 2>plugin_test_12.err
2516 plugin_test_12.err: plugin_test_12
2517 @touch plugin_test_12.err
2519 check_PROGRAMS += plugin_test_wrap_symbols
2520 check_SCRIPTS += plugin_test_wrap_symbols.sh
2521 check_DATA += plugin_test_wrap_symbols.err
2522 MOSTLYCLEANFILES += plugin_test_wrap_symbols.err
2523 plugin_test_wrap_symbols_1.o: plugin_test_wrap_symbols_1.cc
2524 $(CXXCOMPILE) -c -o $@ $<
2525 plugin_test_wrap_symbols_2.o: plugin_test_wrap_symbols_2.cc
2526 $(CXXCOMPILE) -c -o $@ $<
2527 plugin_test_wrap_symbols: plugin_test_wrap_symbols_1.o plugin_test_wrap_symbols_2.o gcctestdir/ld plugin_test.so
2528 $(CXXLINK) -Wl,--plugin,"./plugin_test.so" -Wl,--wrap=hello,--wrap=jello plugin_test_wrap_symbols_1.o plugin_test_wrap_symbols_2.o 2>plugin_test_wrap_symbols.err
2529 plugin_test_wrap_symbols.err: plugin_test_wrap_symbols
2530 @touch plugin_test_wrap_symbols.err
2532 check_PROGRAMS += plugin_test_start_lib
2533 check_SCRIPTS += plugin_test_start_lib.sh
2534 check_DATA += plugin_test_start_lib.err
2535 MOSTLYCLEANFILES += plugin_test_start_lib.err
2536 plugin_test_start_lib: unused.o plugin_start_lib_test.o plugin_start_lib_test_2.syms gcctestdir/ld plugin_test.so
2537 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_start_lib_test.o \
2538 -Wl,--start-lib plugin_start_lib_test_2.syms -Wl,--end-lib 2>plugin_test_start_lib.err
2539 plugin_test_start_lib.err: plugin_test_start_lib
2540 @touch plugin_test_start_lib.err
2542 check_PROGRAMS += plugin_test_defsym
2543 check_SCRIPTS += plugin_test_defsym.sh
2544 check_DATA += plugin_test_defsym.err
2545 MOSTLYCLEANFILES += plugin_test_defsym.err
2546 plugin_test_defsym.syms: plugin_test_defsym.o
2547 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2548 plugin_test_defsym.o: plugin_test_defsym.c
2549 $(COMPILE) -c -o $@ $<
2550 plugin_test_defsym: plugin_test_defsym.o plugin_test_defsym.syms gcctestdir/ld plugin_test.so
2551 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so" -Wl,--defsym,bar=foo plugin_test_defsym.syms 2>plugin_test_defsym.err
2552 plugin_test_defsym.err: plugin_test_defsym
2553 @touch plugin_test_defsym.err
2555 plugin_start_lib_test_2.syms: plugin_start_lib_test_2.o
2556 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2558 plugin_test.so: plugin_test.o gcctestdir/ld
2559 $(LINK) -shared plugin_test.o
2560 plugin_test.o: plugin_test.c
2561 $(COMPILE) -O0 -c -fpic -o $@ $<
2563 plugin_common_test_1.o: plugin_common_test_1.c
2564 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
2565 plugin_common_test_2.o: plugin_common_test_2.c
2566 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
2568 two_file_test_main.o.syms: two_file_test_main.o
2569 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2570 two_file_test_1.o.syms: two_file_test_1.o
2571 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2572 two_file_test_1b.o.syms: two_file_test_1b.o
2573 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2574 two_file_test_2.o.syms: two_file_test_2.o
2575 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2576 plugin_common_test_1.o.syms: plugin_common_test_1.o
2577 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2578 plugin_common_test_2.o.syms: plugin_common_test_2.o
2579 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2583 @echo "Symbol table" >>$@
2587 check_PROGRAMS += plugin_test_tls
2588 check_SCRIPTS += plugin_test_tls.sh
2589 check_DATA += plugin_test_tls.err
2590 MOSTLYCLEANFILES += plugin_test_tls.err
2591 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
2592 $(CXXLINK) -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms 2>plugin_test_tls.err
2593 plugin_test_tls.err: plugin_test_tls
2594 @touch plugin_test_tls.err
2596 two_file_test_2_tls.o.syms: two_file_test_2_tls.o
2597 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2601 MOSTLYCLEANFILES += unused.c
2602 unused.o.syms: unused.o
2603 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2604 @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@
2606 $(COMPILE) -c -o $@ $<
2610 check_SCRIPTS += plugin_final_layout.sh
2611 check_DATA += plugin_final_layout.stdout plugin_final_layout_readelf.stdout
2612 MOSTLYCLEANFILES += plugin_final_layout
2613 plugin_final_layout.o: plugin_final_layout.cc
2614 $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
2615 plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
2616 $(CXXLINK) -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
2617 plugin_final_layout.stdout: plugin_final_layout
2618 $(TEST_NM) -n --synthetic plugin_final_layout > plugin_final_layout.stdout
2619 plugin_final_layout_readelf.stdout: plugin_final_layout
2620 $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout
2622 plugin_section_order.so: plugin_section_order.o gcctestdir/ld
2623 $(LINK) -shared plugin_section_order.o
2624 plugin_section_order.o: plugin_section_order.c
2625 $(COMPILE) -O0 -c -fpic -o $@ $<
2627 # Uses the plugin_final_layout.sh script above to avoid duplication
2628 check_DATA += plugin_layout_new_file.stdout plugin_layout_new_file_readelf.stdout
2629 MOSTLYCLEANFILES += plugin_layout_new_file
2630 plugin_final_layout.o.syms: plugin_final_layout.o
2631 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2632 plugin_layout_new_file: plugin_final_layout.o.syms plugin_test.so plugin_new_section_layout.so gcctestdir/ld
2633 $(CXXLINK) -Wl,--plugin,"./plugin_test.so" -Wl,--plugin,"./plugin_new_section_layout.so" plugin_final_layout.o.syms
2634 plugin_layout_new_file.stdout: plugin_layout_new_file
2635 $(TEST_NM) -n --synthetic plugin_layout_new_file > plugin_layout_new_file.stdout
2636 plugin_layout_new_file_readelf.stdout: plugin_layout_new_file
2637 $(TEST_READELF) -Wl plugin_layout_new_file > plugin_layout_new_file_readelf.stdout
2639 plugin_new_section_layout.so: plugin_new_section_layout.o gcctestdir/ld
2640 $(LINK) -shared plugin_new_section_layout.o
2641 plugin_new_section_layout.o: plugin_new_section_layout.c
2642 $(COMPILE) -O0 -c -fpic -o $@ $<
2644 check_SCRIPTS += plugin_layout_with_alignment.sh
2645 check_DATA += plugin_layout_with_alignment.stdout
2646 MOSTLYCLEANFILES += plugin_layout_with_alignment
2647 plugin_layout_with_alignment.o: plugin_layout_with_alignment.c
2648 $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $<
2649 plugin_layout_with_alignment: plugin_layout_with_alignment.o plugin_section_alignment.so gcctestdir/ld
2650 $(LINK) -Wl,--plugin,"./plugin_section_alignment.so" plugin_layout_with_alignment.o
2651 plugin_layout_with_alignment.stdout: plugin_layout_with_alignment
2652 $(TEST_NM) -n --synthetic plugin_layout_with_alignment > plugin_layout_with_alignment.stdout
2654 plugin_section_alignment.so: plugin_section_alignment.o gcctestdir/ld
2655 $(CXXLINK) -shared plugin_section_alignment.o
2656 plugin_section_alignment.o: plugin_section_alignment.cc
2657 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
2659 check_SCRIPTS += plugin_pr22868.sh
2660 check_DATA += plugin_pr22868.stdout
2661 MOSTLYCLEANFILES += plugin_pr22868.stdout
2662 plugin_pr22868.stdout: plugin_pr22868.so
2663 $(TEST_READELF) -W --dyn-syms $< >$@ 2>/dev/null
2664 plugin_pr22868.so: plugin_pr22868_a.o.syms plugin_pr22868_b.o.syms plugin_pr22868_b.o plugin_test.so gcctestdir/ld
2665 $(LINK) -shared -Wl,--plugin,"./plugin_test.so" plugin_pr22868_a.o.syms plugin_pr22868_b.o.syms
2666 plugin_pr22868_a.o.syms: plugin_pr22868_a.o
2667 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2668 # Generate the .syms file from an alternate version of the original source
2669 # file, with a "protected" visibility attribute. We'll link with a
2670 # "replacement" object that does not have that attribute.
2671 plugin_pr22868_b.o.syms: plugin_pr22868_b_ir.o
2672 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2673 plugin_pr22868_a.o: plugin_pr22868_a.c
2674 $(COMPILE) -c -fpic -o $@ $<
2675 plugin_pr22868_b_ir.o: plugin_pr22868_b.c
2676 $(COMPILE) -c -DIR -fpic -o $@ $<
2677 plugin_pr22868_b.o: plugin_pr22868_b.c
2678 $(COMPILE) -c -fpic -o $@ $<
2680 check_SCRIPTS += ver_test_pr16504.sh
2681 check_DATA += ver_test_pr16504.stdout
2682 ver_test_pr16504.stdout: ver_test_pr16504.so
2683 $(TEST_READELF) -W --dyn-syms $< >$@ 2>/dev/null
2684 ver_test_pr16504.so: ver_test_pr16504_a.so ver_test_pr16504_b.o.syms ver_test_pr16504_b.script gcctestdir/ld
2685 gcctestdir/ld -shared -o $@ --plugin ./plugin_test.so --version-script $(srcdir)/ver_test_pr16504_b.script ver_test_pr16504_b.o.syms ver_test_pr16504_a.so
2686 ver_test_pr16504_a.so: ver_test_pr16504_a.o ver_test_pr16504_a.script gcctestdir/ld
2687 gcctestdir/ld -shared -o $@ --version-script $(srcdir)/ver_test_pr16504_a.script ver_test_pr16504_a.o
2688 ver_test_pr16504_a.o: ver_test_pr16504_a.c
2689 $(COMPILE) -c -fpic -o $@ $<
2690 # Filter out the UNDEFs from the symbols file to simulate GCC behavior,
2691 # which does not pass the UNDEF from a .symver directive.
2692 ver_test_pr16504_b.o.syms: ver_test_pr16504_b.o
2693 $(TEST_READELF) -sW $< 2>/dev/null | grep -v "UND" >$@
2694 ver_test_pr16504_b.o: ver_test_pr16504_b.c
2695 $(COMPILE) -c -fpic -o $@ $<
2699 check_PROGRAMS += exclude_libs_test
2700 check_SCRIPTS += exclude_libs_test.sh
2701 check_DATA += exclude_libs_test.syms
2702 MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
2703 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
2704 exclude_libs_test_SOURCES = exclude_libs_test.c
2705 exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
2706 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
2707 exclude_libs_test_LDFLAGS = -L. -Lalt \
2708 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
2709 -Wl,--exclude-libs,libexclude_libs_test_3
2710 exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
2711 alt/libexclude_libs_test_3.a
2712 exclude_libs_test.syms: exclude_libs_test
2713 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2714 libexclude_libs_test_1.a: exclude_libs_test_1.o
2716 libexclude_libs_test_2.a: exclude_libs_test_2.o
2718 alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
2719 test -d alt || mkdir -p alt
2722 check_PROGRAMS += local_labels_test
2723 local_labels_test.o: ver_test_6.c
2724 $(COMPILE) -g -c -Wa,-L -o $@ $<
2725 local_labels_test: local_labels_test.o gcctestdir/ld
2726 $(LINK) local_labels_test.o
2728 check_PROGRAMS += discard_locals_test
2729 check_SCRIPTS += discard_locals_test.sh
2730 check_DATA += discard_locals_test.syms \
2731 discard_locals_relocatable_test1.syms \
2732 discard_locals_relocatable_test2.syms
2733 MOSTLYCLEANFILES += discard_locals_test.syms \
2734 discard_locals_relocatable_test1.syms \
2735 discard_locals_relocatable_test2.syms \
2736 discard_locals_relocatable_test1.out \
2737 discard_locals_relocatable_test2.out
2738 discard_locals_test_SOURCES = discard_locals_test.c
2739 discard_locals_test_LDFLAGS = -Wl,--discard-locals
2740 discard_locals_test.syms: discard_locals_test
2741 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2742 # '-Wa,-L' is required to preserve the local label used for testing.
2743 discard_locals_test.o: discard_locals_test.c
2744 $(COMPILE) -c -Wa,-L -o $@ $<
2746 discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out
2747 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2748 discard_locals_relocatable_test.o: discard_locals_relocatable_test.c
2749 $(COMPILE) -c -Wa,-L -fPIC -o $@ $<
2750 discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new
2751 ../ld-new --discard-locals -relocatable -o $@ $<
2753 discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out
2754 $(TEST_READELF) -sW $< >$@ 2>/dev/null
2755 discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new
2756 ../ld-new --discard-all -relocatable -o $@ $<
2759 check_PROGRAMS += large
2760 large_SOURCES = large.c
2761 large_CFLAGS = -mcmodel=medium
2762 large_DEPENDENCIES = gcctestdir/ld
2764 endif MCMODEL_MEDIUM
2766 # Test that hidden and internal symbols in the main program cannot be
2767 # referenced by a shared library.
2768 check_SCRIPTS += hidden_test.sh
2769 check_DATA += hidden_test.err
2770 MOSTLYCLEANFILES += hidden_test hidden_test.err hidden_test.syms
2771 libhidden.so: hidden_test_1.c gcctestdir/ld
2772 $(COMPILE) -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
2773 hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
2774 $(LINK) -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
2775 hidden_test.syms: hidden_test
2776 $(TEST_NM) -D hidden_test > $@
2777 hidden_test.err: hidden_test
2778 @touch hidden_test.err
2780 # Test -retain-symbols-file.
2781 check_SCRIPTS += retain_symbols_file_test.sh
2782 check_DATA += retain_symbols_file_test.stdout
2783 MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
2784 retain_symbols_file_test.stdout
2785 retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld
2786 echo 'main' > retain_symbols_file_test.in
2787 echo 't1' >> retain_symbols_file_test.in
2788 echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
2789 echo '_Z3t18v' >> retain_symbols_file_test.in
2790 echo '__tcf_0' >> retain_symbols_file_test.in
2791 $(CXXLINK) -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
2792 retain_symbols_file_test.stdout: retain_symbols_file_test.so
2793 $(TEST_NM) -C retain_symbols_file_test.so > $@
2796 # Test that if the output file already exists and is empty,
2797 # it will get execute permission.
2798 check_PROGRAMS += permission_test
2799 permission_test: basic_test.o gcctestdir/ld
2804 $(CXXLINK) basic_test.o
2807 check_PROGRAMS += searched_file_test
2808 MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
2809 alt/searched_file_test_lib.a
2810 searched_file_test_SOURCES = searched_file_test.cc
2811 searched_file_test_DEPENDENCIES = gcctestdir/ld alt/searched_file_test_lib.a
2812 searched_file_test_LDFLAGS = -Lalt
2813 searched_file_test_LDADD = -l:searched_file_test_lib.a
2814 searched_file_test_lib.o: searched_file_test_lib.cc
2815 $(CXXCOMPILE) -c -o $@ $<
2816 alt/searched_file_test_lib.a: searched_file_test_lib.o
2817 test -d alt || mkdir -p alt
2820 # Test that no .gnu.version sections are created when
2821 # symbol versioning is not used.
2822 check_SCRIPTS += no_version_test.sh
2823 check_DATA += no_version_test.stdout
2824 MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
2825 # We invoke the linker directly since gcc may include additional objects that
2826 # uses symbol versioning.
2827 libno_version_test.so: no_version_test.o gcctestdir/ld
2828 gcctestdir/ld -shared -o $@ no_version_test.o
2829 no_version_test.o: no_version_test.c
2830 $(COMPILE) -o $@ -c -fPIC $<
2831 no_version_test.stdout: libno_version_test.so
2832 $(TEST_OBJDUMP) -h $< > $@
2834 # Test STT_GNU_IFUNC symbols.
2837 ifuncmod1.o: ifuncmod1.c
2838 $(COMPILE) -c -fPIC -o $@ $<
2839 ifuncmod1.so: ifuncmod1.o gcctestdir/ld
2840 $(LINK) -shared ifuncmod1.o
2842 ifuncdep1.o: ifuncmod1.c
2843 $(COMPILE) -c -o $@ $<
2845 ifuncmain1pic.o: ifuncmain1.c
2846 $(COMPILE) -c -fPIC -o $@ $<
2847 ifuncmain1pie.o: ifuncmain1.c
2848 $(COMPILE) -c -fPIE -o $@ $<
2852 check_PROGRAMS += ifuncmain1static
2853 ifuncmain1static_SOURCES = ifuncmain1.c
2854 ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
2855 ifuncmain1static_LDFLAGS = -static
2856 ifuncmain1static_LDADD = ifuncdep1.o
2858 check_PROGRAMS += ifuncmain1picstatic
2860 check_SCRIPTS += ifuncmod1.sh
2861 check_DATA += ifuncmod1.so.stderr
2862 ifuncmod1.so.stderr: ifuncmod1.so
2863 $(TEST_READELF) -s $< > /dev/null 2> $@
2867 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
2868 $(LINK) -static ifuncmain1pic.o ifuncmod1.o
2870 check_PROGRAMS += ifuncmain1
2871 ifuncmain1_SOURCES = ifuncmain1.c
2872 ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
2873 ifuncmain1_LDFLAGS = -Wl,-R,.
2874 ifuncmain1_LDADD = ifuncmod1.so
2876 check_PROGRAMS += ifuncmain1pic
2877 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
2878 $(LINK) ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
2880 check_PROGRAMS += ifuncmain1vis
2881 ifuncmain1vis_SOURCES = ifuncmain1vis.c
2882 ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
2883 ifuncmain1vis_LDFLAGS = -Wl,-R,.
2884 ifuncmain1vis_LDADD = ifuncmod1.so
2886 check_PROGRAMS += ifuncmain1vispic
2887 ifuncmain1vispic.o: ifuncmain1vis.c
2888 $(COMPILE) -c -fPIC -o $@ $<
2889 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
2890 $(LINK) ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
2892 check_PROGRAMS += ifuncmain1staticpic
2893 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
2894 $(LINK) ifuncmain1pic.o ifuncmod1.o
2896 check_PROGRAMS += ifuncmain1pie
2897 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
2898 $(LINK) -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
2900 check_PROGRAMS += ifuncmain1vispie
2901 ifuncmain1vispie.o: ifuncmain1vis.c
2902 $(COMPILE) -c -fPIE -o $@ $<
2903 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
2904 $(LINK) -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
2906 check_PROGRAMS += ifuncmain1staticpie
2907 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
2908 $(LINK) -pie ifuncmain1pie.o ifuncmod1.o
2910 ifuncmain2pic.o: ifuncmain2.c
2911 $(COMPILE) -c -fPIC -o $@ $<
2913 ifuncdep2pic.o: ifuncdep2.c
2914 $(COMPILE) -c -fPIC -o $@ $<
2918 check_PROGRAMS += ifuncmain2static
2919 ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
2920 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
2921 ifuncmain2static_LDFLAGS = -static
2922 ifuncmain2static_LDADD =
2924 check_PROGRAMS += ifuncmain2picstatic
2928 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
2929 $(LINK) -static ifuncmain2pic.o ifuncdep2pic.o
2931 check_PROGRAMS += ifuncmain2
2932 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
2933 ifuncmain2_DEPENDENCIES = gcctestdir/ld
2936 check_PROGRAMS += ifuncmain2pic
2937 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
2938 $(LINK) ifuncmain2pic.o ifuncdep2pic.o
2940 ifuncmod3.o: ifuncmod3.c
2941 $(COMPILE) -c -fPIC -o $@ $<
2942 ifuncmod3.so: ifuncmod3.o gcctestdir/ld
2943 $(LINK) -shared ifuncmod3.o
2945 check_PROGRAMS += ifuncmain3
2946 ifuncmain3_SOURCES = ifuncmain3.c
2947 ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
2948 ifuncmain3_LDFLAGS = -Wl,--export-dynamic -Wl,-R,.
2949 ifuncmain3_LDADD = -ldl
2951 ifuncmain4pic.o: ifuncmain4.c
2952 $(COMPILE) -c -fPIC -o $@ $<
2956 check_PROGRAMS += ifuncmain4static
2957 ifuncmain4static_SOURCES = ifuncmain4.c
2958 ifuncmain4static_DEPENDENCIES = gcctestdir/ld
2959 ifuncmain4static_LDFLAGS = -static
2960 ifuncmain4static_LDADD =
2962 check_PROGRAMS += ifuncmain4picstatic
2966 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
2967 $(LINK) -static ifuncmain4pic.o
2969 check_PROGRAMS += ifuncmain4
2970 ifuncmain4_SOURCES = ifuncmain4.c
2971 ifuncmain4_DEPENDENCIES = gcctestdir/ld
2974 ifuncmain5pic.o: ifuncmain5.c
2975 $(COMPILE) -c -fPIC -o $@ $<
2977 ifuncmain5pie.o: ifuncmain5.c
2978 $(COMPILE) -c -fPIE -o $@ $<
2980 ifuncmod5.o: ifuncmod5.c
2981 $(COMPILE) -c -fPIC -o $@ $<
2982 ifuncmod5.so: ifuncmod5.o gcctestdir/ld
2983 $(LINK) -shared ifuncmod5.o
2985 ifuncdep5.o: ifuncmod5.c
2986 $(COMPILE) -c -o $@ $<
2990 check_PROGRAMS += ifuncmain5static
2991 ifuncmain5static_SOURCES = ifuncmain5.c
2992 ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
2993 ifuncmain5static_LDFLAGS = -static
2994 ifuncmain5static_LDADD = ifuncdep5.o
2996 check_PROGRAMS += ifuncmain5picstatic
3000 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
3001 $(LINK) -static ifuncmain5pic.o ifuncmod5.o
3003 check_PROGRAMS += ifuncmain5
3004 ifuncmain5_SOURCES = ifuncmain5.c
3005 ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
3006 ifuncmain5_LDFLAGS = -Wl,-R,.
3007 ifuncmain5_LDADD = ifuncmod5.so
3009 check_PROGRAMS += ifuncmain5pic
3010 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
3011 $(LINK) ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
3013 check_PROGRAMS += ifuncmain5staticpic
3014 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
3015 $(LINK) ifuncmain5pic.o ifuncmod5.o
3017 check_PROGRAMS += ifuncmain5pie
3018 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
3019 $(LINK) -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
3021 ifuncmain6pie.o: ifuncmain6pie.c
3022 $(COMPILE) -c -fPIE -o $@ $<
3024 ifuncmod6.o: ifuncmod6.c
3025 $(COMPILE) -c -fPIC -o $@ $<
3026 ifuncmod6.so: ifuncmod6.o gcctestdir/ld
3027 $(LINK) -shared ifuncmod6.o
3029 check_PROGRAMS += ifuncmain6pie
3030 ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
3031 $(LINK) -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
3033 ifuncmain7pic.o: ifuncmain7.c
3034 $(COMPILE) -c -fPIC -o $@ $<
3036 ifuncmain7pie.o: ifuncmain7.c
3037 $(COMPILE) -c -fPIE -o $@ $<
3041 check_PROGRAMS += ifuncmain7static
3042 ifuncmain7static_SOURCES = ifuncmain7.c
3043 ifuncmain7static_DEPENDENCIES = gcctestdir/ld
3044 ifuncmain7static_LDFLAGS = -static
3045 ifuncmain7static_LDADD =
3047 check_PROGRAMS += ifuncmain7picstatic
3051 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
3052 $(LINK) -static ifuncmain7pic.o
3054 check_PROGRAMS += ifuncmain7
3055 ifuncmain7_SOURCES = ifuncmain7.c
3056 ifuncmain7_DEPENDENCIES = gcctestdir/ld
3059 check_PROGRAMS += ifuncmain7pic
3060 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
3061 $(LINK) ifuncmain7pic.o
3063 check_PROGRAMS += ifuncmain7pie
3064 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
3065 $(LINK) -pie ifuncmain7pie.o
3067 check_PROGRAMS += ifuncvar
3068 ifuncvar1_pic.o: ifuncvar1.c
3069 $(COMPILE) -c -fPIC -o $@ $<
3070 ifuncvar2_pic.o: ifuncvar2.c
3071 $(COMPILE) -c -fPIC -o $@ $<
3072 ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
3073 $(LINK) -shared ifuncvar1_pic.o ifuncvar2_pic.o
3074 ifuncvar_SOURCES = ifuncvar3.c
3075 ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
3076 ifuncvar_LDFLAGS = -Wl,-R,.
3077 ifuncvar_LDADD = ifuncvar.so
3081 # Test that strong reference to a weak symbol in a DSO remains strong.
3082 check_SCRIPTS += strong_ref_weak_def.sh
3083 check_DATA += strong_ref_weak_def.stdout
3084 MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
3085 strong_ref_weak_def.stdout
3086 strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
3087 $(COMPILE) -o $@ -c -fPIC $<
3088 strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
3089 gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
3090 strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
3091 $(COMPILE) -o $@ -c -fPIC $<
3092 strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
3094 gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
3095 strong_ref_weak_def_2.so
3096 strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
3097 $(TEST_READELF) -sWD $< > $@
3099 # Test that a strong weak reference remains strong if there is another
3100 # weak reference in a DSO.
3101 check_SCRIPTS += dyn_weak_ref.sh
3102 check_DATA += dyn_weak_ref.stdout
3103 MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
3105 dyn_weak_ref_2.o: dyn_weak_ref_2.c
3106 $(COMPILE) -o $@ -c -fPIC $<
3107 dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
3108 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
3109 dyn_weak_ref_1.o: dyn_weak_ref_1.c
3110 $(COMPILE) -o $@ -c -fPIC $<
3111 # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
3112 # so that the weak ref there goes to gold's symbol table first.
3113 dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
3114 gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
3115 dyn_weak_ref.stdout: dyn_weak_ref_1.so
3116 $(TEST_READELF) -sWD $< > $@
3119 # Test that --start-lib and --end-lib function correctly.
3120 check_PROGRAMS += start_lib_test
3121 MOSTLYCLEANFILES += libstart_lib_test.a
3122 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
3124 $(LINK) -o $@ start_lib_test_main.o -L. -lstart_lib_test \
3125 -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib
3126 libstart_lib_test.a: start_lib_test_1.o
3129 # Test that MEMORY region support works.
3130 check_SCRIPTS += memory_test.sh
3131 check_DATA += memory_test.stdout
3132 MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o
3133 memory_test.o: memory_test.s
3134 $(COMPILE) -o $@ -c $<
3135 memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t
3136 $(LINK) -nostartfiles -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-z,common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o
3137 memory_test.stdout: memory_test
3138 $(TEST_READELF) -lWS $< > $@
3140 # Test INCLUDE directives in linker scripts.
3141 # The binary isn't runnable, so we just check that we can build it without errors.
3142 check_DATA += memory_test_2
3143 MOSTLYCLEANFILES += memory_test_inc_1.t memory_test_inc_2.t memory_test_inc_3.t memory_test_2
3144 memory_test_inc_1.t: $(srcdir)/memory_test_inc_1.t.src
3146 memory_test_inc_2.t: $(srcdir)/memory_test_inc_2.t.src
3148 memory_test_inc_3.t: $(srcdir)/memory_test_inc_3.t.src
3150 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
3151 $(LINK) -nostartfiles -nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-z,common-page-size=0x1000 -Wl,-T,$(srcdir)/memory_test.t -o $@ memory_test.o
3155 # Test that --gdb-index functions correctly without gcc-generated pubnames.
3156 check_SCRIPTS += gdb_index_test_1.sh
3157 check_DATA += gdb_index_test_1.stdout
3158 MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1
3159 gdb_index_test.o: gdb_index_test.cc
3160 $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $<
3161 gdb_index_test_1: gdb_index_test.o gcctestdir/ld
3162 $(CXXLINK) -Wl,--gdb-index $<
3163 gdb_index_test_1.stdout: gdb_index_test_1
3164 $(TEST_READELF) --debug-dump=gdb_index $< > $@
3166 # Test that --gdb-index functions correctly with compressed debug sections.
3167 check_SCRIPTS += gdb_index_test_2.sh
3168 check_DATA += gdb_index_test_2.stdout
3169 MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 gdb_index_test_2_gabi
3170 gdb_index_test_cdebug.o: gdb_index_test.cc
3171 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
3172 gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
3173 $(CXXLINK) -Wl,--gdb-index $<
3174 gdb_index_test_2.stdout: gdb_index_test_2
3175 $(TEST_READELF) --debug-dump=gdb_index $< > $@
3176 check_SCRIPTS += gdb_index_test_2_gabi.sh
3177 check_DATA += gdb_index_test_2_gabi.stdout
3178 MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2
3179 gdb_index_test_cdebug_gabi.o: gdb_index_test.cc
3180 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections=zlib-gabi -c -o $@ $<
3181 gdb_index_test_2_gabi: gdb_index_test_cdebug_gabi.o gcctestdir/ld
3182 $(CXXLINK) -Wl,--gdb-index $<
3183 gdb_index_test_2_gabi.stdout: gdb_index_test_2_gabi
3184 $(TEST_READELF) --debug-dump=gdb_index $< > $@
3186 check_SCRIPTS += gdb_index_test_2_zstd.sh
3187 check_DATA += gdb_index_test_2_zstd.stdout
3188 MOSTLYCLEANFILES += gdb_index_test_2_zstd.stdout gdb_index_test_2_zstd
3189 gdb_index_test_cdebug_zstd.o: gdb_index_test.cc
3190 $(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections=zstd -c -o $@ $<
3191 gdb_index_test_2_zstd: gdb_index_test_cdebug_zstd.o gcctestdir/ld
3192 $(CXXLINK) -Wl,--gdb-index $<
3193 gdb_index_test_2_zstd.stdout: gdb_index_test_2_zstd
3194 $(TEST_READELF) --debug-dump=gdb_index $< > $@
3197 # Another simple C test (DW_AT_high_pc encoding) for --gdb-index.
3198 check_SCRIPTS += gdb_index_test_3.sh
3199 check_DATA += gdb_index_test_3.stdout
3200 MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3
3201 gdb_index_test_3.o: gdb_index_test_3.c
3202 $(COMPILE) -O0 -g -c -o $@ $<
3203 gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld
3204 $(LINK) -Wl,--gdb-index,--fatal-warnings $<
3205 gdb_index_test_3.stdout: gdb_index_test_3
3206 $(TEST_READELF) --debug-dump=gdb_index $< > $@
3208 # Test that --gdb-index functions correctly with gcc-generated pubnames.
3209 check_SCRIPTS += gdb_index_test_4.sh
3210 check_DATA += gdb_index_test_4.stdout
3211 MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4
3212 gdb_index_test_pub.o: gdb_index_test.cc
3213 $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $<
3214 gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld
3215 $(CXXLINK) -Wl,--gdb-index $<
3216 gdb_index_test_4.stdout: gdb_index_test_4
3217 $(TEST_READELF) --debug-dump=gdb_index $< > $@
3221 # Test that __ehdr_start is defined correctly.
3222 check_PROGRAMS += ehdr_start_test_1
3223 ehdr_start_test_1_SOURCES = ehdr_start_test.cc
3224 ehdr_start_test_1_DEPENDENCIES = gcctestdir/ld
3225 ehdr_start_test_1_CXXFLAGS =
3226 ehdr_start_test_1_LDADD =
3228 # Test that __ehdr_start is defined correctly with a weak reference.
3229 check_PROGRAMS += ehdr_start_test_2
3230 ehdr_start_test_2_SOURCES = ehdr_start_test.cc
3231 ehdr_start_test_2_DEPENDENCIES = gcctestdir/ld
3232 ehdr_start_test_2_CXXFLAGS = -DEHDR_START_WEAK
3233 ehdr_start_test_2_LDADD =
3235 # Test that __ehdr_start is defined correctly when used with a linker script.
3236 check_PROGRAMS += ehdr_start_test_3
3237 ehdr_start_test_3_SOURCES = ehdr_start_test.cc
3238 ehdr_start_test_3_DEPENDENCIES = gcctestdir/ld $(srcdir)/ehdr_start_test.t
3239 ehdr_start_test_3_CXXFLAGS = -DEHDR_START_WEAK
3240 ehdr_start_test_3_LDFLAGS = -Wl,-T,$(srcdir)/ehdr_start_test.t
3241 ehdr_start_test_3_LDADD =
3243 # Test that __ehdr_start is left undefined when the text segment is not
3244 # appropriately aligned.
3245 check_SCRIPTS += ehdr_start_test_4.sh
3246 check_DATA += ehdr_start_test_4.syms
3247 MOSTLYCLEANFILES += ehdr_start_test_4
3248 ehdr_start_test_4.syms: ehdr_start_test_4
3249 $(TEST_NM) ehdr_start_test_4 > $@
3250 ehdr_start_test_4: ehdr_start_test_4.o gcctestdir/ld
3251 $(CXXLINK) -Wl,-Ttext=0x100100 $<
3252 ehdr_start_test_4.o: ehdr_start_test.cc
3253 $(CXXCOMPILE) -c -DEHDR_START_WEAK -o $@ $<
3255 # Test that __ehdr_start is not overridden when supplied by the user.
3256 check_PROGRAMS += ehdr_start_test_5
3257 ehdr_start_test_5_SOURCES = ehdr_start_test.cc ehdr_start_def.cc
3258 ehdr_start_test_5_DEPENDENCIES = gcctestdir/ld
3259 ehdr_start_test_5_CXXFLAGS = -DEHDR_START_USER_DEF
3260 ehdr_start_test_5_LDADD =
3262 # Test that the --defsym option copies the symbol type and visibility.
3263 check_SCRIPTS += defsym_test.sh
3264 check_DATA += defsym_test.syms
3265 MOSTLYCLEANFILES += defsym_test defsym_test.syms
3266 defsym_test.syms: defsym_test
3267 $(TEST_READELF) -sW $< > $@
3268 defsym_test: defsym_test.o gcctestdir/ld
3269 $(LINK) -Wl,--defsym=bar=foo defsym_test.o
3270 defsym_test.o: defsym_test.c
3271 $(COMPILE) -c -o $@ $<
3273 # Test that the -d option (force common allocation) works correctly.
3274 check_PROGRAMS += pr20976
3275 pr20976: pr20976-d.o gcctestdir/ld
3277 pr20976-d.o: pr20976.o gcctestdir/ld
3278 gcctestdir/ld -r -d -o $@ pr20976.o
3280 # End-to-end incremental linking tests.
3281 # Incremental linking is currently supported only on the x86_64 target.
3283 if DEFAULT_TARGET_X86_64
3285 two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
3286 $(CXXCOMPILE) -O0 -g0 -fno-exceptions -fno-asynchronous-unwind-tables -c -o $@ $<
3287 two_file_test_1_ndebug.o: two_file_test_1.cc
3288 $(CXXCOMPILE) -O0 -g0 -fno-exceptions -fno-asynchronous-unwind-tables -c -o $@ $<
3289 two_file_test_1b_ndebug.o: two_file_test_1b.cc
3290 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
3291 two_file_test_2_ndebug.o: two_file_test_2.cc
3292 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
3293 two_file_test_main_ndebug.o: two_file_test_main.cc
3294 $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
3296 if !CFLAGS_CF_PROTECTION
3297 check_PROGRAMS += incremental_test_2
3299 MOSTLYCLEANFILES += two_file_test_tmp_2.o
3300 incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
3301 two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
3302 cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
3303 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
3305 cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
3306 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
3308 if !CFLAGS_CF_PROTECTION
3309 check_PROGRAMS += incremental_test_3
3311 MOSTLYCLEANFILES += two_file_test_tmp_3.o
3312 incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
3313 two_file_test_2.o two_file_test_main.o gcctestdir/ld
3314 cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
3315 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
3317 cp -f two_file_test_1b.o two_file_test_tmp_3.o
3318 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
3320 if !CFLAGS_CF_PROTECTION
3321 check_PROGRAMS += incremental_test_4
3323 MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
3324 incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
3325 two_file_test_2.o two_file_test_main.o gcctestdir/ld
3326 cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
3327 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
3328 mv -f incremental_test_4 incremental_test_4.base
3330 cp -f two_file_test_2.o two_file_test_tmp_4.o
3331 $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro,-no-pie two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
3333 if !CFLAGS_CF_PROTECTION
3334 check_PROGRAMS += incremental_test_5
3336 MOSTLYCLEANFILES += two_file_test_5.a
3337 incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
3338 two_file_test_2.o two_file_test_main.o gcctestdir/ld
3339 cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
3340 $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
3341 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie two_file_test_main.o two_file_test_5.a
3343 cp -f two_file_test_1b.o two_file_test_tmp_5.o
3344 $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
3345 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie two_file_test_main.o two_file_test_5.a
3347 # Test the --incremental-unchanged flag with an archive library.
3348 # The second link should not update the library.
3349 check_PROGRAMS += incremental_test_6
3350 MOSTLYCLEANFILES += two_file_test_6.a
3351 incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
3352 two_file_test_2.o two_file_test_main.o gcctestdir/ld
3353 cp -f two_file_test_1b.o two_file_test_tmp_6.o
3354 $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
3355 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie two_file_test_main.o two_file_test_6.a
3357 cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
3358 $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
3359 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
3361 if !CFLAGS_CF_PROTECTION
3362 check_PROGRAMS += incremental_copy_test
3364 incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
3365 cp -f copy_test_v1.o copy_test_tmp.o
3366 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
3368 cp -f copy_test.o copy_test_tmp.o
3369 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
3371 if !CFLAGS_CF_PROTECTION
3372 check_PROGRAMS += incremental_common_test_1
3374 incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
3375 cp -f common_test_1_v1.o common_test_1_tmp.o
3376 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie common_test_1_tmp.o
3378 cp -f common_test_1_v2.o common_test_1_tmp.o
3379 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie common_test_1_tmp.o
3380 common_test_1_v1.o: common_test_1_v1.c
3381 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
3382 common_test_1_v2.o: common_test_1_v2.c
3383 $(COMPILE) -c $(COMMON_TEST_C_CFLAGS) -o $@ $<
3385 if !CFLAGS_CF_PROTECTION
3386 check_PROGRAMS += incremental_comdat_test_1
3388 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
3389 cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
3390 $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie incr_comdat_test_1.o incr_comdat_test_1_tmp.o
3392 cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
3393 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie incr_comdat_test_1.o incr_comdat_test_1_tmp.o
3395 cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
3396 $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie incr_comdat_test_1.o incr_comdat_test_1_tmp.o
3398 endif DEFAULT_TARGET_X86_64
3400 if DEFAULT_TARGET_X86_64
3401 check_SCRIPTS += gnu_property_test.sh
3402 check_DATA += gnu_property_test.stdout
3403 MOSTLYCLEANFILES += gnu_property_test
3404 gnu_property_test.stdout: gnu_property_test
3405 $(TEST_READELF) -lhSWn $< >$@
3406 gnu_property_test: gcctestdir/ld gnu_property_a.o gnu_property_b.o gnu_property_c.o
3407 gcctestdir/ld --build-id -o $@ gnu_property_a.o gnu_property_b.o gnu_property_c.o
3408 gnu_property_main.o: gnu_property_main.c
3409 $(COMPILE) -c -o $@ $<
3410 gnu_property_a.o: gnu_property_a.S
3411 $(COMPILE) -c -o $@ $<
3412 gnu_property_b.o: gnu_property_b.S
3413 $(COMPILE) -c -o $@ $<
3414 gnu_property_c.o: gnu_property_c.S
3415 $(COMPILE) -c -o $@ $<
3416 endif DEFAULT_TARGET_X86_64
3418 check_PROGRAMS += pr22266
3419 pr22266: pr22266_main.o pr22266_ar.o gcctestdir/ld
3420 $(LINK) pr22266_main.o pr22266_ar.o
3421 pr22266_ar.o: pr22266_a.o gcctestdir/ld
3422 gcctestdir/ld -r -T $(srcdir)/pr22266_script.t -o $@ pr22266_a.o
3424 if DEFAULT_TARGET_AARCH64
3426 check_PROGRAMS += aarch64_pr23870
3427 aarch64_pr23870_SOURCES = aarch64_pr23870_foo.c
3428 aarch64_pr23870_DEPENDENCIES = \
3429 gcctestdir/ld gcctestdir/as aarch64_pr23870_main.o \
3430 aarch64_pr23870_foo.o aarch64_pr23870_bar.so
3431 aarch64_pr23870_LDFLAGS = -Wl,-R,. -L. -Wl,-l:aarch64_pr23870_bar.so
3432 aarch64_pr23870_LDADD = aarch64_pr23870_main.o
3433 aarch64_pr23870_main.o: aarch64_pr23870_main.S
3434 $(COMPILE) -c -o $@ $<
3435 aarch64_pr23870_foo.o: aarch64_pr23870_foo.c
3436 $(COMPILE) -c -o $@ $<
3437 aarch64_pr23870_bar.o: aarch64_pr23870_bar.c
3438 $(COMPILE) -c -fPIC -o $@ $<
3439 aarch64_pr23870_bar.so: aarch64_pr23870_bar.o
3440 $(COMPILE) -shared -o $@ $<
3442 endif DEFAULT_TARGET_AARCH64
3447 # These tests work with native and cross linkers.
3449 if NATIVE_OR_CROSS_LINKER
3451 # Test script section order.
3452 check_SCRIPTS += script_test_10.sh
3453 check_DATA += script_test_10.stdout
3454 MOSTLYCLEANFILES += script_test_10
3455 script_test_10.o: script_test_10.s
3457 script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
3458 gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t
3459 script_test_10.stdout: script_test_10
3460 $(TEST_READELF) -SW script_test_10 > $@
3462 # These tests work with cross linkers only.
3464 if DEFAULT_TARGET_I386
3466 check_SCRIPTS += split_i386.sh
3467 check_DATA += split_i386_1.stdout split_i386_2.stdout \
3468 split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
3469 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3470 split_i386_1.o: split_i386_1.s
3472 split_i386_2.o: split_i386_2.s
3474 split_i386_3.o: split_i386_3.s
3476 split_i386_4.o: split_i386_4.s
3478 split_i386_n.o: split_i386_n.s
3480 split_i386_1: split_i386_1.o split_i386_n.o ../ld-new
3481 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o
3482 split_i386_1.stdout: split_i386_1
3483 $(TEST_OBJDUMP) -d $< > $@
3484 split_i386_2: split_i386_2.o split_i386_n.o ../ld-new
3485 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o
3486 split_i386_2.stdout: split_i386_2
3487 $(TEST_OBJDUMP) -d $< > $@
3488 split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new
3489 ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0
3490 split_i386_4: split_i386_4.o split_i386_n.o ../ld-new
3491 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o
3492 split_i386_4.stdout: split_i386_4
3493 $(TEST_OBJDUMP) -d $< > $@
3494 split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new
3495 ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0
3496 MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \
3497 split_i386_4 split_i386_r
3499 endif DEFAULT_TARGET_I386
3501 if DEFAULT_TARGET_X86_64
3503 check_SCRIPTS += split_x86_64.sh
3504 check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \
3505 split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
3506 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3507 split_x86_64_1.o: split_x86_64_1.s
3509 split_x86_64_2.o: split_x86_64_2.s
3511 split_x86_64_3.o: split_x86_64_3.s
3513 split_x86_64_4.o: split_x86_64_4.s
3515 split_x86_64_n.o: split_x86_64_n.s
3517 split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new
3518 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o
3519 split_x86_64_1.stdout: split_x86_64_1
3520 $(TEST_OBJDUMP) -d $< > $@
3521 split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new
3522 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o
3523 split_x86_64_2.stdout: split_x86_64_2
3524 $(TEST_OBJDUMP) -d $< > $@
3525 split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new
3526 ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0
3527 split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new
3528 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o
3529 split_x86_64_4.stdout: split_x86_64_4
3530 $(TEST_OBJDUMP) -d $< > $@
3531 split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
3532 ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0
3533 MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
3534 split_x86_64_4 split_x86_64_r
3536 endif DEFAULT_TARGET_X86_64
3538 if DEFAULT_TARGET_X32
3540 check_SCRIPTS += split_x32.sh
3541 check_DATA += split_x32_1.stdout split_x32_2.stdout \
3542 split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout
3543 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
3544 split_x32_1.o: split_x32_1.s
3546 split_x32_2.o: split_x32_2.s
3548 split_x32_3.o: split_x32_3.s
3550 split_x32_4.o: split_x32_4.s
3552 split_x32_n.o: split_x32_n.s
3554 split_x32_1: split_x32_1.o split_x32_n.o ../ld-new
3555 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_1.o split_x32_n.o
3556 split_x32_1.stdout: split_x32_1
3557 $(TEST_OBJDUMP) -d $< > $@
3558 split_x32_2: split_x32_2.o split_x32_n.o ../ld-new
3559 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_2.o split_x32_n.o
3560 split_x32_2.stdout: split_x32_2
3561 $(TEST_OBJDUMP) -d $< > $@
3562 split_x32_3.stdout: split_x32_3.o split_x32_n.o ../ld-new
3563 ../ld-new $(SPLIT_DEFSYMS) -o split_x32_3 split_x32_3.o split_x32_n.o > $@ 2>&1 || exit 0
3564 split_x32_4: split_x32_4.o split_x32_n.o ../ld-new
3565 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_4.o split_x32_n.o
3566 split_x32_4.stdout: split_x32_4
3567 $(TEST_OBJDUMP) -d $< > $@
3568 split_x32_r.stdout: split_x32_1.o split_x32_n.o ../ld-new
3569 ../ld-new -r split_x32_1.o split_x32_n.o -o split_x32_r > $@ 2>&1 || exit 0
3570 MOSTLYCLEANFILES += split_x32_1 split_x32_2 split_x32_3 \
3571 split_x32_4 split_x32_r
3573 endif DEFAULT_TARGET_X32
3575 if DEFAULT_TARGET_ARM
3577 check_SCRIPTS += arm_abs_global.sh
3578 check_DATA += arm_abs_global.stdout
3579 arm_abs_lib.o: arm_abs_lib.s
3580 $(TEST_AS) -march=armv7-a -o $@ $<
3581 libarm_abs.so: arm_abs_lib.o ../ld-new
3582 ../ld-new -shared -o $@ arm_abs_lib.o
3583 arm_abs_global.o: arm_abs_global.s
3584 $(TEST_AS) -march=armv7-a -o $@ $<
3585 arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new
3586 ../ld-new -o $@ arm_abs_global.o -L. -larm_abs
3587 arm_abs_global.stdout: arm_abs_global
3588 $(TEST_READELF) -r $< > $@
3590 MOSTLYCLEANFILES += arm_abs_global
3592 check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh
3593 check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \
3594 thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \
3595 thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \
3596 thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \
3597 thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \
3598 thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \
3599 arm_thm_jump8.stdout
3601 arm_bl_in_range.stdout: arm_bl_in_range
3602 $(TEST_OBJDUMP) -D $< > $@
3604 arm_bl_in_range: arm_bl_in_range.o ../ld-new
3605 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
3607 arm_bl_in_range.o: arm_bl_in_range.s
3610 arm_bl_out_of_range.stdout: arm_bl_out_of_range
3611 $(TEST_OBJDUMP) -S $< > $@
3613 arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new
3614 ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $<
3616 arm_bl_out_of_range.o: arm_bl_out_of_range.s
3619 thumb_bl_in_range.stdout: thumb_bl_in_range
3620 $(TEST_OBJDUMP) -D $< > $@
3622 thumb_bl_in_range: thumb_bl_in_range.o ../ld-new
3623 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
3625 thumb_bl_in_range.o: thumb_bl_in_range.s
3626 $(TEST_AS) -o $@ -march=armv5te $<
3628 thumb_bl_out_of_range.stdout: thumb_bl_out_of_range
3629 $(TEST_OBJDUMP) -D $< > $@
3631 thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new
3632 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
3634 thumb_bl_out_of_range.o: thumb_bl_out_of_range.s
3635 $(TEST_AS) -o $@ -march=armv5te $<
3637 thumb2_bl_in_range.stdout: thumb2_bl_in_range
3638 $(TEST_OBJDUMP) -D $< > $@
3640 thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new
3641 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
3643 thumb2_bl_in_range.o: thumb_bl_in_range.s
3644 $(TEST_AS) -o $@ -march=armv7-a $<
3646 thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range
3647 $(TEST_OBJDUMP) -D $< > $@
3649 thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new
3650 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
3652 thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s
3653 $(TEST_AS) -o $@ -march=armv7-a $<
3655 thumb_blx_in_range.stdout: thumb_blx_in_range
3656 $(TEST_OBJDUMP) -D $< > $@
3658 thumb_blx_in_range: thumb_blx_in_range.o ../ld-new
3659 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
3661 thumb_blx_in_range.o: thumb_blx_in_range.s
3662 $(TEST_AS) -o $@ -march=armv5te $<
3664 thumb_blx_out_of_range.stdout: thumb_blx_out_of_range
3665 $(TEST_OBJDUMP) -D $< > $@
3667 thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new
3668 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
3670 thumb_blx_out_of_range.o: thumb_blx_out_of_range.s
3671 $(TEST_AS) -o $@ -march=armv5te $<
3673 thumb2_blx_in_range.stdout: thumb2_blx_in_range
3674 $(TEST_OBJDUMP) -D $< > $@
3676 thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new
3677 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
3679 thumb2_blx_in_range.o: thumb_blx_in_range.s
3680 $(TEST_AS) -o $@ -march=armv7-a $<
3682 thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range
3683 $(TEST_OBJDUMP) -D $< > $@
3685 thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new
3686 ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $<
3688 thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s
3689 $(TEST_AS) -o $@ -march=armv7-a $<
3691 thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local
3692 $(TEST_OBJDUMP) -D $< > $@
3694 thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new
3695 ../ld-new --no-fix-arm1176 -T $(srcdir)/thumb_branch_range.t -o $@ $<
3697 thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s
3698 $(TEST_AS) -o $@ -march=armv5te $<
3700 arm_thm_jump11.stdout: arm_thm_jump11
3701 $(TEST_OBJDUMP) -D $< > $@
3703 arm_thm_jump11: arm_thm_jump11.o ../ld-new
3704 ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $<
3706 arm_thm_jump11.o: arm_thm_jump11.s
3709 arm_thm_jump8.stdout: arm_thm_jump8
3710 $(TEST_OBJDUMP) -D $< > $@
3712 arm_thm_jump8: arm_thm_jump8.o ../ld-new
3713 ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $<
3715 arm_thm_jump8.o: arm_thm_jump8.s
3718 MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \
3719 thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \
3720 thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \
3721 thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \
3724 check_SCRIPTS += arm_fix_v4bx.sh
3725 check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \
3726 arm_no_fix_v4bx.stdout
3728 arm_fix_v4bx.stdout: arm_fix_v4bx
3729 $(TEST_OBJDUMP) -D -j.text $< > $@
3731 arm_fix_v4bx: arm_fix_v4bx.o ../ld-new
3732 ../ld-new --no-fix-arm1176 --fix-v4bx -o $@ $<
3734 arm_fix_v4bx.o: arm_fix_v4bx.s
3737 arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking
3738 $(TEST_OBJDUMP) -D -j.text $< > $@
3740 arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new
3741 ../ld-new --no-fix-arm1176 --fix-v4bx-interworking -o $@ $<
3743 arm_no_fix_v4bx.stdout: arm_no_fix_v4bx
3744 $(TEST_OBJDUMP) -D -j.text $< > $@
3746 arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new
3747 ../ld-new --no-fix-arm1176 -o $@ $<
3749 MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx
3751 check_SCRIPTS += arm_attr_merge.sh
3752 check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
3753 arm_attr_merge_7.stdout
3755 arm_attr_merge_6.stdout: arm_attr_merge_6
3756 $(TEST_READELF) -A $< > $@
3758 arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o ../ld-new
3759 ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
3761 arm_attr_merge_6a.o: arm_attr_merge_6a.s
3764 arm_attr_merge_6b.o: arm_attr_merge_6b.s
3767 arm_attr_merge_6r.stdout: arm_attr_merge_6r
3768 $(TEST_READELF) -A $< > $@
3770 arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o ../ld-new
3771 ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
3773 arm_attr_merge_7.stdout: arm_attr_merge_7
3774 $(TEST_READELF) -A $< > $@
3776 arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o ../ld-new
3777 ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
3779 arm_attr_merge_7a.o: arm_attr_merge_7a.s
3782 arm_attr_merge_7b.o: arm_attr_merge_7b.s
3785 MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7
3787 # ARM1176 workaround test.
3788 check_SCRIPTS += arm_fix_1176.sh
3789 check_DATA += arm_fix_1176_default_v6z.stdout arm_fix_1176_on_v6z.stdout \
3790 arm_fix_1176_off_v6z.stdout arm_fix_1176_default_v5te.stdout \
3791 arm_fix_1176_default_v7a.stdout arm_fix_1176_default_1156t2f_s.stdout
3793 arm_fix_1176_default_v6z.stdout: arm_fix_1176_default_v6z
3794 $(TEST_OBJDUMP) -D -j.foo $< > $@
3796 arm_fix_1176_default_v6z: arm_fix_1176_default_v6z.o ../ld-new
3797 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3799 arm_fix_1176_default_v6z.o: arm_fix_1176.s
3800 $(TEST_AS) -march=armv6z -o $@ $<
3802 arm_fix_1176_on_v6z.stdout: arm_fix_1176_on_v6z
3803 $(TEST_OBJDUMP) -D -j.foo $< > $@
3805 arm_fix_1176_on_v6z: arm_fix_1176_on_v6z.o ../ld-new
3806 ../ld-new --section-start=.foo=0x2001014 --fix-arm1176 -o $@ $<
3808 arm_fix_1176_on_v6z.o: arm_fix_1176.s
3809 $(TEST_AS) -march=armv6z -o $@ $<
3811 arm_fix_1176_off_v6z.stdout: arm_fix_1176_off_v6z
3812 $(TEST_OBJDUMP) -D -j.foo $< > $@
3814 arm_fix_1176_off_v6z: arm_fix_1176_off_v6z.o ../ld-new
3815 ../ld-new --section-start=.foo=0x2001014 --no-fix-arm1176 -o $@ $<
3817 arm_fix_1176_off_v6z.o: arm_fix_1176.s
3818 $(TEST_AS) -march=armv6z -o $@ $<
3820 arm_fix_1176_default_v5te.stdout: arm_fix_1176_default_v5te
3821 $(TEST_OBJDUMP) -D -j.foo $< > $@
3823 arm_fix_1176_default_v5te: arm_fix_1176_default_v5te.o ../ld-new
3824 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3826 arm_fix_1176_default_v5te.o: arm_fix_1176.s
3827 $(TEST_AS) -march=armv5te -o $@ $<
3829 arm_fix_1176_default_v7a.stdout: arm_fix_1176_default_v7a
3830 $(TEST_OBJDUMP) -D -j.foo $< > $@
3832 arm_fix_1176_default_v7a: arm_fix_1176_default_v7a.o ../ld-new
3833 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3835 arm_fix_1176_default_v7a.o: arm_fix_1176.s
3836 $(TEST_AS) -march=armv7-a -o $@ $<
3838 arm_fix_1176_default_1156t2f_s.stdout: arm_fix_1176_default_1156t2f_s
3839 $(TEST_OBJDUMP) -D -j.foo $< > $@
3841 arm_fix_1176_default_1156t2f_s: arm_fix_1176_default_1156t2f_s.o ../ld-new
3842 ../ld-new --section-start=.foo=0x2001014 -o $@ $<
3844 arm_fix_1176_default_1156t2f_s.o: arm_fix_1176.s
3845 $(TEST_AS) -mcpu=arm1156t2f-s -o $@ $<
3847 MOSTLYCLEANFILES += arm_fix_1176_default_v6z arm_fix_1176_on_v6z arm_fix_1176_off_v6z \
3848 arm_fix_1176_default_v5te arm_fix_1176_default_v7a arm_fix_1176_default_1156t2f_s
3850 # Cortex-A8 workaround test.
3852 check_SCRIPTS += arm_cortex_a8.sh
3853 check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \
3854 arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \
3855 arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout
3857 arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond
3858 $(TEST_OBJDUMP) -D -j.text $< > $@
3860 arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new
3863 arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s
3866 arm_cortex_a8_b.stdout: arm_cortex_a8_b
3867 $(TEST_OBJDUMP) -D -j.text $< > $@
3869 arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new
3870 ../ld-new --fix-cortex-a8 -o $@ $<
3872 arm_cortex_a8_b.o: arm_cortex_a8_b.s
3875 arm_cortex_a8_bl.stdout: arm_cortex_a8_bl
3876 $(TEST_OBJDUMP) -D -j.text $< > $@
3878 arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new
3881 arm_cortex_a8_bl.o: arm_cortex_a8_bl.s
3884 arm_cortex_a8_blx.stdout: arm_cortex_a8_blx
3885 $(TEST_OBJDUMP) -D -j.text $< > $@
3887 arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new
3890 arm_cortex_a8_blx.o: arm_cortex_a8_blx.s
3893 arm_cortex_a8_local.stdout: arm_cortex_a8_local
3894 $(TEST_OBJDUMP) -D -j.text $< > $@
3896 arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new
3899 arm_cortex_a8_local.o: arm_cortex_a8_local.s
3902 arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc
3903 $(TEST_OBJDUMP) -D -j.text $< > $@
3905 arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new
3908 arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s
3911 MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \
3912 arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc
3914 check_SCRIPTS += arm_exidx_test.sh
3915 check_DATA += arm_exidx_test.stdout
3917 arm_exidx_test.stdout: arm_exidx_test.so
3918 $(TEST_READELF) -Sr $< > $@
3920 arm_exidx_test.so: arm_exidx_test.o ../ld-new
3921 ../ld-new -shared -o $@ $<
3923 arm_exidx_test.o: arm_exidx_test.s
3926 check_SCRIPTS += pr12826.sh
3927 check_DATA += pr12826.stdout
3929 pr12826.stdout: pr12826.so
3930 $(TEST_READELF) -A $< > $@
3932 pr12826.so: pr12826_1.o pr12826_2.o ../ld-new
3933 ../ld-new -shared -o $@ $<
3935 pr12826_1.o: pr12826_1.s
3938 pr12826_2.o: pr12826_2.s
3941 check_SCRIPTS += arm_unaligned_reloc.sh
3942 check_DATA += arm_unaligned_reloc.stdout arm_unaligned_reloc_r.stdout
3944 arm_unaligned_reloc.stdout: arm_unaligned_reloc
3945 $(TEST_OBJDUMP) -D $< > $@
3947 arm_unaligned_reloc_r.stdout: arm_unaligned_reloc_r
3948 $(TEST_OBJDUMP) -Dr $< > $@
3950 arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new
3953 arm_unaligned_reloc_r: arm_unaligned_reloc.o ../ld-new
3954 ../ld-new -r -o $@ $<
3956 arm_unaligned_reloc.o: arm_unaligned_reloc.s
3959 MOSTLYCLEANFILES += arm_unaligned_reloc arm_unaligned_reloc_r
3961 # Check ARM to ARM farcall veneers
3963 check_SCRIPTS += arm_farcall_arm_arm.sh
3964 check_DATA += arm_farcall_arm_arm.stdout
3966 arm_farcall_arm_arm.stdout: arm_farcall_arm_arm
3967 $(TEST_OBJDUMP) -d $< > $@
3969 arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new
3970 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $<
3972 arm_farcall_arm_arm.o: arm_farcall_arm_arm.s
3975 MOSTLYCLEANFILES += arm_farcall_arm_arm
3977 # Check ARM to Thumb farcall veneers
3979 check_SCRIPTS += arm_farcall_arm_thumb.sh
3980 check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout
3982 arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb
3983 $(TEST_OBJDUMP) -D $< > $@
3985 arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new
3986 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3988 arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s
3991 arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t
3992 $(TEST_OBJDUMP) -D $< > $@
3994 arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new
3995 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
3997 arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s
3998 $(TEST_AS) -march=armv5t -o $@ $<
4000 MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t
4002 # Check Thumb to Thumb farcall veneers
4004 check_SCRIPTS += arm_farcall_thumb_thumb.sh
4005 check_DATA += arm_farcall_thumb_thumb.stdout \
4006 arm_farcall_thumb_thumb_5t.stdout \
4007 arm_farcall_thumb_thumb_7m.stdout \
4008 arm_farcall_thumb_thumb_6m.stdout
4010 arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb
4011 $(TEST_OBJDUMP) -D $< > $@
4013 arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new
4014 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
4016 arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s
4017 $(TEST_AS) -march=armv4t -o $@ $<
4019 arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t
4020 $(TEST_OBJDUMP) -D $< > $@
4022 arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new
4023 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
4025 arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s
4026 $(TEST_AS) -march=armv5t -o $@ $<
4028 arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m
4029 $(TEST_OBJDUMP) -D $< > $@
4031 arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new
4032 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
4034 arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s
4035 $(TEST_AS) -march=armv7-m -o $@ $<
4037 arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m
4038 $(TEST_OBJDUMP) -D $< > $@
4040 arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new
4041 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $<
4043 arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s
4044 $(TEST_AS) -march=armv6-m -o $@ $<
4046 MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \
4047 arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m
4049 #Check ARM to ARM farcall veneers in the be8 mode addressing
4051 check_SCRIPTS += arm_farcall_arm_arm_be8.sh
4052 check_DATA += arm_farcall_arm_arm_be8.stdout
4054 arm_farcall_arm_arm_be8.stdout: arm_farcall_arm_arm_be8
4055 $(TEST_OBJDUMP) -D $< > $@
4057 arm_farcall_arm_arm_be8: arm_farcall_arm_arm_be8.o ../ld-new
4058 ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -EB --be8 -o $@ $<
4060 arm_farcall_arm_arm_be8.o: arm_farcall_arm_arm.s
4061 $(TEST_AS) -EB -o $@ $<
4063 MOSTLYCLEANFILES += arm_farcall_arm_arm_be8
4065 #Check THUMB to THUMB farcall veneers in the be8 mode addressing
4067 check_SCRIPTS += arm_farcall_thumb_thumb_be8.sh
4068 check_DATA += arm_farcall_thumb_thumb_be8.stdout
4070 arm_farcall_thumb_thumb_be8.stdout: arm_farcall_thumb_thumb_be8
4071 $(TEST_OBJDUMP) -D $< > $@
4073 arm_farcall_thumb_thumb_be8: arm_farcall_thumb_thumb_be8.o ../ld-new
4074 ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -EB --be8 -o $@ $<
4076 arm_farcall_thumb_thumb_be8.o: arm_farcall_thumb_thumb.s
4077 $(TEST_AS) -march=armv7-m -EB -o $@ $<
4079 MOSTLYCLEANFILES += arm_farcall_thumb_thumb_be8
4081 # Check Thumb to ARM farcall veneers
4083 check_SCRIPTS += arm_farcall_thumb_arm.sh
4084 check_DATA += arm_farcall_thumb_arm.stdout \
4085 arm_farcall_thumb_arm_5t.stdout
4087 arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm
4088 $(TEST_OBJDUMP) -D $< > $@
4090 arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new
4091 ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
4093 arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s
4096 arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t
4097 $(TEST_OBJDUMP) -D $< > $@
4099 arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new
4100 ../ld-new --no-fix-arm1176 --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $<
4102 arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s
4103 $(TEST_AS) -march=armv5t -o $@ $<
4105 MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t
4107 # Check handling of --target1-abs, --target1-rel and --target2 options
4109 check_SCRIPTS += arm_target1_abs.sh arm_target1_rel.sh \
4110 arm_target2_rel.sh arm_target2_abs.sh arm_target2_got_rel.sh
4111 check_DATA += arm_target1_abs.stdout arm_target1_rel.stdout \
4112 arm_target2_rel.stdout arm_target2_abs.stdout arm_target2_got_rel.stdout
4114 arm_target1_abs.stdout: arm_target1_abs
4115 $(TEST_OBJDUMP) -s $< > $@
4117 arm_target1_abs: arm_target1.o ../ld-new
4118 ../ld-new --target1-abs --section-start .text=0x8000 -o $@ $<
4120 arm_target1_rel.stdout: arm_target1_rel
4121 $(TEST_OBJDUMP) -s $< > $@
4123 arm_target1_rel: arm_target1.o ../ld-new
4124 ../ld-new --target1-rel --section-start .text=0x8000 -o $@ $<
4126 arm_target1.o: arm_target1.s
4129 arm_target2_rel.stdout: arm_target2_rel
4130 $(TEST_OBJDUMP) -s $< > $@
4132 arm_target2_rel: arm_target2.o ../ld-new
4133 ../ld-new --target2=rel --section-start .text=0x8000 -o $@ $<
4135 arm_target2_abs.stdout: arm_target2_abs
4136 $(TEST_OBJDUMP) -s $< > $@
4138 arm_target2_abs: arm_target2.o ../ld-new
4139 ../ld-new --target2=abs --section-start .text=0x8000 -o $@ $<
4141 arm_target2_got_rel.stdout: arm_target2_got_rel
4142 $(TEST_OBJDUMP) -s $< > $@
4144 arm_target2_got_rel: arm_target2.o ../ld-new
4145 ../ld-new --target2=got-rel --section-start .text=0x8000 --section-start .got=0x9000 -o $@ $<
4147 arm_target2.o: arm_target2.s
4150 MOSTLYCLEANFILES += arm_target1_abs arm_target1_rel \
4151 arm_target2_rel arm_target2_abs arm_target2_got_rel
4153 # The test demonstrates why the constructor of a target object should not access options.
4154 check_DATA += arm_target_lazy_init
4155 MOSTLYCLEANFILES += arm_target_lazy_init
4156 arm_target_lazy_init: arm_target_lazy_init.o arm_target_lazy_init.t ../ld-new
4157 ../ld-new -T $(srcdir)/arm_target_lazy_init.t -o $@ $<
4158 arm_target_lazy_init.o: arm_target_lazy_init.s
4159 $(TEST_AS) -EL -o $@ $<
4161 endif DEFAULT_TARGET_ARM
4163 if DEFAULT_TARGET_AARCH64
4165 check_SCRIPTS += aarch64_reloc_none.sh
4166 check_DATA += aarch64_reloc_none.stdout
4167 aarch64_reloc_none.o: aarch64_reloc_none.s
4169 aarch64_reloc_none: aarch64_reloc_none.o ../ld-new
4170 ../ld-new -o $@ aarch64_reloc_none.o --gc-sections
4171 aarch64_reloc_none.stdout: aarch64_reloc_none
4174 MOSTLYCLEANFILES += aarch64_reloc_none
4176 check_SCRIPTS += aarch64_relocs.sh
4177 check_DATA += aarch64_relocs.stdout
4178 aarch64_globals.o: aarch64_globals.s
4180 aarch64_relocs.o: aarch64_relocs.s
4182 aarch64_relocs: aarch64_relocs.o aarch64_globals.o ../ld-new
4183 ../ld-new -o $@ aarch64_relocs.o aarch64_globals.o -e0 --emit-relocs
4184 aarch64_relocs.stdout: aarch64_relocs
4185 $(TEST_OBJDUMP) -dr $< > $@
4187 MOSTLYCLEANFILES += aarch64_relocs
4189 check_SCRIPTS += pr21430.sh
4190 check_DATA += pr21430.stdout
4191 pr21430.o: pr21430.s
4193 pr21430: pr21430.o ../ld-new
4195 pr21430.stdout: pr21430
4196 $(TEST_NM) -S $< > $@
4198 MOSTLYCLEANFILES += pr21430
4200 check_SCRIPTS += aarch64_tlsdesc.sh
4201 check_DATA += aarch64_tlsdesc.stdout
4202 aarch64_tlsdesc.o: aarch64_tlsdesc.s
4204 aarch64_tlsdesc: aarch64_tlsdesc.o $(srcdir)/aarch64_tlsdesc.t ../ld-new
4205 ../ld-new $< -shared -T $(srcdir)/aarch64_tlsdesc.t -o $@
4206 aarch64_tlsdesc.stdout: aarch64_tlsdesc
4207 $(TEST_OBJDUMP) -dR -j.text -j.got.plt $< > $@
4209 MOSTLYCLEANFILES += aarch64_tlsdesc
4211 endif DEFAULT_TARGET_AARCH64
4213 if DEFAULT_TARGET_S390
4215 check_SCRIPTS += split_s390.sh
4216 check_DATA += split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \
4217 split_s390_z4.stdout split_s390_n1.stdout split_s390_n2.stdout \
4218 split_s390_a1.stdout split_s390_a2.stdout split_s390_z1_ns.stdout \
4219 split_s390_z2_ns.stdout split_s390_z3_ns.stdout split_s390_z4_ns.stdout \
4220 split_s390_n1_ns.stdout split_s390_n2_ns.stdout split_s390_r.stdout \
4221 split_s390x_z1.stdout split_s390x_z2.stdout split_s390x_z3.stdout \
4222 split_s390x_z4.stdout split_s390x_n1.stdout split_s390x_n2.stdout \
4223 split_s390x_a1.stdout split_s390x_a2.stdout split_s390x_z1_ns.stdout \
4224 split_s390x_z2_ns.stdout split_s390x_z3_ns.stdout \
4225 split_s390x_z4_ns.stdout split_s390x_n1_ns.stdout \
4226 split_s390x_n2_ns.stdout split_s390x_r.stdout
4227 SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
4228 split_s390_1_z1.o: split_s390_1_z1.s
4229 $(TEST_AS) -m31 -o $@ $<
4230 split_s390_1_z2.o: split_s390_1_z2.s
4231 $(TEST_AS) -m31 -o $@ $<
4232 split_s390_1_z3.o: split_s390_1_z3.s
4233 $(TEST_AS) -m31 -o $@ $<
4234 split_s390_1_z4.o: split_s390_1_z4.s
4235 $(TEST_AS) -m31 -o $@ $<
4236 split_s390_1_n1.o: split_s390_1_n1.s
4237 $(TEST_AS) -m31 -o $@ $<
4238 split_s390_1_n2.o: split_s390_1_n2.s
4239 $(TEST_AS) -m31 -o $@ $<
4240 split_s390_1_a1.o: split_s390_1_a1.s
4241 $(TEST_AS) -m31 -o $@ $<
4242 split_s390_1_a2.o: split_s390_1_a2.s
4243 $(TEST_AS) -m31 -o $@ $<
4244 split_s390_2_s.o: split_s390_2_s.s
4245 $(TEST_AS) -m31 -o $@ $<
4246 split_s390_2_ns.o: split_s390_2_ns.s
4247 $(TEST_AS) -m31 -o $@ $<
4248 split_s390_z1: split_s390_1_z1.o split_s390_2_s.o ../ld-new
4249 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z1.o split_s390_2_s.o
4250 split_s390_z1.stdout: split_s390_z1
4251 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4252 split_s390_z2: split_s390_1_z2.o split_s390_2_s.o ../ld-new
4253 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z2.o split_s390_2_s.o
4254 split_s390_z2.stdout: split_s390_z2
4255 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4256 split_s390_z3: split_s390_1_z3.o split_s390_2_s.o ../ld-new
4257 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z3.o split_s390_2_s.o
4258 split_s390_z3.stdout: split_s390_z3
4259 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4260 split_s390_z4: split_s390_1_z4.o split_s390_2_s.o ../ld-new
4261 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z4.o split_s390_2_s.o
4262 split_s390_z4.stdout: split_s390_z4
4263 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4264 split_s390_n1: split_s390_1_n1.o split_s390_2_s.o ../ld-new
4265 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n1.o split_s390_2_s.o
4266 split_s390_n1.stdout: split_s390_n1
4267 $(TEST_OBJDUMP) -d $< > $@
4268 split_s390_n2: split_s390_1_n2.o split_s390_2_s.o ../ld-new
4269 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n2.o split_s390_2_s.o
4270 split_s390_n2.stdout: split_s390_n2
4271 $(TEST_OBJDUMP) -d $< > $@
4272 split_s390_z1_ns: split_s390_1_z1.o split_s390_2_ns.o ../ld-new
4273 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z1.o split_s390_2_ns.o
4274 split_s390_z1_ns.stdout: split_s390_z1_ns
4275 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4276 split_s390_z2_ns: split_s390_1_z2.o split_s390_2_ns.o ../ld-new
4277 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z2.o split_s390_2_ns.o
4278 split_s390_z2_ns.stdout: split_s390_z2_ns
4279 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4280 split_s390_z3_ns: split_s390_1_z3.o split_s390_2_ns.o ../ld-new
4281 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z3.o split_s390_2_ns.o
4282 split_s390_z3_ns.stdout: split_s390_z3_ns
4283 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4284 split_s390_z4_ns: split_s390_1_z4.o split_s390_2_ns.o ../ld-new
4285 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_z4.o split_s390_2_ns.o
4286 split_s390_z4_ns.stdout: split_s390_z4_ns
4287 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4288 split_s390_n1_ns: split_s390_1_n1.o split_s390_2_ns.o ../ld-new
4289 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_n1.o split_s390_2_ns.o
4290 split_s390_n1_ns.stdout: split_s390_n1_ns
4291 $(TEST_OBJDUMP) -d $< > $@
4292 split_s390_n2_ns.stdout: split_s390_1_n2.o split_s390_2_ns.o ../ld-new
4293 ../ld-new $(SPLIT_DEFSYMS) -o split_s390_n2 split_s390_1_n2.o split_s390_2_ns.o > $@ 2>&1 || exit 0
4294 split_s390_a1.stdout: split_s390_1_a1.o split_s390_2_ns.o ../ld-new
4295 ../ld-new $(SPLIT_DEFSYMS) -o split_s390_a1 split_s390_1_a1.o split_s390_2_ns.o > $@ 2>&1 || exit 0
4296 split_s390_a2: split_s390_1_a2.o split_s390_2_ns.o ../ld-new
4297 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390_1_a2.o split_s390_2_ns.o
4298 split_s390_a2.stdout: split_s390_a2
4299 $(TEST_OBJDUMP) -d $< > $@
4300 split_s390_r.stdout: split_s390_1_z1.o split_s390_2_ns.o ../ld-new
4301 ../ld-new -r split_s390_1_z1.o split_s390_2_ns.o -o split_s390_r > $@ 2>&1 || exit 0
4302 split_s390x_1_z1.o: split_s390x_1_z1.s
4303 $(TEST_AS) -m64 -o $@ $<
4304 split_s390x_1_z2.o: split_s390x_1_z2.s
4305 $(TEST_AS) -m64 -o $@ $<
4306 split_s390x_1_z3.o: split_s390x_1_z3.s
4307 $(TEST_AS) -m64 -o $@ $<
4308 split_s390x_1_z4.o: split_s390x_1_z4.s
4309 $(TEST_AS) -m64 -o $@ $<
4310 split_s390x_1_n1.o: split_s390x_1_n1.s
4311 $(TEST_AS) -m64 -o $@ $<
4312 split_s390x_1_n2.o: split_s390x_1_n2.s
4313 $(TEST_AS) -m64 -o $@ $<
4314 split_s390x_1_a1.o: split_s390x_1_a1.s
4315 $(TEST_AS) -m64 -o $@ $<
4316 split_s390x_1_a2.o: split_s390x_1_a2.s
4317 $(TEST_AS) -m64 -o $@ $<
4318 split_s390x_2_s.o: split_s390x_2_s.s
4319 $(TEST_AS) -m64 -o $@ $<
4320 split_s390x_2_ns.o: split_s390x_2_ns.s
4321 $(TEST_AS) -m64 -o $@ $<
4322 split_s390x_z1: split_s390x_1_z1.o split_s390x_2_s.o ../ld-new
4323 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z1.o split_s390x_2_s.o
4324 split_s390x_z1.stdout: split_s390x_z1
4325 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4326 split_s390x_z2: split_s390x_1_z2.o split_s390x_2_s.o ../ld-new
4327 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z2.o split_s390x_2_s.o
4328 split_s390x_z2.stdout: split_s390x_z2
4329 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4330 split_s390x_z3: split_s390x_1_z3.o split_s390x_2_s.o ../ld-new
4331 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z3.o split_s390x_2_s.o
4332 split_s390x_z3.stdout: split_s390x_z3
4333 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4334 split_s390x_z4: split_s390x_1_z4.o split_s390x_2_s.o ../ld-new
4335 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z4.o split_s390x_2_s.o
4336 split_s390x_z4.stdout: split_s390x_z4
4337 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4338 split_s390x_n1: split_s390x_1_n1.o split_s390x_2_s.o ../ld-new
4339 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n1.o split_s390x_2_s.o
4340 split_s390x_n1.stdout: split_s390x_n1
4341 $(TEST_OBJDUMP) -d $< > $@
4342 split_s390x_n2: split_s390x_1_n2.o split_s390x_2_s.o ../ld-new
4343 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n2.o split_s390x_2_s.o
4344 split_s390x_n2.stdout: split_s390x_n2
4345 $(TEST_OBJDUMP) -d $< > $@
4346 split_s390x_z1_ns: split_s390x_1_z1.o split_s390x_2_ns.o ../ld-new
4347 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z1.o split_s390x_2_ns.o
4348 split_s390x_z1_ns.stdout: split_s390x_z1_ns
4349 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4350 split_s390x_z2_ns: split_s390x_1_z2.o split_s390x_2_ns.o ../ld-new
4351 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z2.o split_s390x_2_ns.o
4352 split_s390x_z2_ns.stdout: split_s390x_z2_ns
4353 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4354 split_s390x_z3_ns: split_s390x_1_z3.o split_s390x_2_ns.o ../ld-new
4355 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z3.o split_s390x_2_ns.o
4356 split_s390x_z3_ns.stdout: split_s390x_z3_ns
4357 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4358 split_s390x_z4_ns: split_s390x_1_z4.o split_s390x_2_ns.o ../ld-new
4359 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_z4.o split_s390x_2_ns.o
4360 split_s390x_z4_ns.stdout: split_s390x_z4_ns
4361 $(TEST_OBJDUMP) -j .rodata -j .text -D $< > $@
4362 split_s390x_n1_ns: split_s390x_1_n1.o split_s390x_2_ns.o ../ld-new
4363 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_n1.o split_s390x_2_ns.o
4364 split_s390x_n1_ns.stdout: split_s390x_n1_ns
4365 $(TEST_OBJDUMP) -d $< > $@
4366 split_s390x_n2_ns.stdout: split_s390x_1_n2.o split_s390x_2_ns.o ../ld-new
4367 ../ld-new $(SPLIT_DEFSYMS) -o split_s390x_n2 split_s390x_1_n2.o split_s390x_2_ns.o > $@ 2>&1 || exit 0
4368 split_s390x_a1.stdout: split_s390x_1_a1.o split_s390x_2_ns.o ../ld-new
4369 ../ld-new $(SPLIT_DEFSYMS) -o split_s390x_a1 split_s390x_1_a1.o split_s390x_2_ns.o > $@ 2>&1 || exit 0
4370 split_s390x_a2: split_s390x_1_a2.o split_s390x_2_ns.o ../ld-new
4371 ../ld-new $(SPLIT_DEFSYMS) -o $@ split_s390x_1_a2.o split_s390x_2_ns.o
4372 split_s390x_a2.stdout: split_s390x_a2
4373 $(TEST_OBJDUMP) -d $< > $@
4374 split_s390x_r.stdout: split_s390x_1_z1.o split_s390x_2_ns.o ../ld-new
4375 ../ld-new -r split_s390x_1_z1.o split_s390x_2_ns.o -o split_s390x_r > $@ 2>&1 || exit 0
4376 MOSTLYCLEANFILES += split_s390_z1 split_s390_z2 split_s390_z3 \
4377 split_s390_z4 split_s390_n1 split_s390_n2 split_s390_a1 \
4378 split_s390_a2 split_s390_z1_ns split_s390_z2_ns split_s390_z3_ns \
4379 split_s390_z4_ns split_s390_n1_ns split_s390_n2_ns split_s390_r \
4380 split_s390x_z1 split_s390x_z2 split_s390x_z3 split_s390x_z4 \
4381 split_s390x_n1 split_s390x_n2 split_s390x_a1 split_s390x_a2 \
4382 split_s390x_z1_ns split_s390x_z2_ns split_s390x_z3_ns \
4383 split_s390x_z4_ns split_s390x_n1_ns split_s390x_n2_ns split_s390x_r
4385 endif DEFAULT_TARGET_S390
4387 endif NATIVE_OR_CROSS_LINKER
4389 # Tests for the dwp tool.
4390 # We don't want to rely yet on GCC support for -gsplit-dwarf,
4391 # so we use (for now) test cases in x86 assembly language,
4392 # compiled from the dwp_test_*.cc sources.
4394 if DEFAULT_TARGET_X86_64
4396 dwp_test_main.o: dwp_test_main.s
4398 dwp_test_1.o: dwp_test_1.s
4400 dwp_test_1b.o: dwp_test_1b.s
4402 dwp_test_2.o: dwp_test_2.s
4405 dwp_test_main.dwo: dwp_test_main.o
4406 $(TEST_OBJCOPY) --extract-dwo $< $@
4407 dwp_test_1.dwo: dwp_test_1.o
4408 $(TEST_OBJCOPY) --extract-dwo $< $@
4409 dwp_test_1b.dwo: dwp_test_1b.o
4410 $(TEST_OBJCOPY) --extract-dwo $< $@
4411 dwp_test_2.dwo: dwp_test_2.o
4412 $(TEST_OBJCOPY) --extract-dwo $< $@
4414 MOSTLYCLEANFILES += *.dwo *.dwp
4415 check_SCRIPTS += dwp_test_1.sh
4416 check_DATA += dwp_test_1.stdout
4417 dwp_test_1.stdout: dwp_test_1.dwp
4418 $(TEST_READELF) -wi $< > $@
4419 dwp_test_1.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
4420 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo dwp_test_1b.dwo dwp_test_2.dwo
4422 check_SCRIPTS += dwp_test_2.sh
4423 check_DATA += dwp_test_2.stdout
4424 dwp_test_2.stdout: dwp_test_2.dwp
4425 $(TEST_READELF) -wi $< > $@
4426 dwp_test_2.dwp: ../dwp dwp_test_2a.dwp dwp_test_2b.dwp
4427 ../dwp -o $@ dwp_test_2a.dwp dwp_test_2b.dwp
4428 dwp_test_2a.dwp: ../dwp dwp_test_main.dwo dwp_test_1.dwo
4429 ../dwp -o $@ dwp_test_main.dwo dwp_test_1.dwo
4430 dwp_test_2b.dwp: ../dwp dwp_test_1b.dwo dwp_test_2.dwo
4431 ../dwp -o $@ dwp_test_1b.dwo dwp_test_2.dwo
4433 check_SCRIPTS += pr26936.sh
4434 check_DATA += pr26936a.stdout pr26936b.stdout
4435 MOSTLYCLEANFILES += pr26936a pr26936b
4436 pr26936a.stdout: pr26936a
4437 $(TEST_READELF) -wL -wR -wr $< >$@ 2>/dev/null
4438 pr26936a: pr26936a.o pr26936b.o pr26936c.o ../ld-new
4439 ../ld-new -Ttext-segment 0x10000 -z max-page-size=0x1000 \
4440 -e _start -o $@ pr26936a.o pr26936b.o pr26936c.o
4441 pr26936b.stdout: pr26936b
4442 $(TEST_READELF) -wL -wR -wr $< >$@ 2>/dev/null
4443 pr26936b: pr26936d.o pr26936b.o pr26936c.o ../ld-new
4444 ../ld-new -Ttext-segment 0x10000 -z max-page-size=0x1000 \
4445 -e _start -o $@ pr26936d.o pr26936b.o pr26936c.o
4446 pr26936a.o: pr26936a.s
4447 $(TEST_AS) --gen-debug -mx86-used-note=yes -o $@ $<
4448 pr26936b.o: pr26936b.s
4449 $(TEST_AS) --gen-debug -mx86-used-note=yes -o $@ $<
4450 pr26936c.o: pr26936c.s
4451 $(TEST_AS) --gen-debug -mx86-used-note=yes -o $@ $<
4452 pr26936d.o: pr26936d.s
4453 $(TEST_AS) --gen-debug -mx86-used-note=yes -o $@ $<
4455 check_SCRIPTS += retain.sh
4456 check_DATA += retain_1.out retain_2.out
4457 MOSTLYCLEANFILES += retain_1 retain_2
4458 retain_1.out: retain_1
4460 retain_1: retain_1.o ../ld-new
4461 ../ld-new -e _start --gc-sections -o $@ retain_1.o
4462 retain_1.o: retain_1.s
4464 retain_2.out: retain_2
4465 $(TEST_READELF) -d $< >$@
4466 retain_2: retain_2.o ../ld-new
4467 ../ld-new -pie -e _start --gc-sections -o $@ retain_2.o
4468 retain_2.o: retain_2.s
4471 endif DEFAULT_TARGET_X86_64
4473 check_PROGRAMS += package_metadata_test
4474 package_metadata_test.o: package_metadata_main.c
4475 $(COMPILE) -c -o $@ $<
4476 package_metadata_test$(EXEEXT): package_metadata_test.o gcctestdir/ld
4477 $(CXXLINK) package_metadata_test.o -Wl,--package-metadata='{"foo":"bar"}'
4478 $(TEST_READELF) --notes $@ | grep -q '{"foo":"bar"}'