# Expect script for ld-shared tests
-# Copyright (C) 1994,1995 Free Software Foundation
+# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
&& ![istarget i386-*-elf*] \
&& ![istarget i486-*-elf*] \
&& ![istarget i586-*-elf*] \
+ && ![istarget i386-*-linux*] \
+ && ![istarget i486-*-linux*] \
+ && ![istarget i586-*-linux*] \
+ && ![istarget m68k-*-linux*] \
&& ![istarget mips*-*-irix5*] \
&& ![istarget sparc*-*-elf] \
&& ![istarget sparc*-*-solaris2*] \
return
}
+if { [istarget i386-*-linuxaout*] \
+ || [istarget i486-*-linuxaout*] \
+ || [istarget i586-*-linuxaout*] \
+ || [istarget i386-*-linuxoldld*] \
+ || [istarget i486-*-linuxoldld*] \
+ || [istarget i586-*-linuxoldld*] \
+ || [istarget m68k-*-linuxaout*] } {
+ return
+}
+
set tmpdir tmpdir
set SHCFLAG ""
send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n"
verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat"
catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output
- set exec_output [prune_system_crud $host_triplet $exec_output]
+ set exec_output [prune_warnings $exec_output]
if {![string match "" $exec_output]} then {
send_log "$exec_output\n"
pass "$testname"
}
-# Unfortunately, the gcc argument is -fpic and the cc argument is
-# -KPIC. We have to try both.
-
-set picflag "-fpic"
-send_log "$CC $picflag\n"
-verbose "$CC $picflag"
-catch "exec $CC $picflag" exec_output
-send_log "$exec_output\n"
-verbose "--" "$exec_output"
-if { [string match "*illegal option*" $exec_output] \
- || [string match "*option ignored*" $exec_output] \
- || [string match "*unrecognized option*" $exec_output] \
- || [string match "*passed to ld*" $exec_output] } {
- if [istarget *-*-sunos4*] {
- set picflag "-pic"
- } else {
- set picflag "-KPIC"
+if [istarget mips*-*-*] {
+ set picflag ""
+} else {
+ # Unfortunately, the gcc argument is -fpic and the cc argument is
+ # -KPIC. We have to try both.
+ set picflag "-fpic"
+ send_log "$CC $picflag\n"
+ verbose "$CC $picflag"
+ catch "exec $CC $picflag" exec_output
+ send_log "$exec_output\n"
+ verbose "--" "$exec_output"
+ if { [string match "*illegal option*" $exec_output] \
+ || [string match "*option ignored*" $exec_output] \
+ || [string match "*unrecognized option*" $exec_output] \
+ || [string match "*passed to ld*" $exec_output] } {
+ if [istarget *-*-sunos4*] {
+ set picflag "-pic"
+ } else {
+ set picflag "-KPIC"
+ }
}
}
verbose "Using $picflag to compile PIC code"
} else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
shared_test shnp "shared (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff
} else {
- # SunOS can not handle non PIC code in a shared library
+ # SunOS non PIC shared libraries don't permit some cases of
+ # overriding.
setup_xfail "*-*-sunos4*"
+ # On Linux/m68k this fails because non-pic references to symbols
+ # in the same section may be resolved by the assembler if they
+ # are pc-relative.
+ setup_xfail "m68k-*-linux*"
shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared
} }
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff
} else {
- # SunOS can not handle non PIC code in a shared library
+ # SunOS non PIC shared libraries don't permit some cases of
+ # overriding.
setup_xfail "*-*-sunos4*"
+ # On Linux/m68k this fails because non-pic references to symbols
+ # in the same section may be resolved by the assembler if they
+ # are pc-relative.
+ setup_xfail "m68k-*-linux*"
shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared
}
} else {