aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-11-08 08:12:53 +0000
committerNick Clifton <nickc@redhat.com>2004-11-08 08:12:53 +0000
commit977cdf5aa7f4f2183060c150041405abbc2410a9 (patch)
tree0cebac5641d1ecd4b8869005951d8d51ecfa973c /ld
parent998b0029709cba36a9e2da16a83bdcbb6e37b2ae (diff)
downloadfsf-binutils-gdb-977cdf5aa7f4f2183060c150041405abbc2410a9.zip
fsf-binutils-gdb-977cdf5aa7f4f2183060c150041405abbc2410a9.tar.gz
fsf-binutils-gdb-977cdf5aa7f4f2183060c150041405abbc2410a9.tar.bz2
Fix support for PECOFF weak symbols
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-scripts/weak.exp13
-rw-r--r--ld/testsuite/ld-undefined/weak-undef.exp10
-rw-r--r--ld/testsuite/lib/ld-lib.exp16
4 files changed, 41 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index b15f067..99d27ee 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2004-11-08 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
+
+ * testsuite/ld-scripts/weak.exp: Enable test on PE,
+ XFAIL non-i386 PE.
+ * testsuite/ld-undefined/weak-undef.exp: Enable test on PE,
+ XFAIL non-i386 PE.
+ * testsuite/lib/ld-lib.exp (is_pecoff_format): New.
+
2004-11-04 Daniel Jacobowitz <dan@debian.org>
* Makefile.am (ALL_EMULATIONS): Remove earmelf_oabi.o.
diff --git a/ld/testsuite/ld-scripts/weak.exp b/ld/testsuite/ld-scripts/weak.exp
index 3167ea4..8a8072f 100644
--- a/ld/testsuite/ld-scripts/weak.exp
+++ b/ld/testsuite/ld-scripts/weak.exp
@@ -1,6 +1,6 @@
# Test weak symbols.
# By Ian Lance Taylor, Cygnus Solutions.
-# Copyright 2001
+# Copyright 2001, 2004
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
@@ -19,12 +19,17 @@
set testname "weak symbols"
-# This test only works for ELF targets. It ought to work for some
-# a.out targets, but it doesn't.
-if ![is_elf_format] {
+# This test only works for ELF targets.
+# It ought to work for some a.out targets, but it doesn't.
+if {! [is_elf_format] && ! [is_pecoff_format]} {
+ unsupported $testname
return
}
+# Weak symbols are broken for non-i386 PE targets.
+if {! [istarget i?86-*-*]} {
+ setup_xfail *-*-pe*
+}
if {! [ld_assemble $as $srcdir/$subdir/weak1.s tmpdir/weak1.o]
|| ! [ld_assemble $as $srcdir/$subdir/weak2.s tmpdir/weak2.o]} then {
diff --git a/ld/testsuite/ld-undefined/weak-undef.exp b/ld/testsuite/ld-undefined/weak-undef.exp
index fe21a8fc0..e635458 100644
--- a/ld/testsuite/ld-undefined/weak-undef.exp
+++ b/ld/testsuite/ld-undefined/weak-undef.exp
@@ -1,5 +1,5 @@
# Test handling of weak undefined symbols
-# Copyright 2001
+# Copyright 2001, 2004
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
@@ -29,15 +29,23 @@ if { ![istarget *-*-sysv4*] \
&& ![istarget *-*-linux*] \
&& ![istarget *-*-irix5*] \
&& ![istarget *-*-irix6*] \
+ && ![is_pecoff_format] \
&& ![istarget *-*-solaris2*] } then {
+ unsupported $testname
return
}
if { [istarget *-*-linux*aout*] \
|| [istarget *-*-linux*oldld*] } {
+ unsupported $testname
return
}
+# Weak symbols are broken for non-i386 PE targets.
+if {! [istarget i?86-*-*]} {
+ setup_xfail *-*-pe*
+}
+
if {! [ld_assemble $as $srcdir/$subdir/weak-undef.s tmpdir/weak-undef.o]} then {
# It's OK if .weak doesn't work on this target.
unresolved $testname
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 3758937..b4e3f33 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1,5 +1,5 @@
# Support routines for LD testsuite.
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
@@ -417,6 +417,20 @@ proc is_elf64 { binary_file } {
}
#
+# is_pecoff_format
+# true if the object format is known to be PECOFF
+#
+proc is_pecoff_format {} {
+ if { ![istarget *-*-mingw32*] \
+ && ![istarget *-*-cygwin*] \
+ && ![istarget *-*-pe*] } {
+ return 0
+ }
+
+ return 1
+}
+
+#
# simple_diff
# compares two files line-by-line
# returns differences if exist