* ld-elfvsb/elfvsb.exp: Don't run any non-PIC tests on powerpc*-linux.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elfvsb / elfvsb.exp
CommitLineData
6fc49d28 1# Expect script for ld-visibility tests
5940a93c 2# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010
aa820537 3# Free Software Foundation, Inc.
6fc49d28 4#
f96b4a7b
NC
5# This file is part of the GNU Binutils.
6#
7# This program is free software; you can redistribute it and/or modify
6fc49d28 8# it under the terms of the GNU General Public License as published by
f96b4a7b 9# the Free Software Foundation; either version 3 of the License, or
6fc49d28 10# (at your option) any later version.
f96b4a7b 11#
6fc49d28
L
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
f96b4a7b 16#
6fc49d28
L
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
f96b4a7b
NC
19# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20# MA 02110-1301, USA.
6fc49d28
L
21#
22# Written by Ian Lance Taylor (ian@cygnus.com)
23# and H.J. Lu (hjl@gnu.org)
24#
25
26# Make sure that ld can generate ELF shared libraries with visibility.
27
6fc49d28
L
28# This test can only be run on a couple of ELF platforms.
29# Square bracket expressions seem to confuse istarget.
19c7c582
AM
30if { ![istarget hppa*64*-*-hpux*] \
31 && ![istarget hppa*-*-linux*] \
32 && ![istarget i?86-*-linux*] \
5940a93c 33 && ![istarget i?86-*-gnu*] \
ad995491 34 && ![istarget ia64-*-linux*] \
6fc49d28 35 && ![istarget m68k-*-linux*] \
66517a2f 36 && ![istarget mips*-*-linux*] \
81cacc15 37 && ![istarget powerpc*-*-linux*] \
4f38fc1c 38 && ![istarget arm*-*-linux*] \
2ffd68ef 39 && ![istarget alpha*-*-linux*] \
9147e853
JJ
40 && ![istarget sparc*-*-linux*] \
41 && ![istarget s390*-*-linux*] \
59758b1c 42 && ![istarget sh\[34\]*-*-linux*] \
9147e853 43 && ![istarget x86_64-*-linux*] } {
6fc49d28
L
44 return
45}
46
47if { [istarget *-*-linux*aout*] \
48 || [istarget *-*-linux*oldld*] } {
49 return
50}
51
04827a14
L
52set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
53foreach t $test_list {
54 # We need to strip the ".d", but can leave the dirname.
55 verbose [file rootname $t]
56 run_dump_test [file rootname $t]
57}
58
3a8260b2
AS
59# The remaining tests can only be run if ld generates native executables.
60if ![isnative] then {return}
61
6fc49d28
L
62set tmpdir tmpdir
63set SHCFLAG ""
a9f844b1 64set shared_needs_pic "no"
6fc49d28
L
65
66if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
67
68 # AIX shared libraries do not seem to support useful features,
69 # like overriding the shared library function or letting the
70 # shared library refer to objects defined in the main program. We
71 # avoid testing those features.
72 set SHCFLAG "-DXCOFF_TEST"
73
74 # The AIX 3.2.5 loader appears to randomly fail when loading
75 # shared libraries from NSF mounted partitions, so we avoid any
76 # potential problems by using a local directory.
77 catch {exec /bin/sh -c "echo $$"} pid
78 set tmpdir /usr/tmp/ld.$pid
79 catch "exec mkdir $tmpdir" exec_status
80
81 # On AIX, we need to explicitly export the symbols the shared
82 # library is going to provide, and need.
83 set file [open $tmpdir/xcoff.exp w]
84 puts $file shlibvar1
85 puts $file shlibvar2
86 puts $file shlib_shlibvar1
87 puts $file shlib_shlibvar2
88 puts $file shlib_shlibcall
89 puts $file shlib_shlibcalled
90 puts $file shlib_checkfunptr1
91 puts $file shlib_getfunptr1
92 puts $file shlib_check
93 close $file
94}
95
a9f844b1
NC
96if [istarget arm*-*-linux*] {
97 # On ARM section anchors can change the symbol pre-emptability for
98 # non-PIC shared libraries, causing these tests to fail. Turn section
99 # anchors off.
100 set SHCFLAG "-fno-section-anchors"
101
102 # On targets that have MOVW the compiler will emit relocations which
103 # the linker doesn't support when compiling -shared without -fpic. The
104 # test to find out whether we want to XFAIL the non-PIC tests requires
105 # a compile - so we pre-calculate it here. We also note that this can
106 # only affect arm*-*-*eabi targets as the old ABI doesn't support v7.
107 if [istarget arm*-*-*eabi] {
108 set file [open $tmpdir/movw-detect.c w]
109 puts $file "void foo(void) { __asm (\"movw r0, #0\"); }"
110 close $file
111 if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] {
112 set shared_needs_pic "yes"
113 }
114 }
115}
116
08c44e65
L
117set support_protected "no"
118
5940a93c
TS
119if { [istarget *-*-linux*]
120 || [istarget *-*-gnu*] } {
360e9586 121 if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
b765d4e3 122 if [ld_simple_link $CC $tmpdir/main "$tmpdir/main.o"] {
08c44e65
L
123 catch "exec $tmpdir/main" support_protected
124 }
125 }
126}
127
6fc49d28
L
128# The test procedure.
129proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
b765d4e3 130 global CC
6fc49d28
L
131 global srcdir
132 global subdir
133 global exec_output
134 global link_output
135 global host_triplet
136 global tmpdir
137
138 if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" }
139
140 # Build the shared library.
141 # On AIX, we need to use an export file.
142 set shared -shared
143 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
144 set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
145 }
b765d4e3 146 if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
7cda33a1 147 if { [ string match $visibility "hidden_undef" ]
1ba54ee0
AM
148 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
149 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
7cda33a1
L
150 pass "$testname"
151 } else { if { [ string match $visibility "protected_undef" ]
1ba54ee0
AM
152 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
153 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
7cda33a1
L
154 pass "$testname"
155 } else {
156 fail "$testname"
157 }}
6fc49d28
L
158 return
159 }
160
161 # Link against the shared library. Use -rpath so that the
162 # dynamic linker can locate the shared library at runtime.
163 # On AIX, we must include /lib in -rpath, as otherwise the loader
164 # can not find -lc.
165 set rpath $tmpdir
166 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
167 set rpath /lib:$tmpdir
168 }
b765d4e3 169 if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
6fc49d28 170 if { [ string match $visibility "hidden" ]
1ba54ee0
AM
171 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
172 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
7cda33a1
L
173 pass "$testname"
174 } else { if { [ string match $visibility "hidden_undef_def" ]
1ba54ee0
AM
175 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
176 && [regexp "undefined reference to \`visibility_def\'" $link_output]
177 && [regexp "undefined reference to \`\.?visibility_func\'" $link_output]
178 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
6fc49d28
L
179 pass "$testname"
180 } else {
181 fail "$testname"
7cda33a1 182 }}
6fc49d28
L
183 return
184 }
185
7cda33a1
L
186 if { [ string match $visibility "hidden" ]
187 || [ string match $visibility "hidden_undef" ]
188 || [ string match $visibility "protected_undef" ] } {
6fc49d28
L
189 fail "$testname"
190 }
191
192 # Run the resulting program
193 send_log "$tmpdir/$progname >$tmpdir/$progname.out\n"
194 verbose "$tmpdir/$progname >$tmpdir/$progname.out"
195 catch "exec $tmpdir/$progname >$tmpdir/$progname.out" exec_output
196 if ![string match "" $exec_output] then {
197 send_log "$exec_output\n"
198 verbose "$exec_output"
199 fail "$testname"
200 return
201 }
202
203 send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n"
204 verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat"
205 catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output
206 set exec_output [prune_warnings $exec_output]
207
208 if {![string match "" $exec_output]} then {
209 send_log "$exec_output\n"
210 verbose "$exec_output"
211 fail "$testname"
212 return
213 }
214
215 pass "$testname"
216}
217
218proc visibility_run {visibility} {
219 global CC
220 global CFLAGS
221 global SHCFLAG
222 global srcdir
223 global subdir
224 global tmpdir
225 global picflag
226 global target_triplet
08c44e65 227 global support_protected
a9f844b1 228 global shared_needs_pic
6fc49d28
L
229
230 if [ string match $visibility "hidden" ] {
231 set VSBCFLAG "-DHIDDEN_TEST"
232 } else { if [ string match $visibility "hidden_normal" ] {
233 set VSBCFLAG "-DHIDDEN_NORMAL_TEST"
7cda33a1
L
234 } else { if [ string match $visibility "hidden_undef" ] {
235 set VSBCFLAG "-DHIDDEN_UNDEF_TEST"
236 } else { if [ string match $visibility "hidden_undef_def" ] {
237 set VSBCFLAG "-DHIDDEN_UNDEF_TEST -DDSO_DEFINE_TEST"
238 } else { if [ string match $visibility "hidden_weak" ] {
239 set VSBCFLAG "-DHIDDEN_WEAK_TEST"
6fc49d28
L
240 } else { if [ string match $visibility "protected" ] {
241 set VSBCFLAG "-DPROTECTED_TEST"
7cda33a1
L
242 } else { if [ string match $visibility "protected_undef" ] {
243 set VSBCFLAG "-DPROTECTED_UNDEF_TEST"
244 } else { if [ string match $visibility "protected_undef_def" ] {
245 set VSBCFLAG "-DPROTECTED_UNDEF_TEST -DDSO_DEFINE_TEST"
246 } else { if [ string match $visibility "protected_weak" ] {
247 set VSBCFLAG "-DPROTECTED_WEAK_TEST"
6fc49d28
L
248 } else {
249 set VSBCFLAG ""
7cda33a1 250 }}}}}}}}}
6fc49d28 251
2893311c
AM
252 if { [istarget powerpc*-*-linux*] } {
253 # Testing non-PIC libraries is a waste of effort on any target.
254 # If you don't pass -fpic or -fPIC to gcc, gcc will assume quite
255 # reasonably that you are not compiling for a shared library.
256 # It can then make optimisations that result in shared library
257 # functions and variables not being overridable. Newer versions
258 # of gcc are more likely to do this.
259 } else {
6fc49d28 260 # Compile the main program.
360e9586 261 if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
6fc49d28
L
262 unresolved "visibility ($visibility) (non PIC)"
263 unresolved "visibility ($visibility)"
264 } else {
265 # The shared library is composed of two files. First compile them
266 # without using -fpic. That should work on an ELF system,
267 # although it will be less efficient because the dynamic linker
268 # will need to do more relocation work. However, note that not
269 # using -fpic will cause some of the tests to return different
270 # results.
360e9586
L
271 if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
272 || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
6fc49d28
L
273 unresolved "visibility ($visibility) (non PIC)"
274 } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
ad995491 275 visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o xcoff
6fc49d28
L
276 } else {
277 # SunOS non PIC shared libraries don't permit some cases of
278 # overriding.
1345a0c0
L
279 if { [ string match $visibility "protected" ]
280 || [ string match $visibility "protected_undef_def" ] } {
08c44e65
L
281 if [ string match $support_protected "no" ] {
282 setup_xfail $target_triplet
283 }
6fc49d28
L
284 } else {
285 setup_xfail "*-*-sunos4*"
286 }
212a6b8e
RH
287
288 # Non-pic code uses name binding rules for applications to
289 # reference variables by gp-relative relocs, which can't be
290 # used with overridable symbols.
ad995491
L
291 if { ![ string match $visibility "hidden_undef" ]
292 && ![ string match $visibility "protected_undef" ] } {
293 setup_xfail "ia64-*-linux*"
212a6b8e 294 setup_xfail "alpha*-*-linux*"
ad995491 295 }
4648dfcf
MS
296 if { ![ string match $visibility "hidden" ]
297 && ![ string match $visibility "hidden_undef" ]
298 && ![ string match $visibility "hidden_undef_def" ]
299 && ![ string match $visibility "protected_undef" ] } {
300 setup_xfail "s390x-*-linux*"
4dc570c2
JJ
301 if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
302 setup_xfail "sparc*-*-linux*"
303 }
4648dfcf 304 }
9147e853 305 setup_xfail "x86_64-*-linux*"
c0d48c0b
DA
306 if { ![istarget hppa*64*-*-linux*] } {
307 setup_xfail "hppa*-*-linux*"
308 }
a9f844b1
NC
309 if [ string match $shared_needs_pic "yes" ] {
310 setup_xfail "arm*-*-linux*"
311 }
212a6b8e 312
6fc49d28
L
313 visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb
314
315 # Test ELF shared library relocations with a non-zero load
316 # address for the library. Near as I can tell, the R_*_RELATIVE
317 # relocations for various targets are broken in the case where
318 # the load address is not zero (which is the default).
1345a0c0
L
319 if { [ string match $visibility "protected" ]
320 || [ string match $visibility "protected_undef_def" ] } {
08c44e65
L
321 if [ string match $support_protected "no" ] {
322 setup_xfail $target_triplet
323 }
6fc49d28
L
324 } else {
325 setup_xfail "*-*-sunos4*"
326 setup_xfail "*-*-linux*libc1"
327 }
d1d8dddf
L
328 if { [ string match $visibility "hidden_normal" ]
329 || [ string match $visibility "hidden_weak" ]
330 || [ string match $visibility "protected" ]
331 || [ string match $visibility "protected_undef_def" ]
332 || [ string match $visibility "protected_weak" ]
333 || [ string match $visibility "normal" ] } {
334 setup_xfail "powerpc-*-linux*"
8c37241b 335 setup_xfail "s390x-*-linux*"
4dc570c2
JJ
336 if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
337 setup_xfail "sparc*-*-linux*"
338 }
d1d8dddf 339 }
ad995491
L
340 if { ![ string match $visibility "hidden_undef" ]
341 && ![ string match $visibility "protected_undef" ] } {
342 setup_xfail "ia64-*-linux*"
212a6b8e 343 setup_xfail "alpha*-*-linux*"
66517a2f 344 setup_xfail "mips*-*-linux*"
ad995491 345 }
9147e853 346 setup_xfail "x86_64-*-linux*"
c0d48c0b
DA
347 if { ![istarget hppa*64*-*-linux*] } {
348 setup_xfail "hppa*-*-linux*"
349 }
a9f844b1
NC
350 if [ string match $shared_needs_pic "yes" ] {
351 setup_xfail "arm*-*-linux*"
352 }
c0d48c0b 353
6fc49d28
L
354 visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \
355 mainnp.o sh1np.o sh2np.o elfvsb \
356 "-T $srcdir/$subdir/elf-offset.ld"
357 } }
358
359 # Now compile the code using -fpic.
360
125c6493
AM
361 if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
362 || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
6fc49d28
L
363 unresolved "visibility ($visibility)"
364 } else {
1345a0c0
L
365 if { [ string match $visibility "protected" ]
366 || [ string match $visibility "protected_undef_def" ] } {
08c44e65
L
367 if [ string match $support_protected "no" ] {
368 setup_xfail $target_triplet
369 }
6fc49d28
L
370 }
371 # SunOS can not compare function pointers correctly
372 if [istarget "*-*-sunos4*"] {
373 visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o sun4
374 } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
375 visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
376 } else {
377 visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb
378 } }
379 }
2893311c 380 }}
6fc49d28 381
2893311c
AM
382 if { [istarget powerpc*-*-linux*] } {
383 # Don't bother.
384 } else {
6fc49d28 385 # Now do the same tests again, but this time compile main.c PIC.
125c6493 386 if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
6fc49d28
L
387 unresolved "visibility ($visibility) (PIC main, non PIC so)"
388 unresolved "visibility ($visibility) (PIC main)"
389 } else {
390 if { [file exists $tmpdir/sh1np.o ] && [ file exists $tmpdir/sh2np.o ] } {
391 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
392 visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff
393 } else {
394 # SunOS non PIC shared libraries don't permit some cases of
395 # overriding.
1345a0c0
L
396 if { [ string match $visibility "protected" ]
397 || [ string match $visibility "protected_undef_def" ] } {
08c44e65
L
398 if [ string match $support_protected "no" ] {
399 setup_xfail $target_triplet
400 }
6fc49d28
L
401 } else {
402 setup_xfail "*-*-sunos4*"
403 }
ad995491
L
404 if { ![ string match $visibility "hidden_undef" ]
405 && ![ string match $visibility "protected_undef" ] } {
406 setup_xfail "ia64-*-linux*"
212a6b8e 407 setup_xfail "alpha*-*-linux*"
ad995491 408 }
4648dfcf
MS
409 if { ![ string match $visibility "hidden" ]
410 && ![ string match $visibility "hidden_undef" ]
411 && ![ string match $visibility "hidden_undef_def" ]
412 && ![ string match $visibility "protected_undef" ] } {
413 setup_xfail "s390x-*-linux*"
4dc570c2
JJ
414 if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainp.o] } {
415 setup_xfail "sparc*-*-linux*"
416 }
4648dfcf 417 }
9147e853 418 setup_xfail "x86_64-*-linux*"
c0d48c0b
DA
419 if { ![istarget hppa*64*-*-linux*] } {
420 setup_xfail "hppa*-*-linux*"
421 }
a9f844b1
NC
422 if [ string match $shared_needs_pic "yes" ] {
423 setup_xfail "arm*-*-linux*"
424 }
c0d48c0b 425
6fc49d28
L
426 visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb
427 }
428 } else {
429 unresolved "visibility (PIC main, non PIC so)"
430 }
431
432 if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } {
1345a0c0
L
433 if { [ string match $visibility "protected" ]
434 || [ string match $visibility "protected_undef_def" ] } {
08c44e65
L
435 if [ string match $support_protected "no" ] {
436 setup_xfail $target_triplet
437 }
6fc49d28
L
438 }
439 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
440 visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o xcoff
441 } else {
442 visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o elfvsb
443 }
444 } else {
445 unresolved "visibility ($visibility) (PIC main)"
446 }
2893311c 447 }}
6fc49d28
L
448}
449
450if [istarget mips*-*-*] {
451 set picflag ""
452} else {
453 # Unfortunately, the gcc argument is -fpic and the cc argument is
454 # -KPIC. We have to try both.
455 set picflag "-fpic"
456 send_log "$CC $picflag\n"
457 verbose "$CC $picflag"
458 catch "exec $CC $picflag" exec_output
459 send_log "$exec_output\n"
460 verbose "--" "$exec_output"
461 if { [string match "*illegal option*" $exec_output] \
462 || [string match "*option ignored*" $exec_output] \
463 || [string match "*unrecognized option*" $exec_output] \
464 || [string match "*passed to ld*" $exec_output] } {
465 if [istarget *-*-sunos4*] {
466 set picflag "-pic"
467 } else {
468 set picflag "-KPIC"
469 }
470 }
471}
472verbose "Using $picflag to compile PIC code"
473
474visibility_run hidden
475visibility_run hidden_normal
7cda33a1
L
476visibility_run hidden_undef
477visibility_run hidden_undef_def
478visibility_run hidden_weak
6fc49d28 479visibility_run protected
7cda33a1
L
480visibility_run protected_undef
481visibility_run protected_undef_def
482visibility_run protected_weak
6fc49d28
L
483visibility_run normal
484
22d5e339
L
485if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } {
486 unresolved "common hidden symbol"
487} else {
488 if ![ld_simple_link $ld tmpdir/common "tmpdir/common.o"] {
489 fail "common hidden symbol"
490 } else {
491 pass "common hidden symbol"
492 }
493}
494
495if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/test.c tmpdir/test.o] } {
496 unresolved "weak hidden symbol"
497} else {
125c6493 498 if { ![ld_compile "$CC -g $CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh3.c tmpdir/sh3.o] } {
22d5e339
L
499 unresolved "weak hidden symbol"
500 } else {
501 if ![ld_simple_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] {
502 fail "weak hidden symbol"
503 } else {
504 if ![ld_simple_link $ld tmpdir/weak "tmpdir/test.o tmpdir/sh3.o"] {
505 fail "weak hidden symbol DSO last"
506 } else {
507 pass "weak hidden symbol DSO last"
508 }
509 if ![ld_simple_link $ld tmpdir/weak "tmpdir/sh3.so tmpdir/test.o"] {
510 fail "weak hidden symbol DSO first"
511 } else {
512 pass "weak hidden symbol DSO first"
513 }
514 }
515 }
516}
517
6fc49d28
L
518if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
519 # Remove the temporary directory.
520 catch "exec rm -rf $tmpdir" exec_status
521}
This page took 0.484895 seconds and 4 git commands to generate.