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