| 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 | # The two_file_test tests -fmerge-constants, so we simply always turn |
| 11 | # it on. This may need to be controlled by a configure option |
| 12 | # eventually. |
| 13 | AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants |
| 14 | AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants |
| 15 | |
| 16 | AM_CPPFLAGS = \ |
| 17 | -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \ |
| 18 | -I$(srcdir)/../../elfcpp -I.. \ |
| 19 | -DLOCALEDIR="\"$(datadir)/locale\"" \ |
| 20 | @INCINTL@ |
| 21 | |
| 22 | TEST_READELF = $(top_builddir)/../binutils/readelf |
| 23 | TEST_OBJDUMP = $(top_builddir)/../binutils/objdump |
| 24 | TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt |
| 25 | TEST_STRIP = $(top_builddir)/../binutils/strip-new |
| 26 | TEST_AR = $(top_builddir)/../binutils/ar |
| 27 | TEST_NM = $(top_builddir)/../binutils/nm-new |
| 28 | TEST_AS = $(top_builddir)/../gas/as-new |
| 29 | |
| 30 | if PLUGINS |
| 31 | LIBDL = -ldl |
| 32 | endif |
| 33 | |
| 34 | if THREADS |
| 35 | THREADSLIB = -lpthread |
| 36 | endif |
| 37 | |
| 38 | if OMP_SUPPORT |
| 39 | TLS_TEST_C_CFLAGS = -fopenmp |
| 40 | endif |
| 41 | |
| 42 | # 'make clean' is good about deleting some intermediate files (such as |
| 43 | # .o's), but not all of them (such as .so's and .err files). We |
| 44 | # improve on that here. automake-1.9 info docs say "mostlyclean" is |
| 45 | # the right choice for files 'make' builds that people rebuild. |
| 46 | MOSTLYCLEANFILES = *.so *.syms *.stdout |
| 47 | |
| 48 | |
| 49 | # We will add to these later, for each individual test. Note |
| 50 | # that we add each test under check_SCRIPTS or check_PROGRAMS; |
| 51 | # the TESTS variable is automatically populated from these. |
| 52 | check_SCRIPTS = |
| 53 | check_DATA = |
| 54 | check_PROGRAMS = |
| 55 | BUILT_SOURCES = |
| 56 | |
| 57 | TESTS = $(check_SCRIPTS) $(check_PROGRAMS) |
| 58 | |
| 59 | # --------------------------------------------------------------------- |
| 60 | # These tests test the internals of gold (unittests). |
| 61 | |
| 62 | # Infrastucture needed for the unittests |
| 63 | check_LIBRARIES = libgoldtest.a |
| 64 | libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc |
| 65 | |
| 66 | DEPENDENCIES = \ |
| 67 | libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP) |
| 68 | LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ |
| 69 | $(THREADSLIB) $(LIBDL) |
| 70 | |
| 71 | |
| 72 | # The unittests themselves |
| 73 | if NATIVE_OR_CROSS_LINKER |
| 74 | if GCC |
| 75 | |
| 76 | # Infrastucture needed for the unittests: a directory where the linker |
| 77 | # is named 'ld'. This is because the -B flag appends 'ld' to its arg. |
| 78 | gcctestdir/ld: ../ld-new |
| 79 | test -d gcctestdir || mkdir -p gcctestdir |
| 80 | rm -f gcctestdir/ld |
| 81 | (cd gcctestdir && $(LN_S) ../../ld-new ld) |
| 82 | |
| 83 | # Some tests require the latest features of an in-tree assembler. |
| 84 | gcctestdir/as: $(TEST_AS) |
| 85 | test -d gcctestdir || mkdir -p gcctestdir |
| 86 | rm -f gcctestdir/as |
| 87 | (cd gcctestdir && $(LN_S) $(abs_top_builddir)/../gas/as-new as) |
| 88 | |
| 89 | endif GCC |
| 90 | |
| 91 | check_PROGRAMS += object_unittest |
| 92 | object_unittest_SOURCES = object_unittest.cc |
| 93 | |
| 94 | check_PROGRAMS += binary_unittest |
| 95 | binary_unittest_SOURCES = binary_unittest.cc |
| 96 | |
| 97 | endif NATIVE_OR_CROSS_LINKER |
| 98 | |
| 99 | # --------------------------------------------------------------------- |
| 100 | # These tests test the output of gold (end-to-end tests). In |
| 101 | # particular, they make sure that gold can link "difficult" object |
| 102 | # files, and the resulting object files run correctly. These can only |
| 103 | # run if we've built ld-new for the native architecture (that is, |
| 104 | # we're not cross-compiling it), since we run ld-new as part of these |
| 105 | # tests. We use the gcc-specific flag '-B' to use our linker instead |
| 106 | # of the default linker, which is why we only run our tests under gcc. |
| 107 | |
| 108 | if NATIVE_LINKER |
| 109 | if GCC |
| 110 | |
| 111 | # Each of these .o's is a useful, small complete program. They're |
| 112 | # particularly useful for making sure ld-new's flags do what they're |
| 113 | # supposed to (hence their names), but are used for many tests that |
| 114 | # don't actually involve analyzing input data. |
| 115 | flagstest_debug.o: constructor_test.cc |
| 116 | $(CXXCOMPILE) -O0 -g -c -o $@ $< |
| 117 | flagstest_ndebug.o: constructor_test.cc |
| 118 | $(CXXCOMPILE) -O0 -c -o $@ $< |
| 119 | |
| 120 | check_SCRIPTS += incremental_test.sh |
| 121 | check_DATA += incremental_test.stdout |
| 122 | MOSTLYCLEANFILES += incremental_test |
| 123 | incremental_test_1.o: incremental_test_1.c |
| 124 | $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 125 | incremental_test_2.o: incremental_test_2.c |
| 126 | $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 127 | incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld |
| 128 | $(LINK) -Bgcctestdir/ -Wl,--incremental-full incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline |
| 129 | incremental_test.stdout: incremental_test ../incremental-dump |
| 130 | ../incremental-dump incremental_test > $@ |
| 131 | |
| 132 | check_SCRIPTS += gc_comdat_test.sh |
| 133 | check_DATA += gc_comdat_test.stdout |
| 134 | MOSTLYCLEANFILES += gc_comdat_test |
| 135 | gc_comdat_test_1.o: gc_comdat_test_1.cc |
| 136 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 137 | gc_comdat_test_2.o: gc_comdat_test_2.cc |
| 138 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 139 | gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld |
| 140 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o |
| 141 | gc_comdat_test.stdout: gc_comdat_test |
| 142 | $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout |
| 143 | |
| 144 | check_SCRIPTS += gc_tls_test.sh |
| 145 | check_DATA += gc_tls_test.stdout |
| 146 | MOSTLYCLEANFILES += gc_tls_test |
| 147 | gc_tls_test.o: gc_tls_test.cc |
| 148 | $(CXXCOMPILE) -O0 -c -g -o $@ $< |
| 149 | gc_tls_test:gc_tls_test.o gcctestdir/ld |
| 150 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o |
| 151 | gc_tls_test.stdout: gc_tls_test |
| 152 | $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout |
| 153 | |
| 154 | check_SCRIPTS += gc_orphan_section_test.sh |
| 155 | check_DATA += gc_orphan_section_test.stdout |
| 156 | MOSTLYCLEANFILES += gc_orphan_section_test |
| 157 | gc_orphan_section_test.o: gc_orphan_section_test.cc |
| 158 | $(CXXCOMPILE) -O0 -c -g -o $@ $< |
| 159 | gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld |
| 160 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_orphan_section_test.o |
| 161 | gc_orphan_section_test.stdout: gc_orphan_section_test |
| 162 | $(TEST_NM) gc_orphan_section_test > gc_orphan_section_test.stdout |
| 163 | |
| 164 | check_SCRIPTS += icf_test.sh |
| 165 | check_DATA += icf_test.stdout |
| 166 | MOSTLYCLEANFILES += icf_test |
| 167 | icf_test.o: icf_test.cc |
| 168 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 169 | icf_test: icf_test.o gcctestdir/ld |
| 170 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_test.o |
| 171 | icf_test.stdout: icf_test |
| 172 | $(TEST_NM) -C icf_test > icf_test.stdout |
| 173 | |
| 174 | check_SCRIPTS += icf_keep_unique_test.sh |
| 175 | check_DATA += icf_keep_unique_test.stdout |
| 176 | MOSTLYCLEANFILES += icf_keep_unique_test |
| 177 | icf_keep_unique_test.o: icf_keep_unique_test.cc |
| 178 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 179 | icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld |
| 180 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o |
| 181 | icf_keep_unique_test.stdout: icf_keep_unique_test |
| 182 | $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout |
| 183 | |
| 184 | check_SCRIPTS += icf_safe_test.sh |
| 185 | check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout |
| 186 | MOSTLYCLEANFILES += icf_safe_test |
| 187 | icf_safe_test.o: icf_safe_test.cc |
| 188 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
| 189 | icf_safe_test: icf_safe_test.o gcctestdir/ld |
| 190 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_test.o |
| 191 | icf_safe_test_1.stdout: icf_safe_test |
| 192 | $(TEST_NM) icf_safe_test > icf_safe_test_1.stdout |
| 193 | icf_safe_test_2.stdout: icf_safe_test |
| 194 | $(TEST_READELF) -h icf_safe_test > icf_safe_test_2.stdout |
| 195 | |
| 196 | check_SCRIPTS += icf_safe_so_test.sh |
| 197 | check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout |
| 198 | MOSTLYCLEANFILES += icf_safe_so_test |
| 199 | icf_safe_so_test.o: icf_safe_so_test.cc |
| 200 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< |
| 201 | icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld |
| 202 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=safe icf_safe_so_test.o -fPIC -shared |
| 203 | icf_safe_so_test_1.stdout: icf_safe_so_test |
| 204 | $(TEST_NM) icf_safe_so_test > icf_safe_so_test_1.stdout |
| 205 | icf_safe_so_test_2.stdout: icf_safe_so_test |
| 206 | $(TEST_READELF) -h icf_safe_so_test > icf_safe_so_test_2.stdout |
| 207 | |
| 208 | check_SCRIPTS += final_layout.sh |
| 209 | check_DATA += final_layout.stdout |
| 210 | MOSTLYCLEANFILES += final_layout |
| 211 | final_layout.o: final_layout.cc |
| 212 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< |
| 213 | final_layout_sequence.txt: |
| 214 | (echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt |
| 215 | final_layout: final_layout.o final_layout_sequence.txt gcctestdir/ld |
| 216 | $(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt final_layout.o |
| 217 | final_layout.stdout: final_layout |
| 218 | $(TEST_NM) -n final_layout > final_layout.stdout |
| 219 | |
| 220 | check_PROGRAMS += icf_virtual_function_folding_test |
| 221 | MOSTLYCLEANFILES += icf_virtual_function_folding_test |
| 222 | icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc |
| 223 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $< |
| 224 | icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdir/ld |
| 225 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_virtual_function_folding_test.o -pie |
| 226 | |
| 227 | check_SCRIPTS += icf_preemptible_functions_test.sh |
| 228 | check_DATA += icf_preemptible_functions_test.stdout |
| 229 | MOSTLYCLEANFILES += icf_preemptible_functions_test |
| 230 | icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc |
| 231 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< |
| 232 | icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld |
| 233 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_preemptible_functions_test.o -fPIC -shared |
| 234 | icf_preemptible_functions_test.stdout: icf_preemptible_functions_test |
| 235 | $(TEST_NM) icf_preemptible_functions_test > icf_preemptible_functions_test.stdout |
| 236 | |
| 237 | check_SCRIPTS += icf_string_merge_test.sh |
| 238 | check_DATA += icf_string_merge_test.stdout |
| 239 | MOSTLYCLEANFILES += icf_string_merge_test |
| 240 | icf_string_merge_test.o: icf_string_merge_test.cc |
| 241 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< |
| 242 | icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld |
| 243 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_string_merge_test.o |
| 244 | icf_string_merge_test.stdout: icf_string_merge_test |
| 245 | $(TEST_NM) icf_string_merge_test > icf_string_merge_test.stdout |
| 246 | |
| 247 | check_SCRIPTS += icf_sht_rel_addend_test.sh |
| 248 | check_DATA += icf_sht_rel_addend_test.stdout |
| 249 | MOSTLYCLEANFILES += icf_sht_rel_addend_test |
| 250 | icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc |
| 251 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< |
| 252 | icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc |
| 253 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $< |
| 254 | icf_sht_rel_addend_test: icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o gcctestdir/ld |
| 255 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf=all icf_sht_rel_addend_test_1.o icf_sht_rel_addend_test_2.o |
| 256 | icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test |
| 257 | $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout |
| 258 | |
| 259 | check_PROGRAMS += basic_test |
| 260 | check_PROGRAMS += basic_pic_test |
| 261 | basic_test.o: basic_test.cc |
| 262 | $(CXXCOMPILE) -O0 -c -o $@ $< |
| 263 | basic_test: basic_test.o gcctestdir/ld |
| 264 | $(CXXLINK) -Bgcctestdir/ basic_test.o |
| 265 | |
| 266 | if HAVE_STATIC |
| 267 | check_PROGRAMS += basic_static_test |
| 268 | basic_static_test: basic_test.o gcctestdir/ld |
| 269 | $(CXXLINK) -Bgcctestdir/ -static basic_test.o |
| 270 | endif |
| 271 | |
| 272 | basic_pic_test.o: basic_test.cc |
| 273 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
| 274 | basic_pic_test: basic_pic_test.o gcctestdir/ld |
| 275 | $(CXXLINK) -Bgcctestdir/ basic_pic_test.o |
| 276 | |
| 277 | if HAVE_STATIC |
| 278 | check_PROGRAMS += basic_static_pic_test |
| 279 | basic_static_pic_test: basic_pic_test.o gcctestdir/ld |
| 280 | $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o |
| 281 | endif |
| 282 | |
| 283 | check_PROGRAMS += basic_pie_test |
| 284 | basic_pie_test.o: basic_test.cc |
| 285 | $(CXXCOMPILE) -O0 -c -fpie -o $@ $< |
| 286 | basic_pie_test: basic_pie_test.o gcctestdir/ld |
| 287 | $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o |
| 288 | |
| 289 | check_PROGRAMS += constructor_test |
| 290 | constructor_test_SOURCES = constructor_test.cc |
| 291 | constructor_test_DEPENDENCIES = gcctestdir/ld |
| 292 | constructor_test_LDFLAGS = -Bgcctestdir/ |
| 293 | constructor_test_LDADD = |
| 294 | |
| 295 | if HAVE_STATIC |
| 296 | check_PROGRAMS += constructor_static_test |
| 297 | constructor_static_test_SOURCES = $(constructor_test_SOURCES) |
| 298 | constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) |
| 299 | constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static |
| 300 | constructor_static_test_LDADD = $(constructor_test_LDADD) |
| 301 | endif |
| 302 | |
| 303 | check_PROGRAMS += two_file_test |
| 304 | check_PROGRAMS += two_file_pic_test |
| 305 | two_file_test_SOURCES = \ |
| 306 | two_file_test_1.cc \ |
| 307 | two_file_test_1b.cc \ |
| 308 | two_file_test_2.cc \ |
| 309 | two_file_test_main.cc \ |
| 310 | two_file_test.h |
| 311 | two_file_test_DEPENDENCIES = gcctestdir/ld |
| 312 | two_file_test_LDFLAGS = -Bgcctestdir/ |
| 313 | two_file_test_LDADD = |
| 314 | |
| 315 | if HAVE_STATIC |
| 316 | check_PROGRAMS += two_file_static_test |
| 317 | two_file_static_test_SOURCES = $(two_file_test_SOURCES) |
| 318 | two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) |
| 319 | two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static |
| 320 | two_file_static_test_LDADD = $(two_file_test_LDADD) |
| 321 | endif |
| 322 | |
| 323 | two_file_pic_test_SOURCES = two_file_test_main.cc |
| 324 | two_file_pic_test_DEPENDENCIES = \ |
| 325 | gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
| 326 | two_file_pic_test_LDFLAGS = -Bgcctestdir/ |
| 327 | two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
| 328 | |
| 329 | |
| 330 | check_PROGRAMS += two_file_shared_1_test |
| 331 | check_PROGRAMS += two_file_shared_2_test |
| 332 | check_PROGRAMS += two_file_shared_1_pic_2_test |
| 333 | check_PROGRAMS += two_file_shared_2_pic_1_test |
| 334 | check_PROGRAMS += two_file_same_shared_test |
| 335 | check_PROGRAMS += two_file_separate_shared_12_test |
| 336 | check_PROGRAMS += two_file_separate_shared_21_test |
| 337 | two_file_test_1_pic.o: two_file_test_1.cc |
| 338 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 339 | two_file_test_1b_pic.o: two_file_test_1b.cc |
| 340 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 341 | two_file_test_2_pic.o: two_file_test_2.cc |
| 342 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 343 | two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld |
| 344 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o |
| 345 | two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld |
| 346 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o |
| 347 | two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld |
| 348 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
| 349 | |
| 350 | two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc |
| 351 | two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so |
| 352 | two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 353 | two_file_shared_1_test_LDADD = two_file_shared_1.so |
| 354 | |
| 355 | two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
| 356 | two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so |
| 357 | two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 358 | two_file_shared_2_test_LDADD = two_file_shared_2.so |
| 359 | |
| 360 | two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc |
| 361 | two_file_shared_1_pic_2_test_DEPENDENCIES = \ |
| 362 | gcctestdir/ld two_file_shared_2.so two_file_test_1_pic.o two_file_test_1b_pic.o |
| 363 | two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 364 | 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 |
| 365 | |
| 366 | two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc |
| 367 | two_file_shared_2_pic_1_test_DEPENDENCIES = \ |
| 368 | gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o |
| 369 | two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 370 | two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so |
| 371 | |
| 372 | two_file_same_shared_test_SOURCES = two_file_test_main.cc |
| 373 | two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so |
| 374 | two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 375 | two_file_same_shared_test_LDADD = two_file_shared.so |
| 376 | |
| 377 | two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc |
| 378 | two_file_separate_shared_12_test_DEPENDENCIES = \ |
| 379 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so |
| 380 | two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 381 | two_file_separate_shared_12_test_LDADD = \ |
| 382 | two_file_shared_1.so two_file_shared_2.so |
| 383 | |
| 384 | two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc |
| 385 | two_file_separate_shared_21_test_DEPENDENCIES = \ |
| 386 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so |
| 387 | two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 388 | two_file_separate_shared_21_test_LDADD = \ |
| 389 | two_file_shared_2.so two_file_shared_1.so |
| 390 | |
| 391 | check_PROGRAMS += two_file_relocatable_test |
| 392 | two_file_relocatable_test_SOURCES = two_file_test_main.cc |
| 393 | two_file_relocatable_test_DEPENDENCIES = \ |
| 394 | gcctestdir/ld two_file_relocatable.o |
| 395 | two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 396 | two_file_relocatable_test_LDADD = two_file_relocatable.o |
| 397 | two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o |
| 398 | gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o |
| 399 | |
| 400 | check_PROGRAMS += two_file_pie_test |
| 401 | two_file_test_1_pie.o: two_file_test_1.cc |
| 402 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 403 | two_file_test_1b_pie.o: two_file_test_1b.cc |
| 404 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 405 | two_file_test_2_pie.o: two_file_test_2.cc |
| 406 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 407 | two_file_test_main_pie.o: two_file_test_main.cc |
| 408 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 409 | two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \ |
| 410 | two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld |
| 411 | $(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 |
| 412 | |
| 413 | check_SCRIPTS += two_file_shared.sh |
| 414 | check_DATA += two_file_shared.dbg |
| 415 | MOSTLYCLEANFILES += two_file_shared.dbg |
| 416 | two_file_shared.dbg: two_file_shared.so |
| 417 | $(TEST_READELF) -w $< >$@ 2>/dev/null |
| 418 | |
| 419 | # The nonpic tests will fail on platforms which can not put non-PIC |
| 420 | # code into shared libraries, so we just don't run them in that case. |
| 421 | if FN_PTRS_IN_SO_WITHOUT_PIC |
| 422 | |
| 423 | check_PROGRAMS += two_file_shared_1_nonpic_test |
| 424 | check_PROGRAMS += two_file_shared_2_nonpic_test |
| 425 | check_PROGRAMS += two_file_same_shared_nonpic_test |
| 426 | check_PROGRAMS += two_file_separate_shared_12_nonpic_test |
| 427 | check_PROGRAMS += two_file_separate_shared_21_nonpic_test |
| 428 | check_PROGRAMS += two_file_mixed_shared_test |
| 429 | check_PROGRAMS += two_file_mixed_2_shared_test |
| 430 | two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld |
| 431 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext |
| 432 | two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld |
| 433 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o |
| 434 | two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld |
| 435 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext |
| 436 | two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld |
| 437 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext |
| 438 | two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld |
| 439 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so -Wl,-z,notext |
| 440 | |
| 441 | two_file_shared_1_nonpic_test_SOURCES = \ |
| 442 | two_file_test_2.cc two_file_test_main.cc |
| 443 | two_file_shared_1_nonpic_test_DEPENDENCIES = \ |
| 444 | gcctestdir/ld two_file_shared_1_nonpic.so |
| 445 | two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 446 | two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so |
| 447 | |
| 448 | two_file_shared_2_nonpic_test_SOURCES = \ |
| 449 | two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
| 450 | two_file_shared_2_nonpic_test_DEPENDENCIES = \ |
| 451 | gcctestdir/ld two_file_shared_2_nonpic.so |
| 452 | two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 453 | two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so |
| 454 | |
| 455 | two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc |
| 456 | two_file_same_shared_nonpic_test_DEPENDENCIES = \ |
| 457 | gcctestdir/ld two_file_shared_nonpic.so |
| 458 | two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 459 | two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so |
| 460 | |
| 461 | two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc |
| 462 | two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \ |
| 463 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so |
| 464 | two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 465 | two_file_separate_shared_12_nonpic_test_LDADD = \ |
| 466 | two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so |
| 467 | |
| 468 | two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc |
| 469 | two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \ |
| 470 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so |
| 471 | two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 472 | two_file_separate_shared_21_nonpic_test_LDADD = \ |
| 473 | two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so |
| 474 | |
| 475 | two_file_mixed_shared_test_SOURCES = two_file_test_main.cc |
| 476 | two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so |
| 477 | two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 478 | two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so |
| 479 | |
| 480 | two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc |
| 481 | two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so |
| 482 | two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 483 | two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so |
| 484 | |
| 485 | check_PROGRAMS += two_file_mixed_pie_test |
| 486 | two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \ |
| 487 | two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld |
| 488 | $(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 |
| 489 | |
| 490 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
| 491 | |
| 492 | check_PROGRAMS += two_file_strip_test |
| 493 | two_file_strip_test: two_file_test |
| 494 | $(TEST_STRIP) -o two_file_strip_test two_file_test |
| 495 | |
| 496 | check_PROGRAMS += two_file_same_shared_strip_test |
| 497 | two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc |
| 498 | two_file_same_shared_strip_test_DEPENDENCIES = \ |
| 499 | gcctestdir/ld two_file_shared_strip.so |
| 500 | two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R. |
| 501 | two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so |
| 502 | two_file_shared_strip.so: two_file_shared.so |
| 503 | $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so |
| 504 | |
| 505 | check_PROGRAMS += common_test_1 |
| 506 | common_test_1_SOURCES = common_test_1.c |
| 507 | common_test_1_DEPENDENCIES = gcctestdir/ld |
| 508 | common_test_1_LDFLAGS = -Bgcctestdir/ |
| 509 | common_test_1_LDADD = |
| 510 | |
| 511 | check_PROGRAMS += common_test_2 |
| 512 | common_test_2_SOURCES = common_test_1.c |
| 513 | common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld |
| 514 | common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 515 | common_test_2_LDADD = common_test_2.so common_test_3.so |
| 516 | common_test_2_pic.o: common_test_2.c |
| 517 | $(COMPILE) -c -fpic -o $@ $< |
| 518 | common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld |
| 519 | $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so |
| 520 | common_test_3_pic.o: common_test_3.c |
| 521 | $(COMPILE) -c -fpic -o $@ $< |
| 522 | common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld |
| 523 | $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script |
| 524 | |
| 525 | check_PROGRAMS += exception_test |
| 526 | check_PROGRAMS += exception_shared_1_test |
| 527 | check_PROGRAMS += exception_shared_2_test |
| 528 | check_PROGRAMS += exception_same_shared_test |
| 529 | check_PROGRAMS += exception_separate_shared_12_test |
| 530 | check_PROGRAMS += exception_separate_shared_21_test |
| 531 | exception_test_1_pic.o: exception_test_1.cc |
| 532 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 533 | exception_test_2_pic.o: exception_test_2.cc |
| 534 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 535 | exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld |
| 536 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o |
| 537 | exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld |
| 538 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o |
| 539 | exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld |
| 540 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o |
| 541 | |
| 542 | exception_test_SOURCES = \ |
| 543 | exception_test_main.cc \ |
| 544 | exception_test_1.cc \ |
| 545 | exception_test_2.cc \ |
| 546 | exception_test.h |
| 547 | exception_test_DEPENDENCIES = gcctestdir/ld |
| 548 | exception_test_LDFLAGS = -Bgcctestdir/ |
| 549 | exception_test_LDADD = |
| 550 | |
| 551 | if HAVE_STATIC |
| 552 | check_PROGRAMS += exception_static_test |
| 553 | exception_static_test_SOURCES = $(exception_test_SOURCES) |
| 554 | exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) |
| 555 | exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static |
| 556 | exception_static_test_LDADD = $(exception_test_LDADD) |
| 557 | endif |
| 558 | |
| 559 | exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc |
| 560 | exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so |
| 561 | exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 562 | exception_shared_1_test_LDADD = exception_shared_1.so |
| 563 | |
| 564 | exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc |
| 565 | exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so |
| 566 | exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 567 | exception_shared_2_test_LDADD = exception_shared_2.so |
| 568 | |
| 569 | exception_same_shared_test_SOURCES = exception_test_main.cc |
| 570 | exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so |
| 571 | exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 572 | exception_same_shared_test_LDADD = exception_shared.so |
| 573 | |
| 574 | exception_separate_shared_12_test_SOURCES = exception_test_main.cc |
| 575 | exception_separate_shared_12_test_DEPENDENCIES = \ |
| 576 | gcctestdir/ld exception_shared_1.so exception_shared_2.so |
| 577 | exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 578 | exception_separate_shared_12_test_LDADD = \ |
| 579 | exception_shared_1.so exception_shared_2.so |
| 580 | |
| 581 | exception_separate_shared_21_test_SOURCES = exception_test_main.cc |
| 582 | exception_separate_shared_21_test_DEPENDENCIES = \ |
| 583 | gcctestdir/ld exception_shared_1.so exception_shared_2.so |
| 584 | exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 585 | exception_separate_shared_21_test_LDADD = \ |
| 586 | exception_shared_2.so exception_shared_1.so |
| 587 | |
| 588 | |
| 589 | check_PROGRAMS += weak_test |
| 590 | weak_test_SOURCES = weak_test.cc |
| 591 | weak_test_DEPENDENCIES = gcctestdir/ld |
| 592 | weak_test_LDFLAGS = -Bgcctestdir/ |
| 593 | weak_test_LDADD = |
| 594 | |
| 595 | check_PROGRAMS += weak_undef_test |
| 596 | MOSTLYCLEANFILES += alt/weak_undef_lib.so |
| 597 | weak_undef_test_SOURCES = weak_undef_test.cc |
| 598 | weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so |
| 599 | weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt |
| 600 | weak_undef_test_LDADD = -L . weak_undef_lib.so |
| 601 | weak_undef_file1.o: weak_undef_file1.cc |
| 602 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 603 | weak_undef_file2.o: weak_undef_file2.cc |
| 604 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 605 | weak_undef_lib.so: weak_undef_file1.o |
| 606 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o |
| 607 | alt/weak_undef_lib.so: weak_undef_file2.o |
| 608 | test -d alt || mkdir -p alt |
| 609 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o |
| 610 | |
| 611 | if FN_PTRS_IN_SO_WITHOUT_PIC |
| 612 | check_PROGRAMS += weak_undef_nonpic_test |
| 613 | MOSTLYCLEANFILES += alt/weak_undef_lib_nonpic.so |
| 614 | weak_undef_nonpic_test_SOURCES = weak_undef_test.cc |
| 615 | weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so |
| 616 | weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt |
| 617 | weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so |
| 618 | weak_undef_file1_nonpic.o: weak_undef_file1.cc |
| 619 | $(CXXCOMPILE) -c -o $@ $< |
| 620 | weak_undef_file2_nonpic.o: weak_undef_file2.cc |
| 621 | $(CXXCOMPILE) -c -o $@ $< |
| 622 | weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o |
| 623 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext |
| 624 | alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o |
| 625 | test -d alt || mkdir -p alt |
| 626 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext |
| 627 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
| 628 | |
| 629 | |
| 630 | check_PROGRAMS += weak_alias_test |
| 631 | weak_alias_test_SOURCES = weak_alias_test_main.cc |
| 632 | weak_alias_test_DEPENDENCIES = \ |
| 633 | gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \ |
| 634 | weak_alias_test_3.o weak_alias_test_4.so weak_alias_test_5.so |
| 635 | weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 636 | weak_alias_test_LDADD = \ |
| 637 | weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \ |
| 638 | weak_alias_test_4.so weak_alias_test_5.so |
| 639 | weak_alias_test_1_pic.o: weak_alias_test_1.cc |
| 640 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 641 | weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld |
| 642 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o |
| 643 | weak_alias_test_2_pic.o: weak_alias_test_2.cc |
| 644 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 645 | weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld |
| 646 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o |
| 647 | weak_alias_test_3.o: weak_alias_test_3.cc |
| 648 | $(CXXCOMPILE) -c -o $@ $< |
| 649 | weak_alias_test_4_pic.o: weak_alias_test_4.cc |
| 650 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 651 | weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld |
| 652 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o |
| 653 | weak_alias_test_5_pic.o: weak_alias_test_5.cc |
| 654 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 655 | weak_alias_test_5.so: weak_alias_test_5_pic.o $(srcdir)/weak_alias_test.script gcctestdir/ld |
| 656 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_5_pic.o \ |
| 657 | -Wl,--version-script,$(srcdir)/weak_alias_test.script |
| 658 | |
| 659 | check_SCRIPTS += weak_plt.sh |
| 660 | check_PROGRAMS += weak_plt |
| 661 | check_DATA += weak_plt_shared.so |
| 662 | weak_plt_main_pic.o: weak_plt_main.cc |
| 663 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 664 | weak_plt: weak_plt_main_pic.o gcctestdir/ld |
| 665 | $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o |
| 666 | weak_plt_shared_pic.o: weak_plt_shared.cc |
| 667 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 668 | weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld |
| 669 | $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o |
| 670 | |
| 671 | check_PROGRAMS += copy_test |
| 672 | copy_test_SOURCES = copy_test.cc |
| 673 | copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so |
| 674 | copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 675 | copy_test_LDADD = copy_test_1.so copy_test_2.so |
| 676 | copy_test_1_pic.o: copy_test_1.cc |
| 677 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 678 | copy_test_1.so: gcctestdir/ld copy_test_1_pic.o |
| 679 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o |
| 680 | copy_test_2_pic.o: copy_test_2.cc |
| 681 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 682 | copy_test_2.so: gcctestdir/ld copy_test_2_pic.o |
| 683 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o |
| 684 | |
| 685 | if TLS |
| 686 | |
| 687 | check_PROGRAMS += tls_test |
| 688 | check_PROGRAMS += tls_pic_test |
| 689 | check_PROGRAMS += tls_pie_test |
| 690 | check_PROGRAMS += tls_pie_pic_test |
| 691 | check_PROGRAMS += tls_shared_test |
| 692 | check_PROGRAMS += tls_shared_ie_test |
| 693 | check_PROGRAMS += tls_shared_gd_to_ie_test |
| 694 | tls_test_pic.o: tls_test.cc |
| 695 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 696 | tls_test_file2_pic.o: tls_test_file2.cc |
| 697 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 698 | tls_test_c_pic.o: tls_test_c.c |
| 699 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< |
| 700 | tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld |
| 701 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs |
| 702 | tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld |
| 703 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o |
| 704 | |
| 705 | tls_test_pic_ie.o: tls_test.cc |
| 706 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< |
| 707 | tls_test_file2_pic_ie.o: tls_test_file2.cc |
| 708 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< |
| 709 | tls_test_c_pic_ie.o: tls_test_c.c |
| 710 | $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $< |
| 711 | tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld |
| 712 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o |
| 713 | |
| 714 | tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h |
| 715 | tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o |
| 716 | tls_test_LDFLAGS = -Bgcctestdir/ |
| 717 | tls_test_LDADD = tls_test_c.o -lpthread |
| 718 | tls_test_c.o: tls_test_c.c |
| 719 | $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $< |
| 720 | |
| 721 | tls_pic_test_SOURCES = tls_test_main.cc |
| 722 | tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \ |
| 723 | tls_test_c_pic.o |
| 724 | tls_pic_test_LDFLAGS = -Bgcctestdir/ |
| 725 | tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \ |
| 726 | -lpthread |
| 727 | |
| 728 | tls_test_main_pie.o: tls_test_main.cc tls_test.h |
| 729 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 730 | tls_test_pie.o: tls_test.cc tls_test.h |
| 731 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 732 | tls_test_file2_pie.o: tls_test_file2.cc tls_test.h |
| 733 | $(CXXCOMPILE) -c -fpie -o $@ $< |
| 734 | tls_test_c_pie.o: tls_test_c.c |
| 735 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< |
| 736 | tls_pie_test: tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o \ |
| 737 | tls_test_c_pie.o gcctestdir/ld |
| 738 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pie.o tls_test_file2_pie.o tls_test_c_pie.o -lpthread |
| 739 | |
| 740 | tls_pie_pic_test: tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o \ |
| 741 | tls_test_c_pic.o gcctestdir/ld |
| 742 | $(CXXLINK) -Bgcctestdir/ -pie tls_test_main_pie.o tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -lpthread |
| 743 | |
| 744 | tls_shared_test_SOURCES = tls_test_main.cc |
| 745 | tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so |
| 746 | tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 747 | tls_shared_test_LDADD = tls_test_shared.so -lpthread |
| 748 | |
| 749 | tls_shared_ie_test_SOURCES = tls_test_main.cc |
| 750 | tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so |
| 751 | tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 752 | tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread |
| 753 | |
| 754 | tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc |
| 755 | tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \ |
| 756 | tls_test_c_pic.o tls_test_shared2.so |
| 757 | tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 758 | tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \ |
| 759 | tls_test_shared2.so -lpthread |
| 760 | |
| 761 | if TLS_GNU2_DIALECT |
| 762 | |
| 763 | check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test |
| 764 | |
| 765 | tls_test_gnu2.o: tls_test.cc |
| 766 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< |
| 767 | tls_test_file2_gnu2.o: tls_test_file2.cc |
| 768 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< |
| 769 | tls_test_c_gnu2.o: tls_test_c.c |
| 770 | $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $< |
| 771 | tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld |
| 772 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o |
| 773 | |
| 774 | tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc |
| 775 | tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \ |
| 776 | tls_test_c_gnu2.o tls_test_gnu2_shared2.so |
| 777 | tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 778 | tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \ |
| 779 | tls_test_gnu2_shared2.so -lpthread |
| 780 | |
| 781 | if TLS_DESCRIPTORS |
| 782 | |
| 783 | check_PROGRAMS += tls_shared_gnu2_test |
| 784 | |
| 785 | tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld |
| 786 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o |
| 787 | |
| 788 | tls_shared_gnu2_test_SOURCES = tls_test_main.cc |
| 789 | tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so |
| 790 | tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 791 | tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread |
| 792 | |
| 793 | endif TLS_DESCRIPTORS |
| 794 | |
| 795 | endif TLS_GNU2_DIALECT |
| 796 | |
| 797 | if HAVE_STATIC |
| 798 | if STATIC_TLS |
| 799 | check_PROGRAMS += tls_static_test |
| 800 | check_PROGRAMS += tls_static_pic_test |
| 801 | |
| 802 | tls_static_test_SOURCES = $(tls_test_SOURCES) |
| 803 | tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) |
| 804 | tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static |
| 805 | tls_static_test_LDADD = $(tls_test_LDADD) |
| 806 | |
| 807 | tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES) |
| 808 | tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) |
| 809 | tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static |
| 810 | tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) |
| 811 | endif |
| 812 | endif |
| 813 | |
| 814 | if FN_PTRS_IN_SO_WITHOUT_PIC |
| 815 | check_PROGRAMS += tls_shared_nonpic_test |
| 816 | tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld |
| 817 | $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext |
| 818 | |
| 819 | tls_shared_nonpic_test_SOURCES = tls_test_main.cc |
| 820 | tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so |
| 821 | tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 822 | tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread |
| 823 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
| 824 | |
| 825 | endif TLS |
| 826 | |
| 827 | check_PROGRAMS += many_sections_test |
| 828 | many_sections_test_SOURCES = many_sections_test.cc |
| 829 | many_sections_test_DEPENDENCIES = gcctestdir/ld |
| 830 | many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic |
| 831 | many_sections_test_LDADD = |
| 832 | |
| 833 | BUILT_SOURCES += many_sections_define.h |
| 834 | MOSTLYCLEANFILES += many_sections_define.h |
| 835 | many_sections_define.h: |
| 836 | (for i in `seq 1 70000`; do \ |
| 837 | echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \ |
| 838 | done) > $@.tmp |
| 839 | mv -f $@.tmp $@ |
| 840 | |
| 841 | BUILT_SOURCES += many_sections_check.h |
| 842 | MOSTLYCLEANFILES += many_sections_check.h |
| 843 | many_sections_check.h: |
| 844 | (for i in `seq 1 1000 70000`; do \ |
| 845 | echo "assert(var_$$i == $$i);"; \ |
| 846 | done) > $@.tmp |
| 847 | mv -f $@.tmp $@ |
| 848 | |
| 849 | check_PROGRAMS += many_sections_r_test |
| 850 | many_sections_r_test.o: many_sections_test.o gcctestdir/ld |
| 851 | gcctestdir/ld -r -o $@ many_sections_test.o |
| 852 | many_sections_r_test: many_sections_r_test.o gcctestdir/ld |
| 853 | $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS) |
| 854 | |
| 855 | check_PROGRAMS += initpri1 |
| 856 | initpri1_SOURCES = initpri1.c |
| 857 | initpri1_DEPENDENCIES = gcctestdir/ld |
| 858 | initpri1_LDFLAGS = -Bgcctestdir/ |
| 859 | initpri1_LDADD = |
| 860 | |
| 861 | check_PROGRAMS += initpri2 |
| 862 | initpri2_SOURCES = initpri2.c |
| 863 | initpri2_DEPENDENCIES = gcctestdir/ld |
| 864 | initpri2_LDFLAGS = -Bgcctestdir/ |
| 865 | initpri2_LDADD = |
| 866 | |
| 867 | check_PROGRAMS += initpri3a |
| 868 | initpri3a_SOURCES = initpri3.c |
| 869 | initpri3a_DEPENDENCIES = gcctestdir/ld |
| 870 | initpri3a_LDFLAGS = -Bgcctestdir/ |
| 871 | initpri3a_LDADD = |
| 872 | |
| 873 | check_PROGRAMS += initpri3b |
| 874 | initpri3b_SOURCES = initpri3.c |
| 875 | initpri3b_DEPENDENCIES = gcctestdir/ld |
| 876 | initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array |
| 877 | initpri3b_LDADD = |
| 878 | |
| 879 | # Test --detect-odr-violations |
| 880 | check_SCRIPTS += debug_msg.sh |
| 881 | |
| 882 | # Create the data files that debug_msg.sh analyzes. |
| 883 | check_DATA += debug_msg.err |
| 884 | MOSTLYCLEANFILES += debug_msg.err |
| 885 | debug_msg.o: debug_msg.cc |
| 886 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc |
| 887 | odr_violation1.o: odr_violation1.cc |
| 888 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc |
| 889 | # Compile with different optimization flags to check that rearranged |
| 890 | # instructions don't cause a false positive. |
| 891 | odr_violation2.o: odr_violation2.cc |
| 892 | $(CXXCOMPILE) -O2 -g -c -w -o $@ $(srcdir)/odr_violation2.cc |
| 893 | debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld |
| 894 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" |
| 895 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ |
| 896 | then \ |
| 897 | echo 1>&2 "Link of debug_msg should have failed"; \ |
| 898 | rm -f $@; \ |
| 899 | exit 1; \ |
| 900 | fi |
| 901 | |
| 902 | |
| 903 | if HAVE_ZLIB |
| 904 | |
| 905 | # Check that --detect-odr-violations works with compressed debug sections. |
| 906 | check_DATA += debug_msg_cdebug.err |
| 907 | MOSTLYCLEANFILES += debug_msg_cdebug.err |
| 908 | debug_msg_cdebug.o: debug_msg.cc gcctestdir/as |
| 909 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/debug_msg.cc |
| 910 | odr_violation1_cdebug.o: odr_violation1.cc gcctestdir/as |
| 911 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation1.cc |
| 912 | odr_violation2_cdebug.o: odr_violation2.cc gcctestdir/as |
| 913 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -Wa,--compress-debug-sections -c -w -o $@ $(srcdir)/odr_violation2.cc |
| 914 | debug_msg_cdebug.err: debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o gcctestdir/ld |
| 915 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o "2>$@" |
| 916 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_cdebug debug_msg_cdebug.o odr_violation1_cdebug.o odr_violation2_cdebug.o 2>$@; \ |
| 917 | then \ |
| 918 | echo 1>&2 "Link of debug_msg_cdebug should have failed"; \ |
| 919 | rm -f $@; \ |
| 920 | exit 1; \ |
| 921 | fi |
| 922 | |
| 923 | endif HAVE_ZLIB |
| 924 | |
| 925 | # See if we can also detect problems when we're linking .so's, not .o's. |
| 926 | check_DATA += debug_msg_so.err |
| 927 | MOSTLYCLEANFILES += debug_msg_so.err |
| 928 | debug_msg.so: debug_msg.cc gcctestdir/ld |
| 929 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc |
| 930 | odr_violation1.so: odr_violation1.cc gcctestdir/ld |
| 931 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc |
| 932 | odr_violation2.so: odr_violation2.cc gcctestdir/ld |
| 933 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
| 934 | debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld |
| 935 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" |
| 936 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ |
| 937 | then \ |
| 938 | echo 1>&2 "Link of debug_msg_so should have failed"; \ |
| 939 | rm -f $@; \ |
| 940 | exit 1; \ |
| 941 | fi |
| 942 | |
| 943 | # We also want to make sure we do something reasonable when there's no |
| 944 | # debug info available. For the best test, we use .so's. |
| 945 | check_DATA += debug_msg_ndebug.err |
| 946 | MOSTLYCLEANFILES += debug_msg_ndebug.err |
| 947 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld |
| 948 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc |
| 949 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld |
| 950 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc |
| 951 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld |
| 952 | $(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc |
| 953 | debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld |
| 954 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@" |
| 955 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \ |
| 956 | then \ |
| 957 | echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ |
| 958 | rm -f $@; \ |
| 959 | exit 1; \ |
| 960 | fi |
| 961 | |
| 962 | |
| 963 | # Similar to --detect-odr-violations: check for undefined symbols in .so's |
| 964 | check_SCRIPTS += undef_symbol.sh |
| 965 | check_DATA += undef_symbol.err |
| 966 | MOSTLYCLEANFILES += undef_symbol.err |
| 967 | undef_symbol.o: undef_symbol.cc |
| 968 | $(CXXCOMPILE) -O0 -g -c -fPIC $< |
| 969 | undef_symbol.so: undef_symbol.o gcctestdir/ld |
| 970 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o |
| 971 | undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld |
| 972 | @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@" |
| 973 | @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \ |
| 974 | then \ |
| 975 | echo 1>&2 "Link of undef_symbol_test should have failed"; \ |
| 976 | rm -f $@; \ |
| 977 | exit 1; \ |
| 978 | fi |
| 979 | |
| 980 | |
| 981 | # Test -o when emitting to a special file (such as something in /dev). |
| 982 | check_PROGRAMS += flagstest_o_specialfile |
| 983 | flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld |
| 984 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@ |
| 985 | chmod a+x $@ |
| 986 | test -s $@ |
| 987 | |
| 988 | if HAVE_ZLIB |
| 989 | |
| 990 | # Test --compress-debug-sections. FIXME: check we actually compress. |
| 991 | check_PROGRAMS += flagstest_compress_debug_sections |
| 992 | flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld |
| 993 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib |
| 994 | test -s $@ |
| 995 | |
| 996 | |
| 997 | # The specialfile output has a tricky case when we also compress debug |
| 998 | # sections, because it requires output-file resizing. |
| 999 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections |
| 1000 | flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \ |
| 1001 | gcctestdir/ld |
| 1002 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@ |
| 1003 | chmod a+x $@ |
| 1004 | test -s $@ |
| 1005 | |
| 1006 | endif HAVE_ZLIB |
| 1007 | |
| 1008 | # Test -TText and -Tdata. |
| 1009 | check_PROGRAMS += flagstest_o_ttext_1 |
| 1010 | flagstest_o_ttext_1: flagstest_debug.o gcctestdir/ld |
| 1011 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400000 -Wl,-Tdata,0x800000 |
| 1012 | |
| 1013 | # This version won't be runnable, because there is no way to put the |
| 1014 | # PT_PHDR segment at file offset 0. We just make sure that we can |
| 1015 | # build it without error. |
| 1016 | check_DATA += flagstest_o_ttext_2 |
| 1017 | flagstest_o_ttext_2: flagstest_debug.o gcctestdir/ld |
| 1018 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,-Ttext,0x400010 -Wl,-Tdata,0x800010 |
| 1019 | |
| 1020 | # Test symbol versioning. |
| 1021 | check_PROGRAMS += ver_test |
| 1022 | ver_test_SOURCES = ver_test_main.cc |
| 1023 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so |
| 1024 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1025 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so |
| 1026 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld |
| 1027 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so |
| 1028 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
| 1029 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script -Wl,-R,. ver_test_2.o ver_test_4.so |
| 1030 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld |
| 1031 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o |
| 1032 | ver_test_1.o: ver_test_1.cc |
| 1033 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1034 | ver_test_2.o: ver_test_2.cc |
| 1035 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1036 | ver_test_3.o: ver_test_3.cc |
| 1037 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1038 | ver_test_4.o: ver_test_4.cc |
| 1039 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1040 | |
| 1041 | check_SCRIPTS += ver_test_1.sh |
| 1042 | check_DATA += ver_test_1.syms |
| 1043 | ver_test_1.syms: ver_test_1.so |
| 1044 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
| 1045 | |
| 1046 | check_PROGRAMS += ver_test_2 |
| 1047 | ver_test_2_SOURCES = ver_test_main_2.cc |
| 1048 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so |
| 1049 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1050 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so |
| 1051 | |
| 1052 | check_SCRIPTS += ver_test_2.sh |
| 1053 | check_DATA += ver_test_2.syms |
| 1054 | ver_test_2.syms: ver_test_2 |
| 1055 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
| 1056 | |
| 1057 | check_SCRIPTS += ver_test_4.sh |
| 1058 | check_DATA += ver_test_4.syms |
| 1059 | ver_test_4.syms: ver_test_4.so |
| 1060 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
| 1061 | |
| 1062 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld |
| 1063 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so |
| 1064 | ver_test_5.o: ver_test_5.cc |
| 1065 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1066 | check_SCRIPTS += ver_test_5.sh |
| 1067 | check_DATA += ver_test_5.syms |
| 1068 | ver_test_5.syms: ver_test_5.so |
| 1069 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
| 1070 | |
| 1071 | check_PROGRAMS += ver_test_6 |
| 1072 | ver_test_6_SOURCES = ver_test_6.c |
| 1073 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so |
| 1074 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1075 | ver_test_6_LDADD = ver_test_2.so |
| 1076 | |
| 1077 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
| 1078 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o |
| 1079 | ver_test_7.o: ver_test_7.cc |
| 1080 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1081 | check_SCRIPTS += ver_test_7.sh |
| 1082 | check_DATA += ver_test_7.syms |
| 1083 | ver_test_7.syms: ver_test_7.so |
| 1084 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
| 1085 | |
| 1086 | check_PROGRAMS += ver_test_8 |
| 1087 | ver_test_8_SOURCES = two_file_test_main.cc |
| 1088 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so |
| 1089 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1090 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so |
| 1091 | ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld |
| 1092 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so |
| 1093 | ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld |
| 1094 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o |
| 1095 | |
| 1096 | check_PROGRAMS += ver_test_9 |
| 1097 | ver_test_9_SOURCES = ver_test_main.cc |
| 1098 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so |
| 1099 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1100 | ver_test_9_LDADD = ver_test_9.so |
| 1101 | ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld |
| 1102 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-R,. ver_test_9.o ver_test_5.so ver_test_4.so |
| 1103 | ver_test_9.o: ver_test_9.cc |
| 1104 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1105 | |
| 1106 | check_SCRIPTS += ver_test_10.sh |
| 1107 | check_DATA += ver_test_10.syms |
| 1108 | ver_test_10.syms: ver_test_10.so |
| 1109 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
| 1110 | ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script |
| 1111 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o |
| 1112 | |
| 1113 | check_PROGRAMS += ver_test_11 |
| 1114 | MOSTLYCLEANFILES += ver_test_11.a |
| 1115 | ver_test_11_SOURCES = ver_test_main_2.cc |
| 1116 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a |
| 1117 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1118 | ver_test_11_LDADD = ver_test_11.a |
| 1119 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o |
| 1120 | $(TEST_AR) rc $@ $^ |
| 1121 | |
| 1122 | check_PROGRAMS += ver_test_12 |
| 1123 | ver_test_12_SOURCES = ver_test_main_2.cc |
| 1124 | ver_test_12_DEPENDENCIES = gcctestdir/ld ver_test_12.o |
| 1125 | ver_test_12_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1126 | ver_test_12_LDADD = ver_test_12.o |
| 1127 | ver_test_12.o: gcctestdir/ld ver_test_1.o ver_test_2.o ver_test_4.o |
| 1128 | gcctestdir/ld -r -o $@ ver_test_1.o ver_test_2.o ver_test_4.o |
| 1129 | |
| 1130 | check_PROGRAMS += protected_1 |
| 1131 | protected_1_SOURCES = \ |
| 1132 | protected_main_1.cc protected_main_2.cc protected_main_3.cc |
| 1133 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so |
| 1134 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1135 | protected_1_LDADD = protected_1.so |
| 1136 | |
| 1137 | protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o |
| 1138 | $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o |
| 1139 | protected_1_pic.o: protected_1.cc |
| 1140 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1141 | protected_2_pic.o: protected_2.cc |
| 1142 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1143 | protected_3_pic.o: protected_3.cc |
| 1144 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1145 | |
| 1146 | check_PROGRAMS += protected_2 |
| 1147 | protected_2_SOURCES = protected_main_1.cc protected_3.cc |
| 1148 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so |
| 1149 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1150 | protected_2_LDADD = protected_1.so |
| 1151 | |
| 1152 | check_DATA += protected_3.err |
| 1153 | MOSTLYCLEANFILES += protected_3.err |
| 1154 | protected_4_pic.o: protected_4.cc |
| 1155 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1156 | protected_3.err: protected_4_pic.o gcctestdir/ld |
| 1157 | @echo $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o "2>$@" |
| 1158 | @if $(CXXLINK) -Bgcctestdir/ -shared -o protected_4.so protected_4_pic.o 2>$@; then \ |
| 1159 | echo 1>&2 "Link of protected_4.so should have failed"; \ |
| 1160 | rm -f $@; \ |
| 1161 | exit 1; \ |
| 1162 | fi |
| 1163 | |
| 1164 | check_PROGRAMS += relro_test |
| 1165 | check_SCRIPTS += relro_test.sh |
| 1166 | check_DATA += relro_test.stdout |
| 1167 | relro_test_SOURCES = relro_test_main.cc |
| 1168 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so |
| 1169 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1170 | relro_test_LDADD = relro_test.so |
| 1171 | relro_test.so: gcctestdir/ld relro_test_pic.o |
| 1172 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o |
| 1173 | relro_test_pic.o: relro_test.cc |
| 1174 | $(CXXCOMPILE) -c -fpic -o $@ $< |
| 1175 | relro_test.stdout: relro_test.so |
| 1176 | $(TEST_READELF) -SlW relro_test.so > relro_test.stdout |
| 1177 | |
| 1178 | check_PROGRAMS += relro_now_test |
| 1179 | relro_now_test_SOURCES = relro_test_main.cc |
| 1180 | relro_now_test_DEPENDENCIES = gcctestdir/ld relro_now_test.so |
| 1181 | relro_now_test_LDFLAGS = -Bgcctestdir -Wl,-R,. -Wl,-z,relro -Wl,-z,now |
| 1182 | relro_now_test_LDADD = relro_now_test.so |
| 1183 | relro_now_test.so: gcctestdir/ld relro_test_pic.o |
| 1184 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-z,now relro_test_pic.o |
| 1185 | |
| 1186 | check_PROGRAMS += relro_strip_test |
| 1187 | relro_strip_test_SOURCES = relro_test_main.cc |
| 1188 | relro_strip_test_DEPENDENCIES = gcctestdir/ld relro_strip_test.so |
| 1189 | relro_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1190 | relro_strip_test_LDADD = relro_strip_test.so |
| 1191 | relro_strip_test.so: relro_test.so |
| 1192 | $(TEST_STRIP) -o $@ $< |
| 1193 | |
| 1194 | check_PROGRAMS += relro_script_test |
| 1195 | relro_script_test_SOURCES = relro_test_main.cc |
| 1196 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so |
| 1197 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1198 | relro_script_test_LDADD = relro_script_test.so |
| 1199 | relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o |
| 1200 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o |
| 1201 | |
| 1202 | check_PROGRAMS += script_test_1 |
| 1203 | script_test_1_SOURCES = script_test_1.cc |
| 1204 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t |
| 1205 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t |
| 1206 | script_test_1_LDADD = |
| 1207 | |
| 1208 | check_PROGRAMS += script_test_2 |
| 1209 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc |
| 1210 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t |
| 1211 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t |
| 1212 | script_test_2_LDADD = |
| 1213 | |
| 1214 | check_PROGRAMS += justsyms |
| 1215 | justsyms_SOURCES = justsyms_1.cc |
| 1216 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o |
| 1217 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o |
| 1218 | justsyms_LDADD = |
| 1219 | justsyms_2.o: justsyms_2.cc |
| 1220 | $(CXXCOMPILE) -c -o $@ $< |
| 1221 | justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t |
| 1222 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o |
| 1223 | |
| 1224 | check_PROGRAMS += justsyms_exec |
| 1225 | justsyms_exec_SOURCES = justsyms_exec.c |
| 1226 | justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib |
| 1227 | justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib |
| 1228 | justsyms_exec_LDADD = |
| 1229 | justsyms_lib.o: justsyms_lib.c |
| 1230 | $(COMPILE) -c -o $@ $< |
| 1231 | justsyms_lib: justsyms_lib.o gcctestdir/ld |
| 1232 | gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o |
| 1233 | |
| 1234 | check_PROGRAMS += binary_test |
| 1235 | MOSTLYCLEANFILES += binary.txt |
| 1236 | binary_test_SOURCES = binary_test.cc |
| 1237 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt |
| 1238 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf |
| 1239 | binary_test_LDADD = |
| 1240 | # Copy the file to the build directory to avoid worrying about the |
| 1241 | # full pathname in the generated symbols. |
| 1242 | binary.txt: $(srcdir)/binary.in |
| 1243 | rm -f $@ |
| 1244 | $(LN_S) $< $@ |
| 1245 | |
| 1246 | check_SCRIPTS += ver_matching_test.sh |
| 1247 | check_DATA += ver_matching_test.stdout |
| 1248 | MOSTLYCLEANFILES += ver_matching_test.stdout |
| 1249 | ver_matching_def.so: ver_matching_def_pic.o $(srcdir)/version_script.map gcctestdir/ld |
| 1250 | $(CXXLINK) -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=$(srcdir)/version_script.map |
| 1251 | ver_matching_def_pic.o: ver_matching_def.cc |
| 1252 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
| 1253 | ver_matching_test.stdout: ver_matching_def.so |
| 1254 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
| 1255 | |
| 1256 | check_PROGRAMS += script_test_3 |
| 1257 | check_SCRIPTS += script_test_3.sh |
| 1258 | check_DATA += script_test_3.stdout |
| 1259 | MOSTLYCLEANFILES += script_test_3.stdout |
| 1260 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t |
| 1261 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t |
| 1262 | script_test_3.stdout: script_test_3 |
| 1263 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
| 1264 | |
| 1265 | check_PROGRAMS += tls_phdrs_script_test |
| 1266 | tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) |
| 1267 | tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t |
| 1268 | tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t |
| 1269 | tls_phdrs_script_test_LDADD = $(tls_test_LDADD) |
| 1270 | |
| 1271 | check_SCRIPTS += script_test_4.sh |
| 1272 | check_DATA += script_test_4.stdout |
| 1273 | MOSTLYCLEANFILES += script_test_4 |
| 1274 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t |
| 1275 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t |
| 1276 | script_test_4.stdout: script_test_4 |
| 1277 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout |
| 1278 | |
| 1279 | check_PROGRAMS += tls_script_test |
| 1280 | tls_script_test_SOURCES = $(tls_test_SOURCES) |
| 1281 | tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t |
| 1282 | tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t |
| 1283 | tls_script_test_LDADD = $(tls_test_LDADD) |
| 1284 | |
| 1285 | check_SCRIPTS += script_test_5.sh |
| 1286 | check_DATA += script_test_5.stdout |
| 1287 | MOSTLYCLEANFILES += script_test_5 |
| 1288 | script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t |
| 1289 | $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t |
| 1290 | script_test_5.stdout: script_test_5 |
| 1291 | $(TEST_READELF) -SW script_test_5 > script_test_5.stdout |
| 1292 | |
| 1293 | check_SCRIPTS += script_test_6.sh |
| 1294 | check_DATA += script_test_6.stdout |
| 1295 | MOSTLYCLEANFILES += script_test_6 |
| 1296 | script_test_6: basic_test.o gcctestdir/ld $(srcdir)/script_test_6.t |
| 1297 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_6.t \ |
| 1298 | -Wl,-Ttext=0x10001000 -Wl,-Tdata=0x10200000 -Wl,-Tbss=0x10400000 |
| 1299 | script_test_6.stdout: script_test_6 |
| 1300 | $(TEST_READELF) -SlW script_test_6 > script_test_6.stdout |
| 1301 | |
| 1302 | check_SCRIPTS += script_test_7.sh |
| 1303 | check_DATA += script_test_7.stdout |
| 1304 | MOSTLYCLEANFILES += script_test_7 |
| 1305 | script_test_7: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t |
| 1306 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t |
| 1307 | script_test_7.stdout: script_test_7 |
| 1308 | $(TEST_READELF) -SlW script_test_7 > script_test_7.stdout |
| 1309 | |
| 1310 | check_SCRIPTS += script_test_8.sh |
| 1311 | check_DATA += script_test_8.stdout |
| 1312 | MOSTLYCLEANFILES += script_test_8 |
| 1313 | script_test_8: basic_test.o gcctestdir/ld $(srcdir)/script_test_7.t |
| 1314 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_7.t \ |
| 1315 | -Wl,-Ttext=0x20001000 -Wl,-Tdata=0x20200000 -Wl,-Tbss=0x20400000 |
| 1316 | script_test_8.stdout: script_test_8 |
| 1317 | $(TEST_READELF) -SlW script_test_8 > script_test_8.stdout |
| 1318 | |
| 1319 | |
| 1320 | check_SCRIPTS += script_test_9.sh |
| 1321 | check_DATA += script_test_9.stdout |
| 1322 | script_test_9.o: script_test_9.cc |
| 1323 | $(CXXCOMPILE) -O0 -c -o $@ $< |
| 1324 | script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o |
| 1325 | $(CXXLINK) -Bgcctestdir/ script_test_9.o -T $(srcdir)/script_test_9.t |
| 1326 | script_test_9.stdout: script_test_9 |
| 1327 | $(TEST_READELF) -lW script_test_9 > script_test_9.stdout |
| 1328 | |
| 1329 | |
| 1330 | # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new, |
| 1331 | # and --dynamic-list-cpp-typeinfo |
| 1332 | |
| 1333 | check_SCRIPTS += dynamic_list.sh |
| 1334 | check_DATA += dynamic_list.stdout |
| 1335 | MOSTLYCLEANFILES += dynamic_list dynamic_list.stdout |
| 1336 | dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t |
| 1337 | $(CXXLINK) -Bgcctestdir/ basic_test.o \ |
| 1338 | -Wl,--dynamic-list $(srcdir)/dynamic_list.t \ |
| 1339 | -Wl,--dynamic-list-data \ |
| 1340 | -Wl,--dynamic-list-cpp-new \ |
| 1341 | -Wl,--dynamic-list-cpp-typeinfo |
| 1342 | dynamic_list.stdout: dynamic_list |
| 1343 | $(TEST_READELF) -W --dyn-syms dynamic_list > dynamic_list.stdout |
| 1344 | |
| 1345 | check_PROGRAMS += thin_archive_test_1 |
| 1346 | MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \ |
| 1347 | alt/thin_archive_test_2.o alt/thin_archive_test_4.o \ |
| 1348 | alt/libthin2.a alt/libthin4.a |
| 1349 | thin_archive_test_1_SOURCES = thin_archive_main.cc |
| 1350 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a |
| 1351 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt |
| 1352 | thin_archive_test_1_LDADD = libthin1.a -lthin2 |
| 1353 | |
| 1354 | check_PROGRAMS += thin_archive_test_2 |
| 1355 | thin_archive_test_2_SOURCES = thin_archive_main.cc |
| 1356 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a |
| 1357 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. |
| 1358 | thin_archive_test_2_LDADD = -lthinall |
| 1359 | |
| 1360 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o |
| 1361 | rm -f $@ |
| 1362 | $(TEST_AR) crT $@ $^ |
| 1363 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o |
| 1364 | rm -f $@ |
| 1365 | $(TEST_AR) crT $@ $^ |
| 1366 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o |
| 1367 | rm -f $@ |
| 1368 | $(TEST_AR) crT $@ $^ |
| 1369 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o |
| 1370 | rm -f $@ |
| 1371 | $(TEST_AR) crT $@ $^ |
| 1372 | libthinall.a: libthin3.a alt/libthin4.a |
| 1373 | rm -f $@ |
| 1374 | $(TEST_AR) crT $@ $^ |
| 1375 | alt/thin_archive_test_2.o: thin_archive_test_2.cc |
| 1376 | test -d alt || mkdir -p alt |
| 1377 | $(CXXCOMPILE) -c -o $@ $< |
| 1378 | alt/thin_archive_test_4.o: thin_archive_test_4.cc |
| 1379 | test -d alt || mkdir -p alt |
| 1380 | $(CXXCOMPILE) -c -o $@ $< |
| 1381 | |
| 1382 | if PLUGINS |
| 1383 | |
| 1384 | check_PROGRAMS += plugin_test_1 |
| 1385 | check_SCRIPTS += plugin_test_1.sh |
| 1386 | check_DATA += plugin_test_1.err |
| 1387 | MOSTLYCLEANFILES += plugin_test_1.err |
| 1388 | plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so |
| 1389 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err |
| 1390 | plugin_test_1.err: plugin_test_1 |
| 1391 | @touch plugin_test_1.err |
| 1392 | |
| 1393 | check_PROGRAMS += plugin_test_2 |
| 1394 | check_SCRIPTS += plugin_test_2.sh |
| 1395 | check_DATA += plugin_test_2.err |
| 1396 | MOSTLYCLEANFILES += plugin_test_2.err |
| 1397 | plugin_test_2: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so gcctestdir/ld plugin_test.so |
| 1398 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so 2>plugin_test_2.err |
| 1399 | plugin_test_2.err: plugin_test_2 |
| 1400 | @touch plugin_test_2.err |
| 1401 | |
| 1402 | check_PROGRAMS += plugin_test_3 |
| 1403 | check_SCRIPTS += plugin_test_3.sh |
| 1404 | check_DATA += plugin_test_3.err |
| 1405 | MOSTLYCLEANFILES += plugin_test_3.err |
| 1406 | plugin_test_3: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so |
| 1407 | $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_3.err |
| 1408 | plugin_test_3.err: plugin_test_3 |
| 1409 | @touch plugin_test_3.err |
| 1410 | |
| 1411 | check_PROGRAMS += plugin_test_4 |
| 1412 | check_SCRIPTS += plugin_test_4.sh |
| 1413 | check_DATA += plugin_test_4.err |
| 1414 | MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err |
| 1415 | plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so |
| 1416 | $(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 |
| 1417 | plugin_test_4.err: plugin_test_4 |
| 1418 | @touch plugin_test_4.err |
| 1419 | |
| 1420 | plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms |
| 1421 | $(TEST_AR) cr $@ $^ |
| 1422 | |
| 1423 | check_PROGRAMS += plugin_test_5 |
| 1424 | plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so |
| 1425 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms |
| 1426 | |
| 1427 | check_PROGRAMS += plugin_test_6 |
| 1428 | check_SCRIPTS += plugin_test_6.sh |
| 1429 | check_DATA += plugin_test_6.err |
| 1430 | MOSTLYCLEANFILES += plugin_test_6.err |
| 1431 | plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so |
| 1432 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err |
| 1433 | plugin_test_6.err: plugin_test_6 |
| 1434 | @touch plugin_test_6.err |
| 1435 | |
| 1436 | check_PROGRAMS += plugin_test_7 |
| 1437 | check_SCRIPTS += plugin_test_7.sh |
| 1438 | check_DATA += plugin_test_7.err plugin_test_7.syms |
| 1439 | MOSTLYCLEANFILES += plugin_test_7.err |
| 1440 | plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so |
| 1441 | $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.syms plugin_test_7_2.o 2>plugin_test_7.err |
| 1442 | plugin_test_7.syms: plugin_test_7 |
| 1443 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1444 | plugin_test_7_1.o: plugin_test_7_1.c |
| 1445 | $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< |
| 1446 | plugin_test_7_1_orig.o: plugin_test_7_1.c |
| 1447 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< |
| 1448 | plugin_test_7_1.syms: plugin_test_7_1_orig.o |
| 1449 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1450 | plugin_test_7_2.o: plugin_test_7_2.c |
| 1451 | $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< |
| 1452 | plugin_test_7.err: plugin_test_7 |
| 1453 | |
| 1454 | # Test plugins with -r. |
| 1455 | check_PROGRAMS += plugin_test_8 |
| 1456 | plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so |
| 1457 | ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o |
| 1458 | plugin_test_8: plugin_test_8.o gcctestdir/ld |
| 1459 | $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o |
| 1460 | |
| 1461 | # Test that symbols known in the IR file but not in the replacement file |
| 1462 | # produce an unresolved symbol error. |
| 1463 | check_DATA += plugin_test_9.err |
| 1464 | MOSTLYCLEANFILES += plugin_test_9.err |
| 1465 | plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so |
| 1466 | @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms "2>$@" |
| 1467 | @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms 2>$@; then \ |
| 1468 | echo 1>&2 "Link of plugin_test_9 should have failed"; \ |
| 1469 | rm -f $@; \ |
| 1470 | exit 1; \ |
| 1471 | fi |
| 1472 | # Make a .syms file that claims to define the symbol _Z4t16av. |
| 1473 | two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o |
| 1474 | cp two_file_test_1.syms $@.tmp |
| 1475 | grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp |
| 1476 | mv -f $@.tmp $@ |
| 1477 | # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. |
| 1478 | MOSTLYCLEANFILES += two_file_test_1c.o |
| 1479 | two_file_test_1c.o: two_file_test_1.o |
| 1480 | cp two_file_test_1.o $@ |
| 1481 | |
| 1482 | plugin_test.so: plugin_test.o |
| 1483 | $(LINK) -Bgcctestdir/ -shared plugin_test.o |
| 1484 | plugin_test.o: plugin_test.c |
| 1485 | $(COMPILE) -O0 -c -fpic -o $@ $< |
| 1486 | |
| 1487 | two_file_test_main.syms: two_file_test_main.o |
| 1488 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1489 | two_file_test_1.syms: two_file_test_1.o |
| 1490 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1491 | two_file_test_1b.syms: two_file_test_1b.o |
| 1492 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1493 | two_file_test_2.syms: two_file_test_2.o |
| 1494 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1495 | plugin_common_test_1.syms: plugin_common_test_1.o |
| 1496 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1497 | plugin_common_test_2.syms: plugin_common_test_2.o |
| 1498 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1499 | |
| 1500 | empty.syms: |
| 1501 | @echo "" >$@ |
| 1502 | @echo "Symbol table" >>$@ |
| 1503 | |
| 1504 | MOSTLYCLEANFILES += unused.c |
| 1505 | unused.syms: unused.o |
| 1506 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1507 | @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ |
| 1508 | unused.o: unused.c |
| 1509 | $(COMPILE) -c -o $@ $< |
| 1510 | unused.c: |
| 1511 | @cp /dev/null $@ |
| 1512 | |
| 1513 | check_SCRIPTS += plugin_final_layout.sh |
| 1514 | check_DATA += plugin_final_layout.stdout |
| 1515 | plugin_final_layout.o: plugin_final_layout.cc |
| 1516 | $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< |
| 1517 | plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld |
| 1518 | $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o |
| 1519 | plugin_final_layout.stdout: plugin_final_layout |
| 1520 | $(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout |
| 1521 | |
| 1522 | plugin_section_order.so: plugin_section_order.o |
| 1523 | $(LINK) -Bgcctestdir/ -shared plugin_section_order.o |
| 1524 | plugin_section_order.o: plugin_section_order.c |
| 1525 | $(COMPILE) -O0 -c -fpic -o $@ $< |
| 1526 | |
| 1527 | endif PLUGINS |
| 1528 | |
| 1529 | check_PROGRAMS += exclude_libs_test |
| 1530 | check_SCRIPTS += exclude_libs_test.sh |
| 1531 | check_DATA += exclude_libs_test.syms |
| 1532 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ |
| 1533 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
| 1534 | exclude_libs_test_SOURCES = exclude_libs_test.c |
| 1535 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ |
| 1536 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
| 1537 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ |
| 1538 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ |
| 1539 | -Wl,--exclude-libs,libexclude_libs_test_3 |
| 1540 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ |
| 1541 | alt/libexclude_libs_test_3.a |
| 1542 | exclude_libs_test.syms: exclude_libs_test |
| 1543 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1544 | libexclude_libs_test_1.a: exclude_libs_test_1.o |
| 1545 | $(TEST_AR) rc $@ $^ |
| 1546 | libexclude_libs_test_2.a: exclude_libs_test_2.o |
| 1547 | $(TEST_AR) rc $@ $^ |
| 1548 | alt/libexclude_libs_test_3.a: exclude_libs_test_3.o |
| 1549 | test -d alt || mkdir -p alt |
| 1550 | $(TEST_AR) rc $@ $^ |
| 1551 | |
| 1552 | check_PROGRAMS += local_labels_test |
| 1553 | local_labels_test.o: ver_test_6.c |
| 1554 | $(COMPILE) -g -c -Wa,-L -o $@ $< |
| 1555 | local_labels_test: local_labels_test.o |
| 1556 | $(LINK) -Bgcctestdir/ local_labels_test.o |
| 1557 | |
| 1558 | check_PROGRAMS += discard_locals_test |
| 1559 | check_SCRIPTS += discard_locals_test.sh |
| 1560 | check_DATA += discard_locals_test.syms \ |
| 1561 | discard_locals_relocatable_test1.syms \ |
| 1562 | discard_locals_relocatable_test2.syms |
| 1563 | MOSTLYCLEANFILES += discard_locals_test.syms \ |
| 1564 | discard_locals_relocatable_test1.syms \ |
| 1565 | discard_locals_relocatable_test2.syms \ |
| 1566 | discard_locals_relocatable_test1.out \ |
| 1567 | discard_locals_relocatable_test2.out |
| 1568 | discard_locals_test_SOURCES = discard_locals_test.c |
| 1569 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals |
| 1570 | discard_locals_test.syms: discard_locals_test |
| 1571 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1572 | # '-Wa,-L' is required to preserve the local label used for testing. |
| 1573 | discard_locals_test.o: discard_locals_test.c |
| 1574 | $(COMPILE) -c -Wa,-L -o $@ $< |
| 1575 | |
| 1576 | discard_locals_relocatable_test1.syms: discard_locals_relocatable_test1.out |
| 1577 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1578 | discard_locals_relocatable_test.o: discard_locals_relocatable_test.c |
| 1579 | $(COMPILE) -c -Wa,-L -fPIC -o $@ $< |
| 1580 | discard_locals_relocatable_test1.out: discard_locals_relocatable_test.o ../ld-new |
| 1581 | ../ld-new --discard-locals -relocatable -o $@ $< |
| 1582 | |
| 1583 | discard_locals_relocatable_test2.syms: discard_locals_relocatable_test2.out |
| 1584 | $(TEST_READELF) -sW $< >$@ 2>/dev/null |
| 1585 | discard_locals_relocatable_test2.out: discard_locals_relocatable_test.o ../ld-new |
| 1586 | ../ld-new --discard-all -relocatable -o $@ $< |
| 1587 | |
| 1588 | if MCMODEL_MEDIUM |
| 1589 | check_PROGRAMS += large |
| 1590 | large_SOURCES = large.c |
| 1591 | large_CFLAGS = -mcmodel=medium |
| 1592 | large_DEPENDENCIES = gcctestdir/ld |
| 1593 | large_LDFLAGS = -Bgcctestdir/ |
| 1594 | large_LDADD = |
| 1595 | endif MCMODEL_MEDIUM |
| 1596 | |
| 1597 | # Test that hidden and internal symbols in the main program cannot be |
| 1598 | # referenced by a shared library. |
| 1599 | check_SCRIPTS += hidden_test.sh |
| 1600 | check_DATA += hidden_test.err |
| 1601 | MOSTLYCLEANFILES += hidden_test hidden_test.err |
| 1602 | libhidden.so: hidden_test_1.c gcctestdir/ld |
| 1603 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c |
| 1604 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld |
| 1605 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err |
| 1606 | hidden_test.err: hidden_test |
| 1607 | @touch hidden_test.err |
| 1608 | |
| 1609 | # Test -retain-symbols-file. |
| 1610 | check_SCRIPTS += retain_symbols_file_test.sh |
| 1611 | check_DATA += retain_symbols_file_test.stdout |
| 1612 | MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \ |
| 1613 | retain_symbols_file_test.stdout |
| 1614 | retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld |
| 1615 | echo 'main' > retain_symbols_file_test.in |
| 1616 | echo 't1' >> retain_symbols_file_test.in |
| 1617 | echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in |
| 1618 | echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in |
| 1619 | echo '_Z3t18v' >> retain_symbols_file_test.in |
| 1620 | echo '__tcf_0' >> retain_symbols_file_test.in |
| 1621 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o |
| 1622 | retain_symbols_file_test.stdout: retain_symbols_file_test.so |
| 1623 | $(TEST_NM) -C retain_symbols_file_test.so > $@ |
| 1624 | |
| 1625 | |
| 1626 | # Test that if the output file already exists and is empty, |
| 1627 | # it will get execute permission. |
| 1628 | check_PROGRAMS += permission_test |
| 1629 | permission_test: basic_test.o gcctestdir/ld |
| 1630 | umask 022; \ |
| 1631 | rm -f $@; \ |
| 1632 | touch $@; \ |
| 1633 | chmod 600 $@; \ |
| 1634 | $(CXXLINK) -Bgcctestdir/ basic_test.o |
| 1635 | |
| 1636 | # Check -l:foo.a |
| 1637 | check_PROGRAMS += searched_file_test |
| 1638 | MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \ |
| 1639 | alt/searched_file_test_lib.a |
| 1640 | searched_file_test_SOURCES = searched_file_test.cc |
| 1641 | searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a |
| 1642 | searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt |
| 1643 | searched_file_test_LDADD = -l:searched_file_test_lib.a |
| 1644 | searched_file_test_lib.o: searched_file_test_lib.cc |
| 1645 | $(CXXCOMPILE) -c -o $@ $< |
| 1646 | alt/searched_file_test_lib.a: searched_file_test_lib.o |
| 1647 | test -d alt || mkdir -p alt |
| 1648 | $(TEST_AR) rc $@ $^ |
| 1649 | |
| 1650 | # Test that no .gnu.version sections are created when |
| 1651 | # symbol versioning is not used. |
| 1652 | check_SCRIPTS += no_version_test.sh |
| 1653 | check_DATA += no_version_test.stdout |
| 1654 | MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout |
| 1655 | # We invoke the linker directly since gcc may include additional objects that |
| 1656 | # uses symbol versioning. |
| 1657 | libno_version_test.so: no_version_test.o gcctestdir/ld |
| 1658 | gcctestdir/ld -shared -o $@ no_version_test.o |
| 1659 | no_version_test.o: no_version_test.c |
| 1660 | $(COMPILE) -o $@ -c -fPIC $< |
| 1661 | no_version_test.stdout: libno_version_test.so |
| 1662 | $(TEST_OBJDUMP) -h $< > $@ |
| 1663 | |
| 1664 | # Test STT_GNU_IFUNC symbols. |
| 1665 | if IFUNC |
| 1666 | |
| 1667 | ifuncmod1.o: ifuncmod1.c |
| 1668 | $(COMPILE) -c -fpic -o $@ $< |
| 1669 | ifuncmod1.so: ifuncmod1.o gcctestdir/ld |
| 1670 | $(LINK) -Bgcctestdir/ -shared ifuncmod1.o |
| 1671 | |
| 1672 | ifuncdep1.o: ifuncmod1.c |
| 1673 | $(COMPILE) -c -o $@ $< |
| 1674 | |
| 1675 | ifuncmain1pic.o: ifuncmain1.c |
| 1676 | $(COMPILE) -c -fpic -o $@ $< |
| 1677 | ifuncmain1pie.o: ifuncmain1.c |
| 1678 | $(COMPILE) -c -fpie -o $@ $< |
| 1679 | |
| 1680 | if HAVE_STATIC |
| 1681 | if IFUNC_STATIC |
| 1682 | check_PROGRAMS += ifuncmain1static |
| 1683 | ifuncmain1static_SOURCES = ifuncmain1.c |
| 1684 | ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o |
| 1685 | ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static |
| 1686 | ifuncmain1static_LDADD = ifuncdep1.o |
| 1687 | |
| 1688 | check_PROGRAMS += ifuncmain1picstatic |
| 1689 | ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld |
| 1690 | $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o |
| 1691 | endif |
| 1692 | endif |
| 1693 | |
| 1694 | check_PROGRAMS += ifuncmain1 |
| 1695 | ifuncmain1_SOURCES = ifuncmain1.c |
| 1696 | ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so |
| 1697 | ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1698 | ifuncmain1_LDADD = ifuncmod1.so |
| 1699 | |
| 1700 | check_PROGRAMS += ifuncmain1pic |
| 1701 | ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld |
| 1702 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. |
| 1703 | |
| 1704 | check_PROGRAMS += ifuncmain1vis |
| 1705 | ifuncmain1vis_SOURCES = ifuncmain1vis.c |
| 1706 | ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so |
| 1707 | ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1708 | ifuncmain1vis_LDADD = ifuncmod1.so |
| 1709 | |
| 1710 | check_PROGRAMS += ifuncmain1vispic |
| 1711 | ifuncmain1vispic.o: ifuncmain1vis.c |
| 1712 | $(COMPILE) -c -fpic -o $@ $< |
| 1713 | ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld |
| 1714 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. |
| 1715 | |
| 1716 | check_PROGRAMS += ifuncmain1staticpic |
| 1717 | ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld |
| 1718 | $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o |
| 1719 | |
| 1720 | check_PROGRAMS += ifuncmain1pie |
| 1721 | ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld |
| 1722 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,. |
| 1723 | |
| 1724 | check_PROGRAMS += ifuncmain1vispie |
| 1725 | ifuncmain1vispie.o: ifuncmain1vis.c |
| 1726 | $(COMPILE) -c -fpie -o $@ $< |
| 1727 | ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld |
| 1728 | $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. |
| 1729 | |
| 1730 | check_PROGRAMS += ifuncmain1staticpie |
| 1731 | ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld |
| 1732 | $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o |
| 1733 | |
| 1734 | ifuncmain2pic.o: ifuncmain2.c |
| 1735 | $(COMPILE) -c -fpic -o $@ $< |
| 1736 | |
| 1737 | ifuncdep2pic.o: ifuncdep2.c |
| 1738 | $(COMPILE) -c -fpic -o $@ $< |
| 1739 | |
| 1740 | if HAVE_STATIC |
| 1741 | if IFUNC_STATIC |
| 1742 | check_PROGRAMS += ifuncmain2static |
| 1743 | ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c |
| 1744 | ifuncmain2static_DEPENDENCIES = gcctestdir/ld |
| 1745 | ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static |
| 1746 | ifuncmain2static_LDADD = |
| 1747 | |
| 1748 | check_PROGRAMS += ifuncmain2picstatic |
| 1749 | ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld |
| 1750 | $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o |
| 1751 | endif |
| 1752 | endif |
| 1753 | |
| 1754 | check_PROGRAMS += ifuncmain2 |
| 1755 | ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c |
| 1756 | ifuncmain2_DEPENDENCIES = gcctestdir/ld |
| 1757 | ifuncmain2_LDFLAGS = -Bgcctestdir/ |
| 1758 | ifuncmain2_LDADD = |
| 1759 | |
| 1760 | check_PROGRAMS += ifuncmain2pic |
| 1761 | ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld |
| 1762 | $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o |
| 1763 | |
| 1764 | ifuncmod3.o: ifuncmod3.c |
| 1765 | $(COMPILE) -c -fpic -o $@ $< |
| 1766 | ifuncmod3.so: ifuncmod3.o gcctestdir/ld |
| 1767 | $(LINK) -Bgcctestdir/ -shared ifuncmod3.o |
| 1768 | |
| 1769 | check_PROGRAMS += ifuncmain3 |
| 1770 | ifuncmain3_SOURCES = ifuncmain3.c |
| 1771 | ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so |
| 1772 | ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,. |
| 1773 | ifuncmain3_LDADD = -ldl |
| 1774 | |
| 1775 | ifuncmain4pic.o: ifuncmain4.c |
| 1776 | $(COMPILE) -c -fpic -o $@ $< |
| 1777 | |
| 1778 | if HAVE_STATIC |
| 1779 | if IFUNC_STATIC |
| 1780 | check_PROGRAMS += ifuncmain4static |
| 1781 | ifuncmain4static_SOURCES = ifuncmain4.c |
| 1782 | ifuncmain4static_DEPENDENCIES = gcctestdir/ld |
| 1783 | ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static |
| 1784 | ifuncmain4static_LDADD = |
| 1785 | |
| 1786 | check_PROGRAMS += ifuncmain4picstatic |
| 1787 | ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld |
| 1788 | $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o |
| 1789 | endif |
| 1790 | endif |
| 1791 | |
| 1792 | check_PROGRAMS += ifuncmain4 |
| 1793 | ifuncmain4_SOURCES = ifuncmain4.c |
| 1794 | ifuncmain4_DEPENDENCIES = gcctestdir/ld |
| 1795 | ifuncmain4_LDFLAGS = -Bgcctestdir/ |
| 1796 | ifuncmain4_LDADD = |
| 1797 | |
| 1798 | ifuncmain5pic.o: ifuncmain5.c |
| 1799 | $(COMPILE) -c -fpic -o $@ $< |
| 1800 | |
| 1801 | ifuncmain5pie.o: ifuncmain5.c |
| 1802 | $(COMPILE) -c -fpie -o $@ $< |
| 1803 | |
| 1804 | ifuncmod5.o: ifuncmod5.c |
| 1805 | $(COMPILE) -c -fpic -o $@ $< |
| 1806 | ifuncmod5.so: ifuncmod5.o gcctestdir/ld |
| 1807 | $(LINK) -Bgcctestdir/ -shared ifuncmod5.o |
| 1808 | |
| 1809 | ifuncdep5.o: ifuncmod5.c |
| 1810 | $(COMPILE) -c -o $@ $< |
| 1811 | |
| 1812 | if HAVE_STATIC |
| 1813 | if IFUNC_STATIC |
| 1814 | check_PROGRAMS += ifuncmain5static |
| 1815 | ifuncmain5static_SOURCES = ifuncmain5.c |
| 1816 | ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o |
| 1817 | ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static |
| 1818 | ifuncmain5static_LDADD = ifuncdep5.o |
| 1819 | |
| 1820 | check_PROGRAMS += ifuncmain5picstatic |
| 1821 | ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld |
| 1822 | $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o |
| 1823 | endif |
| 1824 | endif |
| 1825 | |
| 1826 | check_PROGRAMS += ifuncmain5 |
| 1827 | ifuncmain5_SOURCES = ifuncmain5.c |
| 1828 | ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so |
| 1829 | ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1830 | ifuncmain5_LDADD = ifuncmod5.so |
| 1831 | |
| 1832 | check_PROGRAMS += ifuncmain5pic |
| 1833 | ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld |
| 1834 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,. |
| 1835 | |
| 1836 | check_PROGRAMS += ifuncmain5staticpic |
| 1837 | ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld |
| 1838 | $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o |
| 1839 | |
| 1840 | check_PROGRAMS += ifuncmain5pie |
| 1841 | ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld |
| 1842 | $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. |
| 1843 | |
| 1844 | ifuncmain6pie.o: ifuncmain6pie.c |
| 1845 | $(COMPILE) -c -fpie -o $@ $< |
| 1846 | |
| 1847 | ifuncmod6.o: ifuncmod6.c |
| 1848 | $(COMPILE) -c -fpic -o $@ $< |
| 1849 | ifuncmod6.so: ifuncmod6.o gcctestdir/ld |
| 1850 | $(LINK) -Bgcctestdir/ -shared ifuncmod6.o |
| 1851 | |
| 1852 | check_PROGRAMS += ifuncmain6pie |
| 1853 | ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld |
| 1854 | $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. |
| 1855 | |
| 1856 | ifuncmain7pic.o: ifuncmain7.c |
| 1857 | $(COMPILE) -c -fpic -o $@ $< |
| 1858 | |
| 1859 | ifuncmain7pie.o: ifuncmain7.c |
| 1860 | $(COMPILE) -c -fpie -o $@ $< |
| 1861 | |
| 1862 | if HAVE_STATIC |
| 1863 | if IFUNC_STATIC |
| 1864 | check_PROGRAMS += ifuncmain7static |
| 1865 | ifuncmain7static_SOURCES = ifuncmain7.c |
| 1866 | ifuncmain7static_DEPENDENCIES = gcctestdir/ld |
| 1867 | ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static |
| 1868 | ifuncmain7static_LDADD = |
| 1869 | |
| 1870 | check_PROGRAMS += ifuncmain7picstatic |
| 1871 | ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld |
| 1872 | $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o |
| 1873 | endif |
| 1874 | endif |
| 1875 | |
| 1876 | check_PROGRAMS += ifuncmain7 |
| 1877 | ifuncmain7_SOURCES = ifuncmain7.c |
| 1878 | ifuncmain7_DEPENDENCIES = gcctestdir/ld |
| 1879 | ifuncmain7_LDFLAGS = -Bgcctestdir/ |
| 1880 | ifuncmain7_LDADD = |
| 1881 | |
| 1882 | check_PROGRAMS += ifuncmain7pic |
| 1883 | ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld |
| 1884 | $(LINK) -Bgcctestdir/ ifuncmain7pic.o |
| 1885 | |
| 1886 | check_PROGRAMS += ifuncmain7pie |
| 1887 | ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld |
| 1888 | $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o |
| 1889 | |
| 1890 | check_PROGRAMS += ifuncvar |
| 1891 | ifuncvar1_pic.o: ifuncvar1.c |
| 1892 | $(COMPILE) -c -fpic -o $@ $< |
| 1893 | ifuncvar2_pic.o: ifuncvar2.c |
| 1894 | $(COMPILE) -c -fpic -o $@ $< |
| 1895 | ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld |
| 1896 | $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o |
| 1897 | ifuncvar_SOURCES = ifuncvar3.c |
| 1898 | ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so |
| 1899 | ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
| 1900 | ifuncvar_LDADD = ifuncvar.so |
| 1901 | |
| 1902 | endif IFUNC |
| 1903 | |
| 1904 | # Test that strong reference to a weak symbol in a DSO remains strong. |
| 1905 | check_SCRIPTS += strong_ref_weak_def.sh |
| 1906 | check_DATA += strong_ref_weak_def.stdout |
| 1907 | MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \ |
| 1908 | strong_ref_weak_def.stdout |
| 1909 | strong_ref_weak_def_2.o: strong_ref_weak_def_2.c |
| 1910 | $(COMPILE) -o $@ -c -fPIC $< |
| 1911 | strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld |
| 1912 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o |
| 1913 | strong_ref_weak_def_1.o: strong_ref_weak_def_1.c |
| 1914 | $(COMPILE) -o $@ -c -fPIC $< |
| 1915 | strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \ |
| 1916 | gcctestdir/ld |
| 1917 | gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \ |
| 1918 | strong_ref_weak_def_2.so |
| 1919 | strong_ref_weak_def.stdout: strong_ref_weak_def_1.so |
| 1920 | $(TEST_READELF) -sWD $< > $@ |
| 1921 | |
| 1922 | # Test that a strong weak reference remains strong if there is another |
| 1923 | # weak reference in a DSO. |
| 1924 | check_SCRIPTS += dyn_weak_ref.sh |
| 1925 | check_DATA += dyn_weak_ref.stdout |
| 1926 | MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \ |
| 1927 | dyn_weak_ref.stdout |
| 1928 | dyn_weak_ref_2.o: dyn_weak_ref_2.c |
| 1929 | $(COMPILE) -o $@ -c -fPIC $< |
| 1930 | dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld |
| 1931 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o |
| 1932 | dyn_weak_ref_1.o: dyn_weak_ref_1.c |
| 1933 | $(COMPILE) -o $@ -c -fPIC $< |
| 1934 | # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o |
| 1935 | # so that the weak ref there goes to gold's symbol table first. |
| 1936 | dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld |
| 1937 | gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o |
| 1938 | dyn_weak_ref.stdout: dyn_weak_ref_1.so |
| 1939 | $(TEST_READELF) -sWD $< > $@ |
| 1940 | |
| 1941 | |
| 1942 | # Test that --start-lib and --end-lib function correctly. |
| 1943 | check_PROGRAMS += start_lib_test |
| 1944 | start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \ |
| 1945 | gcctestdir/ld |
| 1946 | $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \ |
| 1947 | -Wl,--start-lib start_lib_test_2.o start_lib_test_3.o -Wl,--end-lib |
| 1948 | libstart_lib_test.a: start_lib_test_1.o |
| 1949 | $(TEST_AR) rc $@ $^ |
| 1950 | |
| 1951 | # Test that MEMORY region support works. |
| 1952 | check_SCRIPTS += memory_test.sh |
| 1953 | check_DATA += memory_test.stdout |
| 1954 | MOSTLYCLEANFILES += memory_test.stdout memory_test memory_test.o |
| 1955 | memory_test.o: memory_test.s |
| 1956 | $(COMPILE) -o $@ -c $< |
| 1957 | memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t |
| 1958 | $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o |
| 1959 | memory_test.stdout: memory_test |
| 1960 | $(TEST_READELF) -lWS $< > $@ |
| 1961 | |
| 1962 | # End-to-end incremental linking tests. |
| 1963 | # Incremental linking is currently supported only on the x86_64 target. |
| 1964 | |
| 1965 | if DEFAULT_TARGET_X86_64 |
| 1966 | |
| 1967 | two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc |
| 1968 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< |
| 1969 | two_file_test_1_ndebug.o: two_file_test_1.cc |
| 1970 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< |
| 1971 | two_file_test_1b_ndebug.o: two_file_test_1b.cc |
| 1972 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< |
| 1973 | two_file_test_2_ndebug.o: two_file_test_2.cc |
| 1974 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< |
| 1975 | two_file_test_main_ndebug.o: two_file_test_main.cc |
| 1976 | $(CXXCOMPILE) -O0 -g0 -c -o $@ $< |
| 1977 | |
| 1978 | check_PROGRAMS += incremental_test_2 |
| 1979 | MOSTLYCLEANFILES += two_file_test_tmp_2.o |
| 1980 | incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \ |
| 1981 | two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld |
| 1982 | cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o |
| 1983 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -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 |
| 1984 | @sleep 1 |
| 1985 | cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o |
| 1986 | $(CXXLINK) -Wl,--incremental-update -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 |
| 1987 | |
| 1988 | check_PROGRAMS += incremental_test_3 |
| 1989 | MOSTLYCLEANFILES += two_file_test_tmp_3.o |
| 1990 | incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ |
| 1991 | two_file_test_2.o two_file_test_main.o gcctestdir/ld |
| 1992 | cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o |
| 1993 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o |
| 1994 | @sleep 1 |
| 1995 | cp -f two_file_test_1b.o two_file_test_tmp_3.o |
| 1996 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o |
| 1997 | |
| 1998 | check_PROGRAMS += incremental_test_4 |
| 1999 | MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o |
| 2000 | incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ |
| 2001 | two_file_test_2.o two_file_test_main.o gcctestdir/ld |
| 2002 | cp -f two_file_test_2_v1.o two_file_test_tmp_4.o |
| 2003 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o |
| 2004 | mv -f incremental_test_4 incremental_test_4.base |
| 2005 | @sleep 1 |
| 2006 | cp -f two_file_test_2.o two_file_test_tmp_4.o |
| 2007 | $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o |
| 2008 | |
| 2009 | check_PROGRAMS += incremental_test_5 |
| 2010 | MOSTLYCLEANFILES += two_file_test_5.a |
| 2011 | incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ |
| 2012 | two_file_test_2.o two_file_test_main.o gcctestdir/ld |
| 2013 | cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o |
| 2014 | $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o |
| 2015 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a |
| 2016 | @sleep 1 |
| 2017 | cp -f two_file_test_1b.o two_file_test_tmp_5.o |
| 2018 | $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o |
| 2019 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o two_file_test_5.a |
| 2020 | |
| 2021 | # Test the --incremental-unchanged flag with an archive library. |
| 2022 | # The second link should not update the library. |
| 2023 | check_PROGRAMS += incremental_test_6 |
| 2024 | MOSTLYCLEANFILES += two_file_test_6.a |
| 2025 | incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ |
| 2026 | two_file_test_2.o two_file_test_main.o gcctestdir/ld |
| 2027 | cp -f two_file_test_1b.o two_file_test_tmp_6.o |
| 2028 | $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o |
| 2029 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a |
| 2030 | @sleep 1 |
| 2031 | cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o |
| 2032 | $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o |
| 2033 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown |
| 2034 | |
| 2035 | check_PROGRAMS += incremental_copy_test |
| 2036 | incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so |
| 2037 | cp -f copy_test_v1.o copy_test_tmp.o |
| 2038 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so |
| 2039 | @sleep 1 |
| 2040 | cp -f copy_test.o copy_test_tmp.o |
| 2041 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so |
| 2042 | |
| 2043 | check_PROGRAMS += incremental_common_test_1 |
| 2044 | incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld |
| 2045 | cp -f common_test_1_v1.o common_test_1_tmp.o |
| 2046 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o |
| 2047 | @sleep 1 |
| 2048 | cp -f common_test_1_v2.o common_test_1_tmp.o |
| 2049 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o |
| 2050 | |
| 2051 | check_PROGRAMS += incremental_comdat_test_1 |
| 2052 | 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 |
| 2053 | cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o |
| 2054 | $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o |
| 2055 | @sleep 1 |
| 2056 | cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o |
| 2057 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o |
| 2058 | @sleep 1 |
| 2059 | cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o |
| 2060 | $(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o |
| 2061 | |
| 2062 | endif DEFAULT_TARGET_X86_64 |
| 2063 | |
| 2064 | endif GCC |
| 2065 | endif NATIVE_LINKER |
| 2066 | |
| 2067 | # These tests work with native and cross linkers. |
| 2068 | |
| 2069 | if NATIVE_OR_CROSS_LINKER |
| 2070 | |
| 2071 | # Test script section order. |
| 2072 | check_SCRIPTS += script_test_10.sh |
| 2073 | check_DATA += script_test_10.stdout |
| 2074 | script_test_10.o: script_test_10.s |
| 2075 | $(TEST_AS) -o $@ $< |
| 2076 | script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld |
| 2077 | gcctestdir/ld -o $@ script_test_10.o -T $(srcdir)/script_test_10.t |
| 2078 | script_test_10.stdout: script_test_10 |
| 2079 | $(TEST_READELF) -SW script_test_10 > $@ |
| 2080 | |
| 2081 | # These tests work with cross linkers only. |
| 2082 | |
| 2083 | if DEFAULT_TARGET_I386 |
| 2084 | |
| 2085 | check_SCRIPTS += split_i386.sh |
| 2086 | check_DATA += split_i386_1.stdout split_i386_2.stdout \ |
| 2087 | split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout |
| 2088 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 |
| 2089 | split_i386_1.o: split_i386_1.s |
| 2090 | $(TEST_AS) -o $@ $< |
| 2091 | split_i386_2.o: split_i386_2.s |
| 2092 | $(TEST_AS) -o $@ $< |
| 2093 | split_i386_3.o: split_i386_3.s |
| 2094 | $(TEST_AS) -o $@ $< |
| 2095 | split_i386_4.o: split_i386_4.s |
| 2096 | $(TEST_AS) -o $@ $< |
| 2097 | split_i386_n.o: split_i386_n.s |
| 2098 | $(TEST_AS) -o $@ $< |
| 2099 | split_i386_1: split_i386_1.o split_i386_n.o ../ld-new |
| 2100 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_1.o split_i386_n.o |
| 2101 | split_i386_1.stdout: split_i386_1 |
| 2102 | $(TEST_OBJDUMP) -d $< > $@ |
| 2103 | split_i386_2: split_i386_2.o split_i386_n.o ../ld-new |
| 2104 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_2.o split_i386_n.o |
| 2105 | split_i386_2.stdout: split_i386_2 |
| 2106 | $(TEST_OBJDUMP) -d $< > $@ |
| 2107 | split_i386_3.stdout: split_i386_3.o split_i386_n.o ../ld-new |
| 2108 | ../ld-new $(SPLIT_DEFSYMS) -o split_i386_3 split_i386_3.o split_i386_n.o > $@ 2>&1 || exit 0 |
| 2109 | split_i386_4: split_i386_4.o split_i386_n.o ../ld-new |
| 2110 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_i386_4.o split_i386_n.o |
| 2111 | split_i386_4.stdout: split_i386_4 |
| 2112 | $(TEST_OBJDUMP) -d $< > $@ |
| 2113 | split_i386_r.stdout: split_i386_1.o split_i386_n.o ../ld-new |
| 2114 | ../ld-new -r split_i386_1.o split_i386_n.o -o split_i386_r > $@ 2>&1 || exit 0 |
| 2115 | MOSTLYCLEANFILES += split_i386_1 split_i386_2 split_i386_3 \ |
| 2116 | split_i386_4 split_i386_r |
| 2117 | |
| 2118 | endif DEFAULT_TARGET_I386 |
| 2119 | |
| 2120 | if DEFAULT_TARGET_X86_64 |
| 2121 | |
| 2122 | check_SCRIPTS += split_x86_64.sh |
| 2123 | check_DATA += split_x86_64_1.stdout split_x86_64_2.stdout \ |
| 2124 | split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout |
| 2125 | SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 |
| 2126 | split_x86_64_1.o: split_x86_64_1.s |
| 2127 | $(TEST_AS) -o $@ $< |
| 2128 | split_x86_64_2.o: split_x86_64_2.s |
| 2129 | $(TEST_AS) -o $@ $< |
| 2130 | split_x86_64_3.o: split_x86_64_3.s |
| 2131 | $(TEST_AS) -o $@ $< |
| 2132 | split_x86_64_4.o: split_x86_64_4.s |
| 2133 | $(TEST_AS) -o $@ $< |
| 2134 | split_x86_64_n.o: split_x86_64_n.s |
| 2135 | $(TEST_AS) -o $@ $< |
| 2136 | split_x86_64_1: split_x86_64_1.o split_x86_64_n.o ../ld-new |
| 2137 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_1.o split_x86_64_n.o |
| 2138 | split_x86_64_1.stdout: split_x86_64_1 |
| 2139 | $(TEST_OBJDUMP) -d $< > $@ |
| 2140 | split_x86_64_2: split_x86_64_2.o split_x86_64_n.o ../ld-new |
| 2141 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_2.o split_x86_64_n.o |
| 2142 | split_x86_64_2.stdout: split_x86_64_2 |
| 2143 | $(TEST_OBJDUMP) -d $< > $@ |
| 2144 | split_x86_64_3.stdout: split_x86_64_3.o split_x86_64_n.o ../ld-new |
| 2145 | ../ld-new $(SPLIT_DEFSYMS) -o split_x86_64_3 split_x86_64_3.o split_x86_64_n.o > $@ 2>&1 || exit 0 |
| 2146 | split_x86_64_4: split_x86_64_4.o split_x86_64_n.o ../ld-new |
| 2147 | ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x86_64_4.o split_x86_64_n.o |
| 2148 | split_x86_64_4.stdout: split_x86_64_4 |
| 2149 | $(TEST_OBJDUMP) -d $< > $@ |
| 2150 | split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new |
| 2151 | ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 |
| 2152 | MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ |
| 2153 | split_x86_64_4 split_x86_64_r |
| 2154 | |
| 2155 | endif DEFAULT_TARGET_X86_64 |
| 2156 | |
| 2157 | if DEFAULT_TARGET_ARM |
| 2158 | |
| 2159 | check_SCRIPTS += arm_abs_global.sh |
| 2160 | check_DATA += arm_abs_global.stdout |
| 2161 | arm_abs_lib.o: arm_abs_lib.s |
| 2162 | $(TEST_AS) -march=armv7-a -o $@ $< |
| 2163 | libarm_abs.so: arm_abs_lib.o ../ld-new |
| 2164 | ../ld-new -shared -o $@ arm_abs_lib.o |
| 2165 | arm_abs_global.o: arm_abs_global.s |
| 2166 | $(TEST_AS) -march=armv7-a -o $@ $< |
| 2167 | arm_abs_global: arm_abs_global.o libarm_abs.so ../ld-new |
| 2168 | ../ld-new -o $@ arm_abs_global.o -L. -larm_abs |
| 2169 | arm_abs_global.stdout: arm_abs_global |
| 2170 | $(TEST_READELF) -r $< > $@ |
| 2171 | |
| 2172 | MOSTLYCLEANFILES += arm_abs_global |
| 2173 | |
| 2174 | check_SCRIPTS += arm_branch_in_range.sh arm_branch_out_of_range.sh |
| 2175 | check_DATA += arm_bl_in_range.stdout arm_bl_out_of_range.stdout \ |
| 2176 | thumb_bl_in_range.stdout thumb_bl_out_of_range.stdout \ |
| 2177 | thumb2_bl_in_range.stdout thumb2_bl_out_of_range.stdout \ |
| 2178 | thumb_blx_in_range.stdout thumb_blx_out_of_range.stdout \ |
| 2179 | thumb2_blx_in_range.stdout thumb2_blx_out_of_range.stdout \ |
| 2180 | thumb_bl_out_of_range_local.stdout arm_thm_jump11.stdout \ |
| 2181 | arm_thm_jump8.stdout |
| 2182 | |
| 2183 | arm_bl_in_range.stdout: arm_bl_in_range |
| 2184 | $(TEST_OBJDUMP) -D $< > $@ |
| 2185 | |
| 2186 | arm_bl_in_range: arm_bl_in_range.o ../ld-new |
| 2187 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
| 2188 | |
| 2189 | arm_bl_in_range.o: arm_bl_in_range.s |
| 2190 | $(TEST_AS) -o $@ $< |
| 2191 | |
| 2192 | arm_bl_out_of_range.stdout: arm_bl_out_of_range |
| 2193 | $(TEST_OBJDUMP) -S $< > $@ |
| 2194 | |
| 2195 | arm_bl_out_of_range: arm_bl_out_of_range.o ../ld-new |
| 2196 | ../ld-new -T $(srcdir)/arm_branch_range.t -o $@ $< |
| 2197 | |
| 2198 | arm_bl_out_of_range.o: arm_bl_out_of_range.s |
| 2199 | $(TEST_AS) -o $@ $< |
| 2200 | |
| 2201 | thumb_bl_in_range.stdout: thumb_bl_in_range |
| 2202 | $(TEST_OBJDUMP) -D $< > $@ |
| 2203 | |
| 2204 | thumb_bl_in_range: thumb_bl_in_range.o ../ld-new |
| 2205 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
| 2206 | |
| 2207 | thumb_bl_in_range.o: thumb_bl_in_range.s |
| 2208 | $(TEST_AS) -o $@ -march=armv5te $< |
| 2209 | |
| 2210 | thumb_bl_out_of_range.stdout: thumb_bl_out_of_range |
| 2211 | $(TEST_OBJDUMP) -D $< > $@ |
| 2212 | |
| 2213 | thumb_bl_out_of_range: thumb_bl_out_of_range.o ../ld-new |
| 2214 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
| 2215 | |
| 2216 | thumb_bl_out_of_range.o: thumb_bl_out_of_range.s |
| 2217 | $(TEST_AS) -o $@ -march=armv5te $< |
| 2218 | |
| 2219 | thumb2_bl_in_range.stdout: thumb2_bl_in_range |
| 2220 | $(TEST_OBJDUMP) -D $< > $@ |
| 2221 | |
| 2222 | thumb2_bl_in_range: thumb2_bl_in_range.o ../ld-new |
| 2223 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
| 2224 | |
| 2225 | thumb2_bl_in_range.o: thumb_bl_in_range.s |
| 2226 | $(TEST_AS) -o $@ -march=armv7-a $< |
| 2227 | |
| 2228 | thumb2_bl_out_of_range.stdout: thumb2_bl_out_of_range |
| 2229 | $(TEST_OBJDUMP) -D $< > $@ |
| 2230 | |
| 2231 | thumb2_bl_out_of_range: thumb2_bl_out_of_range.o ../ld-new |
| 2232 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
| 2233 | |
| 2234 | thumb2_bl_out_of_range.o: thumb_bl_out_of_range.s |
| 2235 | $(TEST_AS) -o $@ -march=armv7-a $< |
| 2236 | |
| 2237 | thumb_blx_in_range.stdout: thumb_blx_in_range |
| 2238 | $(TEST_OBJDUMP) -D $< > $@ |
| 2239 | |
| 2240 | thumb_blx_in_range: thumb_blx_in_range.o ../ld-new |
| 2241 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
| 2242 | |
| 2243 | thumb_blx_in_range.o: thumb_blx_in_range.s |
| 2244 | $(TEST_AS) -o $@ -march=armv5te $< |
| 2245 | |
| 2246 | thumb_blx_out_of_range.stdout: thumb_blx_out_of_range |
| 2247 | $(TEST_OBJDUMP) -D $< > $@ |
| 2248 | |
| 2249 | thumb_blx_out_of_range: thumb_blx_out_of_range.o ../ld-new |
| 2250 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
| 2251 | |
| 2252 | thumb_blx_out_of_range.o: thumb_blx_out_of_range.s |
| 2253 | $(TEST_AS) -o $@ -march=armv5te $< |
| 2254 | |
| 2255 | thumb2_blx_in_range.stdout: thumb2_blx_in_range |
| 2256 | $(TEST_OBJDUMP) -D $< > $@ |
| 2257 | |
| 2258 | thumb2_blx_in_range: thumb2_blx_in_range.o ../ld-new |
| 2259 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
| 2260 | |
| 2261 | thumb2_blx_in_range.o: thumb_blx_in_range.s |
| 2262 | $(TEST_AS) -o $@ -march=armv7-a $< |
| 2263 | |
| 2264 | thumb2_blx_out_of_range.stdout: thumb2_blx_out_of_range |
| 2265 | $(TEST_OBJDUMP) -D $< > $@ |
| 2266 | |
| 2267 | thumb2_blx_out_of_range: thumb2_blx_out_of_range.o ../ld-new |
| 2268 | ../ld-new -T $(srcdir)/thumb2_branch_range.t -o $@ $< |
| 2269 | |
| 2270 | thumb2_blx_out_of_range.o: thumb_blx_out_of_range.s |
| 2271 | $(TEST_AS) -o $@ -march=armv7-a $< |
| 2272 | |
| 2273 | thumb_bl_out_of_range_local.stdout: thumb_bl_out_of_range_local |
| 2274 | $(TEST_OBJDUMP) -D $< > $@ |
| 2275 | |
| 2276 | thumb_bl_out_of_range_local: thumb_bl_out_of_range_local.o ../ld-new |
| 2277 | ../ld-new -T $(srcdir)/thumb_branch_range.t -o $@ $< |
| 2278 | |
| 2279 | thumb_bl_out_of_range_local.o: thumb_bl_out_of_range_local.s |
| 2280 | $(TEST_AS) -o $@ -march=armv5te $< |
| 2281 | |
| 2282 | arm_thm_jump11.stdout: arm_thm_jump11 |
| 2283 | $(TEST_OBJDUMP) -D $< > $@ |
| 2284 | |
| 2285 | arm_thm_jump11: arm_thm_jump11.o ../ld-new |
| 2286 | ../ld-new -T $(srcdir)/arm_thm_jump11.t -o $@ $< |
| 2287 | |
| 2288 | arm_thm_jump11.o: arm_thm_jump11.s |
| 2289 | $(TEST_AS) -o $@ $< |
| 2290 | |
| 2291 | arm_thm_jump8.stdout: arm_thm_jump8 |
| 2292 | $(TEST_OBJDUMP) -D $< > $@ |
| 2293 | |
| 2294 | arm_thm_jump8: arm_thm_jump8.o ../ld-new |
| 2295 | ../ld-new -T $(srcdir)/arm_thm_jump8.t -o $@ $< |
| 2296 | |
| 2297 | arm_thm_jump8.o: arm_thm_jump8.s |
| 2298 | $(TEST_AS) -o $@ $< |
| 2299 | |
| 2300 | MOSTLYCLEANFILES += arm_bl_in_range arm_bl_out_of_range thumb_bl_in_range \ |
| 2301 | thumb_bl_out_of_range thumb2_bl_in_range thumb2_bl_out_of_range \ |
| 2302 | thumb_blx_in_range thumb_blx_out_of_range thumb2_blx_in_range \ |
| 2303 | thumb2_blx_out_of_range thumb_bl_out_of_range_local arm_thm_jump11 \ |
| 2304 | arm_thm_jump8 |
| 2305 | |
| 2306 | check_SCRIPTS += arm_fix_v4bx.sh |
| 2307 | check_DATA += arm_fix_v4bx.stdout arm_fix_v4bx_interworking.stdout \ |
| 2308 | arm_no_fix_v4bx.stdout |
| 2309 | |
| 2310 | arm_fix_v4bx.stdout: arm_fix_v4bx |
| 2311 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2312 | |
| 2313 | arm_fix_v4bx: arm_fix_v4bx.o ../ld-new |
| 2314 | ../ld-new --fix-v4bx -o $@ $< |
| 2315 | |
| 2316 | arm_fix_v4bx.o: arm_fix_v4bx.s |
| 2317 | $(TEST_AS) -o $@ $< |
| 2318 | |
| 2319 | arm_fix_v4bx_interworking.stdout: arm_fix_v4bx_interworking |
| 2320 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2321 | |
| 2322 | arm_fix_v4bx_interworking: arm_fix_v4bx.o ../ld-new |
| 2323 | ../ld-new --fix-v4bx-interworking -o $@ $< |
| 2324 | |
| 2325 | arm_no_fix_v4bx.stdout: arm_no_fix_v4bx |
| 2326 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2327 | |
| 2328 | arm_no_fix_v4bx: arm_fix_v4bx.o ../ld-new |
| 2329 | ../ld-new -o $@ $< |
| 2330 | |
| 2331 | MOSTLYCLEANFILES += arm_fix_v4bx arm_fix_v4bx_interworking arm_no_fix_v4bx |
| 2332 | |
| 2333 | check_SCRIPTS += arm_attr_merge.sh |
| 2334 | check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \ |
| 2335 | arm_attr_merge_7.stdout |
| 2336 | |
| 2337 | arm_attr_merge_6.stdout: arm_attr_merge_6 |
| 2338 | $(TEST_READELF) -A $< > $@ |
| 2339 | |
| 2340 | arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o |
| 2341 | ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o |
| 2342 | |
| 2343 | arm_attr_merge_6a.o: arm_attr_merge_6a.s |
| 2344 | $(TEST_AS) -o $@ $< |
| 2345 | |
| 2346 | arm_attr_merge_6b.o: arm_attr_merge_6b.s |
| 2347 | $(TEST_AS) -o $@ $< |
| 2348 | |
| 2349 | arm_attr_merge_6r.stdout: arm_attr_merge_6r |
| 2350 | $(TEST_READELF) -A $< > $@ |
| 2351 | |
| 2352 | arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o |
| 2353 | ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o |
| 2354 | |
| 2355 | arm_attr_merge_7.stdout: arm_attr_merge_7 |
| 2356 | $(TEST_READELF) -A $< > $@ |
| 2357 | |
| 2358 | arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o |
| 2359 | ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o |
| 2360 | |
| 2361 | arm_attr_merge_7a.o: arm_attr_merge_7a.s |
| 2362 | $(TEST_AS) -o $@ $< |
| 2363 | |
| 2364 | arm_attr_merge_7b.o: arm_attr_merge_7b.s |
| 2365 | $(TEST_AS) -o $@ $< |
| 2366 | |
| 2367 | MOSTLYCLEANFILES += arm_attr_merge_6 arm_attr_merge_6r arm_attr_merge_7 |
| 2368 | |
| 2369 | # Cortex-A8 workaround test. |
| 2370 | |
| 2371 | check_SCRIPTS += arm_cortex_a8.sh |
| 2372 | check_DATA += arm_cortex_a8_b_cond.stdout arm_cortex_a8_b.stdout \ |
| 2373 | arm_cortex_a8_bl.stdout arm_cortex_a8_blx.stdout \ |
| 2374 | arm_cortex_a8_local.stdout arm_cortex_a8_local_reloc.stdout |
| 2375 | |
| 2376 | arm_cortex_a8_b_cond.stdout: arm_cortex_a8_b_cond |
| 2377 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2378 | |
| 2379 | arm_cortex_a8_b_cond: arm_cortex_a8_b_cond.o ../ld-new |
| 2380 | ../ld-new -o $@ $< |
| 2381 | |
| 2382 | arm_cortex_a8_b_cond.o: arm_cortex_a8_b_cond.s |
| 2383 | $(TEST_AS) -o $@ $< |
| 2384 | |
| 2385 | arm_cortex_a8_b.stdout: arm_cortex_a8_b |
| 2386 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2387 | |
| 2388 | arm_cortex_a8_b: arm_cortex_a8_b.o ../ld-new |
| 2389 | ../ld-new --fix-cortex-a8 -o $@ $< |
| 2390 | |
| 2391 | arm_cortex_a8_b.o: arm_cortex_a8_b.s |
| 2392 | $(TEST_AS) -o $@ $< |
| 2393 | |
| 2394 | arm_cortex_a8_bl.stdout: arm_cortex_a8_bl |
| 2395 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2396 | |
| 2397 | arm_cortex_a8_bl: arm_cortex_a8_bl.o ../ld-new |
| 2398 | ../ld-new -o $@ $< |
| 2399 | |
| 2400 | arm_cortex_a8_bl.o: arm_cortex_a8_bl.s |
| 2401 | $(TEST_AS) -o $@ $< |
| 2402 | |
| 2403 | arm_cortex_a8_blx.stdout: arm_cortex_a8_blx |
| 2404 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2405 | |
| 2406 | arm_cortex_a8_blx: arm_cortex_a8_blx.o ../ld-new |
| 2407 | ../ld-new -o $@ $< |
| 2408 | |
| 2409 | arm_cortex_a8_blx.o: arm_cortex_a8_blx.s |
| 2410 | $(TEST_AS) -o $@ $< |
| 2411 | |
| 2412 | arm_cortex_a8_local.stdout: arm_cortex_a8_local |
| 2413 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2414 | |
| 2415 | arm_cortex_a8_local: arm_cortex_a8_local.o ../ld-new |
| 2416 | ../ld-new -o $@ $< |
| 2417 | |
| 2418 | arm_cortex_a8_local.o: arm_cortex_a8_local.s |
| 2419 | $(TEST_AS) -o $@ $< |
| 2420 | |
| 2421 | arm_cortex_a8_local_reloc.stdout: arm_cortex_a8_local_reloc |
| 2422 | $(TEST_OBJDUMP) -D -j.text $< > $@ |
| 2423 | |
| 2424 | arm_cortex_a8_local_reloc: arm_cortex_a8_local_reloc.o ../ld-new |
| 2425 | ../ld-new -o $@ $< |
| 2426 | |
| 2427 | arm_cortex_a8_local_reloc.o: arm_cortex_a8_local_reloc.s |
| 2428 | $(TEST_AS) -o $@ $< |
| 2429 | |
| 2430 | MOSTLYCLEANFILES += arm_cortex_a8_b_cond arm_cortex_a8_b arm_cortex_a8_bl \ |
| 2431 | arm_cortex_a8_blx arm_cortex_a8_local arm_cortex_a8_local_reloc |
| 2432 | |
| 2433 | check_SCRIPTS += arm_exidx_test.sh |
| 2434 | check_DATA += arm_exidx_test.stdout |
| 2435 | |
| 2436 | arm_exidx_test.stdout: arm_exidx_test.so |
| 2437 | $(TEST_READELF) -S $< > $@ |
| 2438 | |
| 2439 | arm_exidx_test.so: arm_exidx_test.o ../ld-new |
| 2440 | ../ld-new -shared -o $@ $< |
| 2441 | |
| 2442 | arm_exidx_test.o: arm_exidx_test.s |
| 2443 | $(TEST_AS) -o $@ $< |
| 2444 | |
| 2445 | check_SCRIPTS += pr12826.sh |
| 2446 | check_DATA += pr12826.stdout |
| 2447 | |
| 2448 | pr12826.stdout: pr12826.so |
| 2449 | $(TEST_READELF) -A $< > $@ |
| 2450 | |
| 2451 | pr12826.so: pr12826_1.o pr12826_2.o ../ld-new |
| 2452 | ../ld-new -shared -o $@ $< |
| 2453 | |
| 2454 | pr12826_1.o: pr12826_1.s |
| 2455 | $(TEST_AS) -o $@ $< |
| 2456 | |
| 2457 | pr12826_2.o: pr12826_2.s |
| 2458 | $(TEST_AS) -o $@ $< |
| 2459 | |
| 2460 | check_SCRIPTS += arm_unaligned_reloc.sh |
| 2461 | check_DATA += arm_unaligned_reloc.stdout |
| 2462 | |
| 2463 | arm_unaligned_reloc.stdout: arm_unaligned_reloc |
| 2464 | $(TEST_OBJDUMP) -D $< > $@ |
| 2465 | |
| 2466 | arm_unaligned_reloc: arm_unaligned_reloc.o ../ld-new |
| 2467 | ../ld-new -o $@ $< |
| 2468 | |
| 2469 | arm_unaligned_reloc.o: arm_unaligned_reloc.s |
| 2470 | $(TEST_AS) -o $@ $< |
| 2471 | |
| 2472 | MOSTLYCLEANFILES += arm_unaligned_reloc |
| 2473 | |
| 2474 | endif DEFAULT_TARGET_ARM |
| 2475 | |
| 2476 | endif NATIVE_OR_CROSS_LINKER |
| 2477 | |