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