summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/ld/testsuite
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-06-10 10:55:58 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-06-10 10:55:58 +0000
commita7e831079363e3bb45f3172f6e59ba48e335682b (patch)
treeee4324eac9a9d66f189fab60498ec42b8226b7fc /gnu/usr.bin/binutils/ld/testsuite
parent467cb0a471d13c5186a6ee166e60b47c30da64e9 (diff)
Bring Cygnus versions into the trunk, keeping our local patches
Diffstat (limited to 'gnu/usr.bin/binutils/ld/testsuite')
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ChangeLog83
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp24
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp24
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp2
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp54
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp41
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp13
7 files changed, 198 insertions, 43 deletions
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ChangeLog b/gnu/usr.bin/binutils/ld/testsuite/ChangeLog
index 38369ce4ef8..4f573a3f23a 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ChangeLog
+++ b/gnu/usr.bin/binutils/ld/testsuite/ChangeLog
@@ -1,3 +1,86 @@
+Wed May 1 16:45:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-sh/sh.exp: Use -O when compiling with -mrelax.
+
+Mon Apr 29 10:33:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * ld-shared/shared.exp: Run the shared library tests on
+ Linux/m68k.
+
+Fri Apr 5 16:20:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-shared/shared.exp: Run the shared library tests on Linux.
+
+Mon Feb 26 12:45:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-shared/shared.exp: Don't use -fpic on MIPS targets.
+
+Wed Jan 31 15:09:57 1996 Jeffrey A Law (law@cygnus.com)
+
+ * ld-srec/srec.exp: Add xfails for hppa*-*-*elf*.
+ * ld-undefined/undefined.exp: Likewise.
+
+Fri Jan 26 18:43:03 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-undefined/undefined.exp: ELF targets should now pass the
+ undefined line test.
+
+Thu Jan 25 15:36:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-empic/empic.exp: Update for change to MIPS disassembler.
+
+Mon Jan 15 15:05:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-bootstrap/bootstrap.exp: Expect failure for mips*-*-irix5*
+ when doing the --static test.
+ * ld-shared/shared.exp: Run tests on mips*-*-irix5*.
+
+Fri Dec 29 12:33:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-bootstrap/bootstrap.exp: On AIX, don't pass the -bI option
+ when creating ld-partial.o.
+
+Tue Dec 26 17:37:23 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: If powerpc*-*-eabi*, use --defsym to define
+ __eabi.
+
+Tue Dec 19 18:01:01 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfails for XCOFF targets.
+
+Fri Dec 15 16:36:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: On a29k targets, use --defsym to define
+ V_SPILL and V_FILL.
+ * ld-srec/sr1.c (V_SPILL, V_FILL): Remove definitions.
+ * ld-srec/sr3.cc: Likewise.
+
+ * ld-srec/srec.exp: Remove i960 COFF setup_xfail.
+
+Sat Dec 2 01:20:31 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Don't use [] in setup_xfail expressions.
+
+Fri Dec 1 13:18:18 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfails for MIPS ELF targets.
+
+Wed Nov 29 13:01:10 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfail for i960 COFF targets.
+
+Mon Nov 27 14:36:11 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfail calls for i[345]86-*-aout*.
+
+ * ld-srec/sr1.c (V_SPILL, V_FILL): Define.
+ * ld-srec/sr3.cc: Likewise.
+
+Tue Nov 21 16:05:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-empic/empic.exp: Update for changes in objdump output.
+
Wed Nov 15 17:42:48 1995 Ian Lance Taylor <ian@cygnus.com>
* ld-srec/srec.exp: New tests.
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
index d79891df4cd..00331e3ae6a 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -1,5 +1,5 @@
# Expect script for LD Bootstrap Tests
-# Copyright (C) 1993,1994,1995 Free Software Foundation
+# Copyright (C) 1993, 1994, 1995, 1996 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
@@ -38,13 +38,6 @@ foreach flags {"" "--static" "--traditional-format" "--no-keep-memory"} {
set testname "bootstrap"
}
- # On AIX, you need to specify an import list when using --static.
- if [istarget "*-*-aix*"] {
- if {"$flags" == "--static"} {
- set flags "--static -bI:/lib/syscalls.exp"
- }
- }
-
# This test can only be run if we have the ld build directory,
# since we need the object files.
if {$ld != "$objdir/ld.new"} {
@@ -57,6 +50,21 @@ foreach flags {"" "--static" "--traditional-format" "--no-keep-memory"} {
continue
}
+ # On AIX, you need to specify an import list when using --static.
+ # You only want the import list when creating the final
+ # executable.
+ if [istarget "*-*-aix*"] {
+ if {"$flags" == "--static"} {
+ set flags "--static -bI:/lib/syscalls.exp"
+ }
+ }
+
+ # On Irix 5, linking with --static only works if all the files are
+ # compiled using -non_shared.
+ if {"$flags" == "--static"} {
+ setup_xfail "mips*-*-irix5*"
+ }
+
if ![ld_link $ld tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY"] {
fail $testname
continue
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp
index 937f01aac8f..97cb72ff59b 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp
@@ -99,6 +99,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
# This is a straight function call. All function calls in
# this example are to either foo or bar.
if "0x$dest != $nm_output(foo) && 0x$dest != $nm_output(bar)" {
+ send_log "fail 1\n"
send_log "$line\n"
fail $testname
return
@@ -109,6 +110,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
# Otherwise, it should be lui, and the next instruction
# should be an addiu, followed by an addu to $31.
if { [gets $file l] == -1 } {
+ send_log "fail 2\n"
send_log "$line\n"
fail $testname
return
@@ -118,7 +120,8 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
if [string match "*sll*" $l] {
continue
}
- if ![regexp "lui (\[\$a-z0-9\]+),(\[0-9\]+)" $l whole reg upper] {
+ if ![regexp "lui (\[\$a-z0-9\]+),(\[0-9a-fA-Fx\]+)" $l whole reg upper] {
+ send_log "fail 3\n"
send_log "$line\n"
send_log "$l\n"
fail $testname
@@ -126,12 +129,14 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
}
if { [gets $file l] == -1 } {
+ send_log "fail 4\n"
send_log "$line\n"
fail $testname
return
}
verbose "$l"
if ![regexp "addiu \\$reg,\\$reg,(\[-0-9\]+)" $l whole lower] {
+ send_log "fail 5\n"
send_log "$line\n"
send_log "$l\n"
send_log "addiu \\$reg,\\$reg,(\[-0-9\]+)\n"
@@ -140,12 +145,14 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
}
if { [gets $file l] == -1 } {
+ send_log "fail 6\n"
send_log "$line\n"
fail $testname
return
}
verbose "$l"
if ![regexp "addu \\$reg,\\$reg,\\\$ra" $l] {
+ send_log "fail 7\n"
send_log "$line\n"
send_log "$l\n"
fail $testname
@@ -157,26 +164,34 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
# function, and the next line can be anything.
if { [gets $file l] == -1 } {
+ send_log "fail 8\n"
send_log "$line\n"
fail $testname
return
}
-
+ verbose "$l"
if [string match "*jalr*" $l] {
set dest [expr 0x$addr + 8 + ($upper << 16) + $lower]
if { $dest != $nm_output(foo) && $dest != $nm_output(bar) } {
+ send_log "fail 9\n"
send_log "$line\n"
fail $testname
return
}
} else {
set dest [expr ($upper << 16) + $lower]
- if ![regexp "<\[a-z\]+\\+(\[0-9a-fA-F\]+)>" $label whole offset] {
+ if ![regexp "<(\[.a-z\]+)\\+(\[0-9a-fA-F\]+)>" $label whole base offset] {
+ send_log "fail 10\n"
send_log "$line\n"
fail $testname
return
}
- if "0x$offset + 8 != - $dest" {
+ set offset 0x$offset
+ if { $base == ".foo" } {
+ set offset [expr $offset - ($nm_output(foo) - 0x30)]
+ }
+ if { $offset + 8 != - $dest } {
+ send_log "fail 11\n"
send_log "$line\n"
fail $testname
return
@@ -188,6 +203,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
close $file
if {$balcnt < 10} {
+ send_log "fail 12\n"
fail $testname
} else {
verbose "$balcnt bal instructions"
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp
index 3bd2a654e7a..36e12cc1c0a 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp
@@ -103,7 +103,7 @@ if { [which $CC] == 0 } {
}
if {![ld_assemble $as "-relax $srcdir$subdir/start.s" tmpdir/start.o] \
- || ![ld_compile $CC "-mrelax $srcdir$subdir/sh2.c" tmpdir/sh2.o]} {
+ || ![ld_compile $CC "-O -mrelax $srcdir$subdir/sh2.c" tmpdir/sh2.o]} {
unresolved $testlink
unresolved $testjsr
unresolved $testrun
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp
index 3ad71385919..f6578998c20 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp
@@ -1,5 +1,5 @@
# Expect script for ld-shared tests
-# Copyright (C) 1994,1995 Free Software Foundation
+# Copyright (C) 1994, 1995, 1996 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,11 @@ 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*] \
&& ![istarget sparc*-*-sunos4*] \
@@ -44,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 ""
@@ -136,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"
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp
index 5dfbc0c29ad..f5246f096ef 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp
@@ -210,19 +210,32 @@ proc run_srec_test { test objs } {
global sizeof_headers
global host_triplet
+ set flags ""
+
# If the linker script uses SIZEOF_HEADERS, use a -Ttext argument
# to force both the normal link and the S-record link to be put in
# the same place. We don't always use -Ttext because it interacts
# poorly with a.out.
if { $sizeof_headers } {
- set targ "-Ttext 0x1000"
- } else {
- set targ ""
+ set flags "$flags -Ttext 0x1000"
+ }
+
+ # The a29k compiled code calls V_SPILL and V_FILL. Since we don't
+ # need to run this code, but we don't have definitions for those
+ # functions, we just define them out.
+ if [istarget a29k*-*-*] {
+ set flags "$flags --defsym V_SPILL=0 --defsym V_FILL=0"
+ }
+
+ # PowerPC EABI code calls __eabi.
+ if [istarget powerpc*-*-eabi*] {
+ set flags "$flags --defsym __eabi=0"
}
- if { ![ld_simple_link $ld tmpdir/sr1 "$targ $objs"] \
- || ![ld_simple_link $ld tmpdir/sr2.sr "$targ -oformat srec $objs"] } {
+ if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
+ || ![ld_simple_link $ld tmpdir/sr2.sr "$flags -oformat srec $objs"] } {
+ setup_xfail "hppa*-*-*elf*"
fail $test
return
}
@@ -274,6 +287,19 @@ if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
return
}
+# The i386-aout target is confused: the linker does not put the
+# sections where objdump finds them. I don't know which is wrong.
+setup_xfail "i*86-*-aout*"
+
+# These tests fail on the MIPS ELF target because the GP value in the
+# .reginfo section is not updated when the S-record version is written
+# out.
+setup_xfail "mips*-*-elf*" "mips*-*-irix5*" "mips*-*-irix6*"
+
+# The S-record linker doesn't do the magic TOC handling that XCOFF
+# linkers do.
+setup_xfail "*-*-aix*" "*-*-xcoff*"
+
run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
# Now try linking a C++ program with global constructors and
@@ -290,4 +316,9 @@ if ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/sr3.cc tmpdir/sr3.
return
}
+# See above.
+setup_xfail "i*86-*-aout*"
+setup_xfail "mips*-*-elf*" "mips*-*-irix5*" "mips*-*-irix6*"
+setup_xfail "*-*-aix*" "*-*-xcoff*"
+
run_srec_test $test2 "tmpdir/sr3.o"
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp
index 2e426dd2ed1..208d679f6c1 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp
@@ -63,16 +63,12 @@ checkund $mu $testund
# a COFF file.
setup_xfail "arm*-*-pe*"
+# Just doesn't work for PA ELF. No clue why.
+setup_xfail "hppa*-*-*elf*"
+
set mf "tmpdir/undefined.o: In function `function':"
checkund $mf $testfn
-# ELF targets currently can not get line number information (except
-# for MIPS ELF).
-setup_xfail "*-*-elf*" "*-*-sysv4*" "*-*-unixware*" "*-*-solaris*" "*-*-gnu*"
-setup_xfail "hppa*-*-lites*" "m88*-harris-cxux*" "m88*-*-dgux*"
-setup_xfail "powerpc*-*-eabi*" "*-stratus-*" "*-cbm-*" "*-ncr-*"
-clear_xfail "mips*-*-elf*" "mips*-*-sysv4*" "mips*-*-gnu*"
-
# COFF SH gets this test wrong--it reports line 10, because although
# the jump is at line 9, the function address, and the reloc, is
# stored at the end of the function.
@@ -82,5 +78,8 @@ setup_xfail "sh-*-*"
# a COFF file.
setup_xfail "arm*-*-pe*"
+# Just doesn't work for PA ELF. No clue why.
+setup_xfail "hppa*-*-*elf*"
+
set ml "undefined.c:9: undefined reference to `this_function_is_not_defined'"
checkund $ml $testline