Sriraman Tallam <tmsriram@google.com>
[deliverable/binutils-gdb.git] / gold / testsuite / Makefile.am
CommitLineData
5a6f7e2d
ILT
1# Process this file with automake to generate Makefile.in
2
537b5f51
ILT
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
5a6f7e2d
ILT
7AUTOMAKE_OPTIONS =
8
f958d5fc
ILT
9# The two_file_test tests -fmerge-constants, so we simply always turn
10# it on. This may need to be controlled by a configure option
11# eventually.
89fc3421 12AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants
494e05f4 13AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants
5a6f7e2d 14
fa99aa09 15INCLUDES = \
5a6f7e2d 16 -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
155a0dd7 17 -I$(srcdir)/../../elfcpp -I.. \
5a6f7e2d
ILT
18 -DLOCALEDIR="\"$(datadir)/locale\"" \
19 @INCINTL@
20
6835af53
ILT
21TEST_READELF = $(top_builddir)/../binutils/readelf
22TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
23TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
24TEST_STRIP = $(top_builddir)/../binutils/strip-new
fbd8a257 25TEST_AR = $(top_builddir)/../binutils/ar
531813ad 26TEST_NM = $(top_builddir)/../binutils/nm-new
6835af53 27
89fc3421
CC
28if PLUGINS
29LIBDL = -ldl
30endif
31
fe9a4c12
ILT
32if THREADS
33THREADSLIB = -lpthread
34endif
35
155a0dd7
ILT
36if OMP_SUPPORT
37TLS_TEST_C_CFLAGS = -fopenmp
38endif
39
351a8000
ILT
40# 'make clean' is good about deleting some intermediate files (such as
41# .o's), but not all of them (such as .so's and .err files). We
42# improve on that here. automake-1.9 info docs say "mostlyclean" is
43# the right choice for files 'make' builds that people rebuild.
44MOSTLYCLEANFILES = *.so
6eee141f 45
6eee141f 46
351a8000
ILT
47# We will add to these later, for each individual test. Note
48# that we add each test under check_SCRIPTS or check_PROGRAMS;
49# the TESTS variable is automatically populated from these.
50check_SCRIPTS =
51check_DATA =
52check_PROGRAMS =
d491d34e
ILT
53BUILT_SOURCES =
54
351a8000 55TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
22dc1b09 56
351a8000
ILT
57# ---------------------------------------------------------------------
58# These tests test the internals of gold (unittests).
5a6f7e2d 59
351a8000 60# Infrastucture needed for the unittests
5a6f7e2d
ILT
61check_LIBRARIES = libgoldtest.a
62libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
63
ad2d6943
ILT
64DEPENDENCIES = \
65 libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
fe9a4c12 66LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
89fc3421 67 $(THREADSLIB) $(LIBDL)
5a6f7e2d 68
5a6f7e2d 69
351a8000
ILT
70# The unittests themselves
71check_PROGRAMS += object_unittest
5a6f7e2d 72object_unittest_SOURCES = object_unittest.cc
22dc1b09 73
bc644c6c
ILT
74check_PROGRAMS += binary_unittest
75binary_unittest_SOURCES = binary_unittest.cc
76
351a8000
ILT
77
78# ---------------------------------------------------------------------
79# These tests test the output of gold (end-to-end tests). In
80# particular, they make sure that gold can link "difficult" object
81# files, and the resulting object files run correctly. These can only
82# run if we've built ld-new for the native architecture (that is,
83# we're not cross-compiling it), since we run ld-new as part of these
84# tests. We use the gcc-specific flag '-B' to use our linker instead
85# of the default linker, which is why we only run our tests under gcc.
a360aedd 86
e2827e5f 87if NATIVE_LINKER
351a8000 88if GCC
e2827e5f 89
351a8000
ILT
90# Infrastucture needed for the unittests: a directory where the linker
91# is named 'ld'. This is because the -B flag appends 'ld' to its arg.
e2827e5f
ILT
92gcctestdir/ld: ../ld-new
93 test -d gcctestdir || mkdir -p gcctestdir
94 rm -f gcctestdir/ld
95 (cd gcctestdir && $(LN_S) ../../ld-new ld)
96
351a8000
ILT
97# Each of these .o's is a useful, small complete program. They're
98# particularly useful for making sure ld-new's flags do what they're
99# supposed to (hence their names), but are used for many tests that
100# don't actually involve analyzing input data.
43771f76
ILT
101flagstest_debug.o: constructor_test.cc
102 $(CXXCOMPILE) -O0 -g -c -o $@ $<
103flagstest_ndebug.o: constructor_test.cc
104 $(CXXCOMPILE) -O0 -c -o $@ $<
105
43771f76 106
531813ad
ST
107check_SCRIPTS += gc_comdat_test.sh
108check_DATA += gc_comdat_test.stdout
109gc_comdat_test_1.o: gc_comdat_test_1.cc
4daadc0d 110 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
531813ad 111gc_comdat_test_2.o: gc_comdat_test_2.cc
4daadc0d 112 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
531813ad 113gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
4daadc0d 114 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
531813ad
ST
115gc_comdat_test.stdout: gc_comdat_test
116 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
117
27721062
ST
118check_SCRIPTS += gc_tls_test.sh
119check_DATA += gc_tls_test.stdout
120gc_tls_test.o: gc_tls_test.cc
121 $(CXXCOMPILE) -O0 -c -g -o $@ $<
122gc_tls_test:gc_tls_test.o gcctestdir/ld
123 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
124gc_tls_test.stdout: gc_tls_test
125 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
126
ef15dade
ST
127check_SCRIPTS += icf_test.sh
128check_DATA += icf_test.stdout
129icf_test.o: icf_test.cc
130 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
131icf_test: icf_test.o gcctestdir/ld
132 $(CXXLINK) -Bgcctestdir/ -Wl,--icf icf_test.o
133icf_test.stdout: icf_test
134 $(TEST_NM) -C icf_test > icf_test.stdout
135
48c187ce
ST
136check_SCRIPTS += icf_keep_unique_test.sh
137check_DATA += icf_keep_unique_test.stdout
138icf_keep_unique_test.o: icf_keep_unique_test.cc
139 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
140icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
141 $(CXXLINK) -Bgcctestdir/ -Wl,--icf -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
142icf_keep_unique_test.stdout: icf_keep_unique_test
143 $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout
531813ad 144
351a8000
ILT
145check_PROGRAMS += basic_test
146check_PROGRAMS += basic_static_test
147check_PROGRAMS += basic_pic_test
148check_PROGRAMS += basic_static_pic_test
56ba9a23 149basic_test.o: basic_test.cc
22dc1b09 150 $(CXXCOMPILE) -O0 -c -o $@ $<
56ba9a23
ILT
151basic_test: basic_test.o gcctestdir/ld
152 $(CXXLINK) -Bgcctestdir/ basic_test.o
153basic_static_test: basic_test.o gcctestdir/ld
154 $(CXXLINK) -Bgcctestdir/ -static basic_test.o
22dc1b09 155
56ba9a23 156basic_pic_test.o: basic_test.cc
22dc1b09 157 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
56ba9a23
ILT
158basic_pic_test: basic_pic_test.o gcctestdir/ld
159 $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
160basic_static_pic_test: basic_pic_test.o gcctestdir/ld
161 $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
22dc1b09 162
351a8000
ILT
163
164check_PROGRAMS += constructor_test
165check_PROGRAMS += constructor_static_test
d5026652
ILT
166constructor_test_SOURCES = constructor_test.cc
167constructor_test_DEPENDENCIES = gcctestdir/ld
168constructor_test_LDFLAGS = -Bgcctestdir/
169
351a8000
ILT
170constructor_static_test_SOURCES = $(constructor_test_SOURCES)
171constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
172constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
cb615bc1 173
351a8000
ILT
174
175check_PROGRAMS += two_file_test
176check_PROGRAMS += two_file_static_test
177check_PROGRAMS += two_file_pic_test
3bd52c28
ILT
178two_file_test_SOURCES = \
179 two_file_test_1.cc \
03e8f2b2 180 two_file_test_1b.cc \
3bd52c28
ILT
181 two_file_test_2.cc \
182 two_file_test_main.cc \
183 two_file_test.h
184two_file_test_DEPENDENCIES = gcctestdir/ld
185two_file_test_LDFLAGS = -Bgcctestdir/
186
351a8000
ILT
187two_file_static_test_SOURCES = $(two_file_test_SOURCES)
188two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
189two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
f958d5fc
ILT
190
191two_file_pic_test_SOURCES = two_file_test_main.cc
192two_file_pic_test_DEPENDENCIES = \
03e8f2b2 193 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 194two_file_pic_test_LDFLAGS = -Bgcctestdir/
03e8f2b2 195two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 196
351a8000
ILT
197
198check_PROGRAMS += two_file_shared_1_test
199check_PROGRAMS += two_file_shared_2_test
200check_PROGRAMS += two_file_shared_1_pic_2_test
201check_PROGRAMS += two_file_shared_2_pic_1_test
202check_PROGRAMS += two_file_same_shared_test
203check_PROGRAMS += two_file_separate_shared_12_test
204check_PROGRAMS += two_file_separate_shared_21_test
205two_file_test_1_pic.o: two_file_test_1.cc
206 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
207two_file_test_1b_pic.o: two_file_test_1b.cc
208 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000
ILT
209two_file_test_2_pic.o: two_file_test_2.cc
210 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
211two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
212 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
351a8000
ILT
213two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
214 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
03e8f2b2
ILT
215two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
216 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
351a8000 217
3bd52c28
ILT
218two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
219two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
220two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
221two_file_shared_1_test_LDADD = two_file_shared_1.so
222
03e8f2b2 223two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
224two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
225two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
226two_file_shared_2_test_LDADD = two_file_shared_2.so
227
386c048c
ILT
228two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
229two_file_shared_1_pic_2_test_DEPENDENCIES = \
03e8f2b2 230 gcctestdir/ld two_file_shared_1.so two_file_test_1_pic.o two_file_test_1b_pic.o
386c048c 231two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
03e8f2b2 232two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so
386c048c
ILT
233
234two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
235two_file_shared_2_pic_1_test_DEPENDENCIES = \
236 gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
237two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
238two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
239
3bd52c28
ILT
240two_file_same_shared_test_SOURCES = two_file_test_main.cc
241two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
242two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
243two_file_same_shared_test_LDADD = two_file_shared.so
244
245two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
246two_file_separate_shared_12_test_DEPENDENCIES = \
247 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
248two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
249two_file_separate_shared_12_test_LDADD = \
250 two_file_shared_1.so two_file_shared_2.so
251
252two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
253two_file_separate_shared_21_test_DEPENDENCIES = \
254 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
255two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
256two_file_separate_shared_21_test_LDADD = \
257 two_file_shared_2.so two_file_shared_1.so
258
6a74a719
ILT
259check_PROGRAMS += two_file_relocatable_test
260two_file_relocatable_test_SOURCES = two_file_test_main.cc
261two_file_relocatable_test_DEPENDENCIES = \
262 gcctestdir/ld two_file_relocatable.o
263two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
264two_file_relocatable_test_LDADD = two_file_relocatable.o
265two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
266 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
267
031cdbed
ILT
268check_SCRIPTS += two_file_shared.sh
269check_DATA += two_file_shared.dbg
270two_file_shared.dbg: two_file_shared.so
271 $(TEST_READELF) -w $< >$@ 2>/dev/null
272
63402fe4
ILT
273# The nonpic tests will fail on platforms which can not put non-PIC
274# code into shared libraries, so we just don't run them in that case.
63402fe4 275if FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 276
351a8000
ILT
277check_PROGRAMS += two_file_shared_1_nonpic_test
278check_PROGRAMS += two_file_shared_2_nonpic_test
279check_PROGRAMS += two_file_same_shared_nonpic_test
280check_PROGRAMS += two_file_separate_shared_12_nonpic_test
281check_PROGRAMS += two_file_separate_shared_21_nonpic_test
03e8f2b2
ILT
282check_PROGRAMS += two_file_mixed_shared_test
283check_PROGRAMS += two_file_mixed_2_shared_test
351a8000 284two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
03e8f2b2 285 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
351a8000
ILT
286two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
287 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
03e8f2b2
ILT
288two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
289 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
290two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
291 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
292two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
293 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so
351a8000 294
3bd52c28
ILT
295two_file_shared_1_nonpic_test_SOURCES = \
296 two_file_test_2.cc two_file_test_main.cc
297two_file_shared_1_nonpic_test_DEPENDENCIES = \
298 gcctestdir/ld two_file_shared_1_nonpic.so
299two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
300two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
301
302two_file_shared_2_nonpic_test_SOURCES = \
03e8f2b2 303 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
304two_file_shared_2_nonpic_test_DEPENDENCIES = \
305 gcctestdir/ld two_file_shared_2_nonpic.so
306two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
307two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
308
309two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
310two_file_same_shared_nonpic_test_DEPENDENCIES = \
311 gcctestdir/ld two_file_shared_nonpic.so
312two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
313two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
314
315two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
316two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
317 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
318two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
319two_file_separate_shared_12_nonpic_test_LDADD = \
320 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
321
322two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
323two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
324 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
325two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
326two_file_separate_shared_21_nonpic_test_LDADD = \
327 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
328
03e8f2b2
ILT
329two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
330two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
331two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
332two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
333
334two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
335two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
336two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
337two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
338
351a8000 339endif FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 340
6835af53
ILT
341check_PROGRAMS += two_file_strip_test
342two_file_strip_test: two_file_test
343 $(TEST_STRIP) -o two_file_strip_test two_file_test
344
345check_PROGRAMS += two_file_same_shared_strip_test
346two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
347two_file_same_shared_strip_test_DEPENDENCIES = \
348 gcctestdir/ld two_file_shared_strip.so
349two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
350two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
351two_file_shared_strip.so: two_file_shared.so
352 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
353
49bdd526
ILT
354check_PROGRAMS += common_test_1
355common_test_1_SOURCES = common_test_1.c
356common_test_1_DEPENDENCIES = gcctestdir/ld
357common_test_1_LDFLAGS = -Bgcctestdir/
351a8000
ILT
358
359check_PROGRAMS += exception_test
360check_PROGRAMS += exception_static_test
361check_PROGRAMS += exception_shared_1_test
362check_PROGRAMS += exception_shared_2_test
363check_PROGRAMS += exception_same_shared_test
364check_PROGRAMS += exception_separate_shared_12_test
365check_PROGRAMS += exception_separate_shared_21_test
366exception_test_1_pic.o: exception_test_1.cc
367 $(CXXCOMPILE) -c -fpic -o $@ $<
368exception_test_2_pic.o: exception_test_2.cc
369 $(CXXCOMPILE) -c -fpic -o $@ $<
370exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
371 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
372exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
373 $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
374exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
375 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
63402fe4 376
3151305a
ILT
377exception_test_SOURCES = \
378 exception_test_main.cc \
379 exception_test_1.cc \
380 exception_test_2.cc \
381 exception_test.h
382exception_test_DEPENDENCIES = gcctestdir/ld
383exception_test_LDFLAGS = -Bgcctestdir/
384
351a8000
ILT
385exception_static_test_SOURCES = $(exception_test_SOURCES)
386exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
387exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
3151305a
ILT
388
389exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
390exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
391exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
392exception_shared_1_test_LDADD = exception_shared_1.so
393
394exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
395exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
396exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
397exception_shared_2_test_LDADD = exception_shared_2.so
398
399exception_same_shared_test_SOURCES = exception_test_main.cc
400exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
401exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
402exception_same_shared_test_LDADD = exception_shared.so
403
404exception_separate_shared_12_test_SOURCES = exception_test_main.cc
405exception_separate_shared_12_test_DEPENDENCIES = \
406 gcctestdir/ld exception_shared_1.so exception_shared_2.so
407exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
408exception_separate_shared_12_test_LDADD = \
409 exception_shared_1.so exception_shared_2.so
410
411exception_separate_shared_21_test_SOURCES = exception_test_main.cc
412exception_separate_shared_21_test_DEPENDENCIES = \
413 gcctestdir/ld exception_shared_1.so exception_shared_2.so
414exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
415exception_separate_shared_21_test_LDADD = \
416 exception_shared_2.so exception_shared_1.so
417
3151305a 418
351a8000 419check_PROGRAMS += weak_test
a360aedd 420weak_test_SOURCES = weak_test.cc
0e470e5c 421weak_test_DEPENDENCIES = gcctestdir/ld
a360aedd
ILT
422weak_test_LDFLAGS = -Bgcctestdir/
423
86925eef
CC
424check_PROGRAMS += weak_undef_test
425weak_undef_test_SOURCES = weak_undef_test.cc
426weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
427weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
428weak_undef_test_LDADD = -L . weak_undef_lib.so
429weak_undef_file1.o: weak_undef_file1.cc
430 $(CXXCOMPILE) -c -fpic -o $@ $<
431weak_undef_file2.o: weak_undef_file2.cc
432 $(CXXCOMPILE) -c -fpic -o $@ $<
433weak_undef_lib.so: weak_undef_file1.o
434 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
435alt/weak_undef_lib.so: weak_undef_file2.o
436 test -d alt || mkdir -p alt
437 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
351a8000 438
f3c69fca
CC
439if FN_PTRS_IN_SO_WITHOUT_PIC
440check_PROGRAMS += weak_undef_nonpic_test
441weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
442weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
443weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
444weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
445weak_undef_file1_nonpic.o: weak_undef_file1.cc
446 $(CXXCOMPILE) -c -o $@ $<
447weak_undef_file2_nonpic.o: weak_undef_file2.cc
448 $(CXXCOMPILE) -c -o $@ $<
449weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
450 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
451alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
452 test -d alt || mkdir -p alt
453 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
454endif FN_PTRS_IN_SO_WITHOUT_PIC
455
456
99a37bfd
ILT
457check_PROGRAMS += weak_alias_test
458weak_alias_test_SOURCES = weak_alias_test_main.cc
459weak_alias_test_DEPENDENCIES = \
460 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
461 weak_alias_test_3.o weak_alias_test_4.so
462weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
463weak_alias_test_LDADD = \
464 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
465 weak_alias_test_4.so
466weak_alias_test_1_pic.o: weak_alias_test_1.cc
467 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 468weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
99a37bfd
ILT
469 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
470weak_alias_test_2_pic.o: weak_alias_test_2.cc
471 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 472weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
99a37bfd
ILT
473 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
474weak_alias_test_3.o: weak_alias_test_3.cc
475 $(CXXCOMPILE) -c -o $@ $<
476weak_alias_test_4_pic.o: weak_alias_test_4.cc
477 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 478weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
99a37bfd
ILT
479 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
480
de4c45bd
ILT
481check_SCRIPTS += weak_plt.sh
482check_PROGRAMS += weak_plt
483check_DATA += weak_plt_shared.so
484weak_plt_main_pic.o: weak_plt_main.cc
485 $(CXXCOMPILE) -c -fpic -o $@ $<
486weak_plt: weak_plt_main_pic.o gcctestdir/ld
487 $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
488weak_plt_shared_pic.o: weak_plt_shared.cc
489 $(CXXCOMPILE) -c -fpic -o $@ $<
490weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
491 $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
492
f34787f8
ILT
493check_PROGRAMS += copy_test
494copy_test_SOURCES = copy_test.cc
495copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
496copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
497copy_test_LDADD = copy_test_1.so copy_test_2.so
498copy_test_1_pic.o: copy_test_1.cc
499 $(CXXCOMPILE) -c -fpic -o $@ $<
500copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
501 $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
502copy_test_2_pic.o: copy_test_2.cc
503 $(CXXCOMPILE) -c -fpic -o $@ $<
504copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
505 $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
506
6eee141f
ILT
507if TLS
508
351a8000
ILT
509check_PROGRAMS += tls_test
510check_PROGRAMS += tls_pic_test
511check_PROGRAMS += tls_shared_test
c03c7692 512check_PROGRAMS += tls_shared_ie_test
c2b45e22 513check_PROGRAMS += tls_shared_gd_to_ie_test
351a8000
ILT
514tls_test_pic.o: tls_test.cc
515 $(CXXCOMPILE) -c -fpic -o $@ $<
516tls_test_file2_pic.o: tls_test_file2.cc
517 $(CXXCOMPILE) -c -fpic -o $@ $<
155a0dd7
ILT
518tls_test_c_pic.o: tls_test_c.c
519 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
520tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
9c2d0ef9 521 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
c2b45e22
CC
522tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
523 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
351a8000 524
c03c7692
ILT
525tls_test_pic_ie.o: tls_test.cc
526 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
527tls_test_file2_pic_ie.o: tls_test_file2.cc
528 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
155a0dd7
ILT
529tls_test_c_pic_ie.o: tls_test_c.c
530 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
531tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
532 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
c03c7692 533
e0374858 534tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
155a0dd7 535tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
6eee141f 536tls_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
537tls_test_LDADD = tls_test_c.o -lpthread
538tls_test_c.o: tls_test_c.c
539 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
6eee141f
ILT
540
541tls_pic_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
542tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
543 tls_test_c_pic.o
6eee141f 544tls_pic_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
545tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
546 -lpthread
6eee141f 547
6eee141f
ILT
548tls_shared_test_SOURCES = tls_test_main.cc
549tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
550tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
551tls_shared_test_LDADD = tls_test_shared.so -lpthread
552
c03c7692
ILT
553tls_shared_ie_test_SOURCES = tls_test_main.cc
554tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
555tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
556tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
557
c2b45e22 558tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
559tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
560 tls_test_c_pic.o tls_test_shared2.so
c2b45e22 561tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
562tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
563 tls_test_shared2.so -lpthread
c2b45e22
CC
564
565if TLS_GNU2_DIALECT
566
567check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
568
569tls_test_gnu2.o: tls_test.cc
570 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
571tls_test_file2_gnu2.o: tls_test_file2.cc
572 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
155a0dd7
ILT
573tls_test_c_gnu2.o: tls_test_c.c
574 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
c2b45e22
CC
575tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
576 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
577
578tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
579tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
580 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
c2b45e22 581tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
582tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
583 tls_test_gnu2_shared2.so -lpthread
c2b45e22
CC
584
585if TLS_DESCRIPTORS
586
587check_PROGRAMS += tls_shared_gnu2_test
588
155a0dd7
ILT
589tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
590 $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
c2b45e22
CC
591
592tls_shared_gnu2_test_SOURCES = tls_test_main.cc
593tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
594tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
595tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
596
597endif TLS_DESCRIPTORS
598
599endif TLS_GNU2_DIALECT
600
351a8000
ILT
601if STATIC_TLS
602check_PROGRAMS += tls_static_test
603check_PROGRAMS += tls_static_pic_test
604
605tls_static_test_SOURCES = $(tls_test_SOURCES)
606tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
607tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
608tls_static_test_LDADD = $(tls_test_LDADD)
609
610tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
611tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
612tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
613tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
614endif
6eee141f
ILT
615
616if FN_PTRS_IN_SO_WITHOUT_PIC
351a8000 617check_PROGRAMS += tls_shared_nonpic_test
155a0dd7
ILT
618tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
619 $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
6eee141f
ILT
620
621tls_shared_nonpic_test_SOURCES = tls_test_main.cc
622tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
623tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
624tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
351a8000 625endif FN_PTRS_IN_SO_WITHOUT_PIC
6eee141f 626
351a8000 627endif TLS
6eee141f 628
d491d34e
ILT
629check_PROGRAMS += many_sections_test
630many_sections_test_SOURCES = many_sections_test.cc
631many_sections_test_DEPENDENCIES = gcctestdir/ld
632many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
633
634BUILT_SOURCES += many_sections_define.h
635many_sections_define.h:
636 (for i in `seq 1 70000`; do \
637 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
638 done) > $@.tmp
639 mv -f $@.tmp $@
640
641BUILT_SOURCES += many_sections_check.h
642many_sections_check.h:
4c94d6ae 643 (for i in `seq 1 1000 70000`; do \
d491d34e
ILT
644 echo "assert(var_$$i == $$i);"; \
645 done) > $@.tmp
646 mv -f $@.tmp $@
647
648check_PROGRAMS += many_sections_r_test
d491d34e
ILT
649many_sections_r_test.o: many_sections_test.o gcctestdir/ld
650 gcctestdir/ld -r -o $@ many_sections_test.o
7bc3e21a
ILT
651many_sections_r_test: many_sections_r_test.o gcctestdir/ld
652 $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
6eee141f 653
2fd32231
ILT
654if CONSTRUCTOR_PRIORITY
655
656check_PROGRAMS += initpri1
657initpri1_SOURCES = initpri1.c
658initpri1_DEPENDENCIES = gcctestdir/ld
659initpri1_LDFLAGS = -Bgcctestdir/
660
661endif
662
663
351a8000
ILT
664# Test --detect-odr-violations
665check_SCRIPTS += debug_msg.sh
6eee141f 666
351a8000
ILT
667# Create the data files that debug_msg.sh analyzes.
668check_DATA += debug_msg.err
669MOSTLYCLEANFILES += debug_msg.err
670debug_msg.o: debug_msg.cc
671 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
672odr_violation1.o: odr_violation1.cc
673 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
674odr_violation2.o: odr_violation2.cc
675 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
676debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
677 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
678 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
679 then \
680 echo 1>&2 "Link of debug_msg should have failed"; \
681 rm -f $@; \
682 exit 1; \
683 fi
684
685# See if we can also detect problems when we're linking .so's, not .o's.
686check_DATA += debug_msg_so.err
687MOSTLYCLEANFILES += debug_msg_so.err
688debug_msg.so: debug_msg.cc gcctestdir/ld
689 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
690odr_violation1.so: odr_violation1.cc gcctestdir/ld
691 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
692odr_violation2.so: odr_violation2.cc gcctestdir/ld
693 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
694debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
695 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
696 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
697 then \
698 echo 1>&2 "Link of debug_msg_so should have failed"; \
699 rm -f $@; \
700 exit 1; \
701 fi
702
703# We also want to make sure we do something reasonable when there's no
704# debug info available. For the best test, we use .so's.
705check_DATA += debug_msg_ndebug.err
706MOSTLYCLEANFILES += debug_msg_ndebug.err
707debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
708 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
709odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
710 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
711odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
712 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
713debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
714 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
715 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
716 then \
717 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
718 rm -f $@; \
719 exit 1; \
720 fi
721
722
723# Similar to --detect-odr-violations: check for undefined symbols in .so's
724check_SCRIPTS += undef_symbol.sh
725check_DATA += undef_symbol.err
726MOSTLYCLEANFILES += undef_symbol.err
727undef_symbol.o: undef_symbol.cc
728 $(CXXCOMPILE) -O0 -g -c -fPIC $<
729undef_symbol.so: undef_symbol.o gcctestdir/ld
730 $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
731undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
732 @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
733 @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
734 then \
735 echo 1>&2 "Link of undef_symbol_test should have failed"; \
736 rm -f $@; \
737 exit 1; \
738 fi
739
740
351a8000
ILT
741# Test -o when emitting to a special file (such as something in /dev).
742check_PROGRAMS += flagstest_o_specialfile
0e470e5c 743flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
351a8000
ILT
744 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
745 chmod a+x $@
746 test -s $@
747
7fcd0256
ILT
748if HAVE_ZLIB
749
750# Test --compress-debug-sections. FIXME: check we actually compress.
751check_PROGRAMS += flagstest_compress_debug_sections
752flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
753 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
754 test -s $@
755
756
351a8000
ILT
757# The specialfile output has a tricky case when we also compress debug
758# sections, because it requires output-file resizing.
759check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
0e470e5c
ILT
760flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
761 gcctestdir/ld
126f3ece 762 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
351a8000
ILT
763 chmod a+x $@
764 test -s $@
765
7fcd0256
ILT
766endif HAVE_ZLIB
767
99f8faca
ILT
768# Test symbol versioning.
769check_PROGRAMS += ver_test
770ver_test_SOURCES = ver_test_main.cc
771ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
772ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
773ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
774ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
775 $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
09124467
ILT
776ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
777 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so
778ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
779 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
99f8faca
ILT
780ver_test_1.o: ver_test_1.cc
781 $(CXXCOMPILE) -c -fpic -o $@ $<
782ver_test_2.o: ver_test_2.cc
783 $(CXXCOMPILE) -c -fpic -o $@ $<
784ver_test_3.o: ver_test_3.cc
785 $(CXXCOMPILE) -c -fpic -o $@ $<
786ver_test_4.o: ver_test_4.cc
787 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000 788
0602e05a
ILT
789check_SCRIPTS += ver_test_1.sh
790check_DATA += ver_test_1.syms
791ver_test_1.syms: ver_test_1.so
792 $(TEST_READELF) -s $< >$@ 2>/dev/null
793
be3e6201
ILT
794check_PROGRAMS += ver_test_2
795ver_test_2_SOURCES = ver_test_main_2.cc
796ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
797ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
798ver_test_2_LDADD = ver_test_4.so ver_test_2.so
799
be3e6201
ILT
800check_SCRIPTS += ver_test_2.sh
801check_DATA += ver_test_2.syms
802ver_test_2.syms: ver_test_2
6835af53 803 $(TEST_READELF) -s $< >$@ 2>/dev/null
be3e6201 804
686c8caf
ILT
805check_SCRIPTS += ver_test_4.sh
806check_DATA += ver_test_4.syms
807ver_test_4.syms: ver_test_4.so
6835af53 808 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f
ILT
809
810ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
811 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
812ver_test_5.o: ver_test_5.cc
813 $(CXXCOMPILE) -c -fpic -o $@ $<
814check_SCRIPTS += ver_test_5.sh
815check_DATA += ver_test_5.syms
816ver_test_5.syms: ver_test_5.so
6835af53 817 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f 818
18e6b24e
ILT
819check_PROGRAMS += ver_test_6
820ver_test_6_SOURCES = ver_test_6.c
821ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
822ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
823ver_test_6_LDADD = ver_test_2.so
824
479f6503
ILT
825ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
826 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
827ver_test_7.o: ver_test_7.cc
828 $(CXXCOMPILE) -c -fpic -o $@ $<
829check_SCRIPTS += ver_test_7.sh
830check_DATA += ver_test_7.syms
831ver_test_7.syms: ver_test_7.so
6835af53 832 $(TEST_READELF) -s $< >$@ 2>/dev/null
479f6503 833
75517b77
ILT
834check_PROGRAMS += ver_test_8
835ver_test_8_SOURCES = two_file_test_main.cc
836ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
837ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
838ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
839ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
840 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
841ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
842 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
843
95d14cd3
ILT
844check_PROGRAMS += ver_test_9
845ver_test_9_SOURCES = ver_test_main.cc
846ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
847ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
848ver_test_9_LDADD = ver_test_9.so
849ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
850 $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so
851ver_test_9.o: ver_test_9.cc
852 $(CXXCOMPILE) -c -fpic -o $@ $<
853
057ead22
ILT
854check_SCRIPTS += ver_test_10.sh
855check_DATA += ver_test_10.syms
856ver_test_10.syms: ver_test_10.so
857 $(TEST_READELF) -s $< >$@ 2>/dev/null
858ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
859 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
860
9c5b8369
ILT
861check_PROGRAMS += ver_test_11
862ver_test_11_SOURCES = ver_test_main_2.cc
863ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
864ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
865ver_test_11_LDADD = ver_test_11.a
866ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
867 $(TEST_AR) rc $@ $^
868
8bdcdf2c
ILT
869check_PROGRAMS += protected_1
870protected_1_SOURCES = \
871 protected_main_1.cc protected_main_2.cc protected_main_3.cc
872protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
873protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
874protected_1_LDADD = protected_1.so
875
876protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
877 $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
878protected_1_pic.o: protected_1.cc
879 $(CXXCOMPILE) -c -fpic -o $@ $<
880protected_2_pic.o: protected_2.cc
881 $(CXXCOMPILE) -c -fpic -o $@ $<
882protected_3_pic.o: protected_3.cc
883 $(CXXCOMPILE) -c -fpic -o $@ $<
884
885check_PROGRAMS += protected_2
886protected_2_SOURCES = protected_main_1.cc protected_3.cc
887protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
888protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
889protected_2_LDADD = protected_1.so
890
9f1d377b
ILT
891check_PROGRAMS += relro_test
892relro_test_SOURCES = relro_test_main.cc
893relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
894relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
895relro_test_LDADD = relro_test.so
896relro_test.so: gcctestdir/ld relro_test_pic.o
897 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
898relro_test_pic.o: relro_test.cc
899 $(CXXCOMPILE) -c -fpic -o $@ $<
900
2d924fd9
ILT
901check_PROGRAMS += relro_script_test
902relro_script_test_SOURCES = relro_test_main.cc
903relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
904relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
905relro_script_test_LDADD = relro_script_test.so
906relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
907 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o
908
e5756efb
ILT
909check_PROGRAMS += script_test_1
910script_test_1_SOURCES = script_test_1.cc
911script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
912script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
913
a445fddf
ILT
914check_PROGRAMS += script_test_2
915script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
916script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
917script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
918
88dd47ac
ILT
919check_PROGRAMS += justsyms
920justsyms_SOURCES = justsyms_1.cc
921justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
922justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
923justsyms_2.o: justsyms_2.cc
924 $(CXXCOMPILE) -c -o $@ $<
83bfb6b7 925justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
88dd47ac
ILT
926 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
927
bc644c6c
ILT
928check_PROGRAMS += binary_test
929binary_test_SOURCES = binary_test.cc
930binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
931binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
932# Copy the file to the build directory to avoid worrying about the
933# full pathname in the generated symbols.
934binary.txt: $(srcdir)/binary.in
935 rm -f $@
936 $(LN_S) $< $@
937
09124467
ILT
938check_SCRIPTS += ver_matching_test.sh
939check_DATA += ver_matching_test.stdout
940MOSTLYCLEANFILES += ver_matching_test.stdout
941ver_matching_def.so: ver_matching_def.cc gcctestdir/ld
942 $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
943ver_matching_test.stdout: ver_matching_def.so
6835af53 944 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1c4f3631
ILT
945
946check_PROGRAMS += script_test_3
947check_SCRIPTS += script_test_3.sh
948check_DATA += script_test_3.stdout
949MOSTLYCLEANFILES += script_test_3.stdout
950script_test_3: basic_test.o gcctestdir/ld script_test_3.t
951 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
952script_test_3.stdout: script_test_3
2cefc357 953 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
09124467 954
e6188289
ILT
955check_SCRIPTS += script_test_4.sh
956check_DATA += script_test_4.stdout
957MOSTLYCLEANFILES += script_test_4.stdout
958script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
959 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
960script_test_4.stdout: script_test_4
961 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
962
401a9a73
CC
963check_SCRIPTS += script_test_5.sh
964check_DATA += script_test_5.stdout
965MOSTLYCLEANFILES += script_test_5.stdout
966script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
967 $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t
968script_test_5.stdout: script_test_5
969 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
970
c82fbeee
CS
971# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
972# and --dynamic-list-cpp-typeinfo
973
974check_SCRIPTS += dynamic_list.sh
975check_DATA += dynamic_list.stdout
976MOSTLYCLEANFILES += dynamic_list.stdout
977dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
978 $(CXXLINK) -Bgcctestdir/ basic_test.o \
979 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
980 -Wl,--dynamic-list-data \
981 -Wl,--dynamic-list-cpp-new \
982 -Wl,--dynamic-list-cpp-typeinfo
983dynamic_list.stdout: dynamic_list
984 $(TEST_READELF) -DWs dynamic_list > dynamic_list.stdout
985
fbd8a257
CC
986check_PROGRAMS += thin_archive_test_1
987thin_archive_test_1_SOURCES = thin_archive_main.cc
988thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
989thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
990thin_archive_test_1_LDADD = libthin1.a -lthin2
991
992check_PROGRAMS += thin_archive_test_2
993thin_archive_test_2_SOURCES = thin_archive_main.cc
994thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
995thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
996thin_archive_test_2_LDADD = -lthinall
997
998libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
999 rm -f $@
1000 $(TEST_AR) crT $@ $^
1001alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
1002 rm -f $@
1003 $(TEST_AR) crT $@ $^
1004libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
1005 rm -f $@
1006 $(TEST_AR) crT $@ $^
1007alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
1008 rm -f $@
1009 $(TEST_AR) crT $@ $^
1010libthinall.a: libthin3.a alt/libthin4.a
1011 rm -f $@
1012 $(TEST_AR) crT $@ $^
1013alt/thin_archive_test_2.o: thin_archive_test_2.cc
1014 test -d alt || mkdir -p alt
1015 $(CXXCOMPILE) -c -o $@ $<
1016alt/thin_archive_test_4.o: thin_archive_test_4.cc
1017 test -d alt || mkdir -p alt
1018 $(CXXCOMPILE) -c -o $@ $<
1019
89fc3421
CC
1020if PLUGINS
1021
1022check_PROGRAMS += plugin_test_1
1023check_SCRIPTS += plugin_test_1.sh
1024check_DATA += plugin_test_1.err
1025MOSTLYCLEANFILES += plugin_test_1.err
abc8dcba
CC
1026plugin_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
1027 $(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
89fc3421
CC
1028plugin_test_1.err: plugin_test_1
1029 @touch plugin_test_1.err
1030
1031check_PROGRAMS += plugin_test_2
1032check_SCRIPTS += plugin_test_2.sh
1033check_DATA += plugin_test_2.err
1034MOSTLYCLEANFILES += plugin_test_2.err
1035plugin_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
1036 $(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
1037plugin_test_2.err: plugin_test_2
1038 @touch plugin_test_2.err
1039
d66a9eb3
CC
1040check_PROGRAMS += plugin_test_3
1041check_SCRIPTS += plugin_test_3.sh
1042check_DATA += plugin_test_3.err
1043MOSTLYCLEANFILES += plugin_test_3.err
1044plugin_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
1045 $(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
1046plugin_test_3.err: plugin_test_3
1047 @touch plugin_test_3.err
1048
0f7c0701
CC
1049check_PROGRAMS += plugin_test_4
1050check_SCRIPTS += plugin_test_4.sh
1051check_DATA += plugin_test_4.err
1052MOSTLYCLEANFILES += plugin_test_4.err
1053plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
1054 $(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
1055plugin_test_4.err: plugin_test_4
1056 @touch plugin_test_4.err
1057
1058plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
1059 $(TEST_AR) cr $@ $^
1060
89fc3421
CC
1061plugin_test.so: plugin_test.o
1062 $(LINK) -Bgcctestdir/ -shared plugin_test.o
1063plugin_test.o: plugin_test.c
1064 $(COMPILE) -O0 -c -fpic -o $@ $<
1065
1066two_file_test_main.syms: two_file_test_main.o
1067 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1068two_file_test_1.syms: two_file_test_1.o
1069 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1070two_file_test_1b.syms: two_file_test_1b.o
1071 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1072two_file_test_2.syms: two_file_test_2.o
1073 $(TEST_READELF) -sW $< >$@ 2>/dev/null
abc8dcba
CC
1074empty.syms:
1075 @echo "" >empty.syms
1076 @echo "Symbol table" >>empty.syms
89fc3421
CC
1077
1078endif PLUGINS
1079
65514900
CC
1080check_PROGRAMS += exclude_libs_test
1081check_SCRIPTS += exclude_libs_test.sh
1082check_DATA += exclude_libs_test.syms
1083MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
2fdd743f 1084 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
65514900
CC
1085exclude_libs_test_SOURCES = exclude_libs_test.c
1086exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
2fdd743f
DK
1087 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1088exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
1089 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
1090 -Wl,--exclude-libs,libexclude_libs_test_3
1091exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
1092 alt/libexclude_libs_test_3.a
65514900
CC
1093exclude_libs_test.syms: exclude_libs_test
1094 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1095libexclude_libs_test_1.a: exclude_libs_test_1.o
1096 $(TEST_AR) rc $@ $^
1097libexclude_libs_test_2.a: exclude_libs_test_2.o
1098 $(TEST_AR) rc $@ $^
2fdd743f
DK
1099alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
1100 test -d alt || mkdir -p alt
1101 $(TEST_AR) rc $@ $^
65514900 1102
805bb01c
DK
1103check_PROGRAMS += local_labels_test
1104local_labels_test.o: ver_test_6.c
1105 $(COMPILE) -g -c -Wa,-L -o $@ $<
1106local_labels_test: local_labels_test.o
1107 $(LINK) -Bgcctestdir/ local_labels_test.o
1108
bb04269c
DK
1109check_PROGRAMS += discard_locals_test
1110check_SCRIPTS += discard_locals_test.sh
1111check_DATA += discard_locals_test.syms
1112MOSTLYCLEANFILES += discard_locals_test.syms
1113discard_locals_test_SOURCES = discard_locals_test.c
1114discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
1115discard_locals_test.syms: discard_locals_test
1116 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1117# '-Wa,-L' is required to preserve the local label used for testing.
1118discard_locals_test.o: discard_locals_test.c
1119 $(COMPILE) -c -Wa,-L -o $@ $<
1120
8a5e3e08
ILT
1121if MCMODEL_MEDIUM
1122check_PROGRAMS += large
1123large_SOURCES = large.c
1124large_CFLAGS = -mcmodel=medium
1125large_DEPENDENCIES = gcctestdir/ld
1126large_LDFLAGS = -Bgcctestdir/
1127endif MCMODEL_MEDIUM
1128
645afe0c
CC
1129# Test that hidden and internal symbols in the main program cannot be
1130# referenced by a shared library.
1131check_SCRIPTS += hidden_test.sh
1132check_DATA += hidden_test.err
1133MOSTLYCLEANFILES += hidden_test hidden_test.err
1134libhidden.so: hidden_test_1.c gcctestdir/ld
1135 $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
1136hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
1137 $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
1138hidden_test.err: hidden_test
1139 @touch hidden_test.err
1140
351a8000
ILT
1141endif GCC
1142endif NATIVE_LINKER
This page took 0.18066 seconds and 4 git commands to generate.