aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-07-01 13:15:47 +0000
committerAlan Modra <amodra@gmail.com>2010-07-01 13:15:47 +0000
commitcef3d14b438107ee5161c22e906fe108d819c15e (patch)
tree90e3743bb3bf49b5e7e84ba6a113731b918c17e7
parent0fb4aa4bfcc2aa61c27132f94cf1656dca137dc9 (diff)
downloadgdb-cef3d14b438107ee5161c22e906fe108d819c15e.zip
gdb-cef3d14b438107ee5161c22e906fe108d819c15e.tar.gz
gdb-cef3d14b438107ee5161c22e906fe108d819c15e.tar.bz2
* lib/ld-lib.exp (default_ld_simple_link): Add $gcc_ld_flag before
any other options in $ld.
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/lib/ld-lib.exp9
2 files changed, 11 insertions, 3 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 5a9fcb9..fdd6a50 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-01 Alan Modra <amodra@gmail.com>
+
+ * lib/ld-lib.exp (default_ld_simple_link): Add $gcc_ld_flag before
+ any other options in $ld.
+
2010-06-29 Alan Modra <amodra@gmail.com>
* ld-maxq/maxq.exp: Delete file.
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 9e8b809..709702a 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1,6 +1,6 @@
# Support routines for LD testsuite.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
@@ -179,17 +179,20 @@ proc default_ld_simple_link { ld target objects } {
# based on the name of the compiler.
set ldexe $ld
set ldparm [string first " " $ld]
+ set ldflags ""
if { $ldparm > 0 } then {
+ set ldflags [string range $ld $ldparm end]
set ldexe [string range $ld 0 $ldparm]
+ set ld $ldexe
}
set ldexe [string replace $ldexe 0 [string last "/" $ldexe] ""]
if {[string match "*gcc*" $ldexe] || [string match "*++*" $ldexe]} then {
- set flags "$gcc_ld_flag $flags"
+ set ldflags "$gcc_ld_flag $ldflags"
}
remote_file host delete $target
- set exec_output [run_host_cmd "$ld" "$flags -o $target $objects"]
+ set exec_output [run_host_cmd "$ld" "$ldflags $flags -o $target $objects"]
set exec_output [prune_warnings $exec_output]
# We don't care if we get a warning about a non-existent start