comment changes
authorIan Lance Taylor <ian@airs.com>
Mon, 4 May 1998 21:44:57 +0000 (21:44 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 4 May 1998 21:44:57 +0000 (21:44 +0000)
ld/testsuite/ld-shared/shared.exp

index b0f006e..d1ea666 100644 (file)
@@ -1,5 +1,5 @@
 # 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
@@ -36,6 +36,10 @@ if { ![istarget i386-*-sysv4*] \
      && ![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*] \
@@ -45,6 +49,16 @@ if { ![istarget i386-*-sysv4*] \
     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 ""
 
@@ -125,7 +139,7 @@ proc shared_test { progname testname main sh1 sh2 dat } {
     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"
@@ -137,23 +151,26 @@ proc shared_test { progname testname main sh1 sh2 dat } {
     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"
@@ -175,8 +192,13 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o]
     } 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
     } }
 
@@ -206,8 +228,13 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/m
         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 {