aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/config/default.exp
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1999-01-03 16:03:47 +0000
committerKen Raeburn <raeburn@cygnus>1999-01-03 16:03:47 +0000
commit687788cd4bf497eb1c8d8ee58e0737887e45500d (patch)
tree9c980d6b8892d91094fc714c997dfbf398a481ae /ld/testsuite/config/default.exp
parent4c49748e82846f92ba0b54ffbf0a698dbeea0607 (diff)
downloadgdb-687788cd4bf497eb1c8d8ee58e0737887e45500d.zip
gdb-687788cd4bf497eb1c8d8ee58e0737887e45500d.tar.gz
gdb-687788cd4bf497eb1c8d8ee58e0737887e45500d.tar.bz2
* config/default.exp (get_link_files, get_target_emul): New procs;
run shell commands to extract information from configure.host and configure.tgt in the source tree. (top level): Use them to get information needed to run tests, if not otherwise provided. Should allow running of at least some of the tests by releng. * ld-shared/elf-offset.ld: New file. Builds a shared library, but gives non-zero addresses for memory region. * ld-shared/shared.exp: Run the non-PIC non-AIX test again using the new linker script. PR ld/17962 -- not fixed, but customer has what should be an adequate workaround.
Diffstat (limited to 'ld/testsuite/config/default.exp')
-rw-r--r--ld/testsuite/config/default.exp66
1 files changed, 59 insertions, 7 deletions
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index 24c04b8..f1863f5 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -1,5 +1,5 @@
# Basic expect script for LD Regression Tests
-# Copyright (C) 1993,1994 Free Software Foundation
+# Copyright (C) 1993, 1994, 1995, 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
@@ -13,31 +13,83 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Written by Jeffrey Wheat (cassidy@cygnus.com)
#
if ![info exists ld] then {
- set ld [findfile $objdir/ld.new $objdir/ld.new [transform ld]]
+ set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
}
if ![info exists as] then {
- set as [findfile $base_dir/../gas/as.new $base_dir/../gas/as.new [transform as]]
+ set as [findfile $base_dir/../gas/as-new $base_dir/../gas/as-new [transform as]]
}
if ![info exists nm] then {
- set nm [findfile $base_dir/../binutils/nm.new $base_dir/../binutils/nm.new [transform nm]]
+ set nm [findfile $base_dir/../binutils/nm-new $base_dir/../binutils/nm-new [transform nm]]
}
if ![info exists objdump] then {
set objdump [findfile $base_dir/../binutils/objdump]
}
-if ![file isdirectory tmpdir] {catch "exec mkdir tmpdir" status}
+if ![info exists objcopy] then {
+ set objcopy [findfile $base_dir/../binutils/objcopy]
+}
+
+if ![info exists ar] then {
+ set ar [findfile $base_dir/../binutils/ar]
+}
+
+if ![info exists strip] then {
+ set strip [findfile $base_dir/../binutils/strip-new $base_dir/../binutils/strip-new [transform strip]]
+}
+
+if {![file isdirectory tmpdir]} then {
+ catch "exec mkdir tmpdir" status
+}
+
+# Make a symlink from tmpdir/as to the assembler in the build tree, so
+# that we can use a -B option to gcc to force it to use the newly
+# built assembler.
+if {![file isdirectory tmpdir/gas]} then {
+ catch "exec mkdir tmpdir/gas" status
+ catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
+}
+set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
# load the utility procedures
-load_lib ld.exp
+load_lib ld-lib.exp
+
+proc get_link_files {varname} {
+ global $varname
+ global target_triplet
+ global srcdir
+ global CC
+ if ![info exists $varname] {
+ set status [catch "exec sh -c \"host=$target_triplet && CC=$CC && . $srcdir/../configure.host && eval echo \\$$varname\"" result]
+ if $status { error "Error getting native link files: $result" }
+ set $varname $result
+ }
+}
+
+proc get_target_emul {} {
+ global target_triplet
+ global srcdir
+ set status [catch "exec sh -c \"targ=$target_triplet && . $srcdir/../configure.tgt && echo \\\$targ_emul\"" result]
+ if $status { error "Error getting emulation name: $result" }
+ return $result
+}
+
+if [isnative] {
+ foreach x {HOSTING_CRT0 HOSTING_LIBS} {
+ get_link_files $x
+ }
+} else {
+ foreach x {HOSTING_CRT0 HOSTING_LIBS} { set $x "" }
+}
+if ![info exists HOSTING_EMU] { set HOSTING_EMU "-m [get_target_emul]" }
#
# ld_version -- extract and print the version number of ld compiler (GCC)