summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2001-02-12 00:21:59 +0000
committerH.J. Lu <hjl@lucon.org>2001-02-12 00:21:59 +0000
commit0f1501c4533343641931c61d1171269ed56b7ebe (patch)
treefb8e381f7a728cfdd62bf6f8e159ce347401deaf /binutils
parent51e6548d27c6d27c993ef45839dfed94779ea86f (diff)
downloadbinutils-redhat-0f1501c4533343641931c61d1171269ed56b7ebe.tar.gz
2001-02-11 H.J. Lu <hjl@gnu.org>
* config/default.exp: Set up gcc_gas_flag. * binutils-all/objcopy.exp (copy_setup): Process gcc_gas_flag for Linux only. * binutils-all/testprog.c: Include <string.h> and don't use exit ().
Diffstat (limited to 'binutils')
-rw-r--r--binutils/testsuite/ChangeLog10
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp6
-rw-r--r--binutils/testsuite/binutils-all/testprog.c5
-rw-r--r--binutils/testsuite/config/default.exp14
4 files changed, 33 insertions, 2 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 5f12ea70ec..ae14227014 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2001-02-11 H.J. Lu <hjl@gnu.org>
+
+ * config/default.exp: Set up gcc_gas_flag.
+
+ * binutils-all/objcopy.exp (copy_setup): Process gcc_gas_flag
+ for Linux only.
+
+ * binutils-all/testprog.c: Include <string.h> and don't use
+ exit ().
+
2001-01-16 Matthew Green <mrg@redhat.com>
* binutils-all/readelf.s-64: Match readelf -S output.
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 430b7fe578..85a320bb40 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -398,6 +398,7 @@ strip_test_with_saving_a_symbol
proc copy_setup { } {
global srcdir
global subdir
+ global gcc_gas_flag
set res [build_wrapper testglue.o];
set flags { debug };
@@ -409,6 +410,11 @@ proc copy_setup { } {
set add_libs "";
}
+ if { [istarget *-*-linux*] } {
+ foreach i $gcc_gas_flag {
+ set flags "additional_flags=$i $flags"
+ }
+ }
if { [target_compile "$srcdir/$subdir/testprog.c $add_libs" tmpdir/testprog executable $flags] != "" } {
return 2
}
diff --git a/binutils/testsuite/binutils-all/testprog.c b/binutils/testsuite/binutils-all/testprog.c
index c2b1856ded..57de4610a6 100644
--- a/binutils/testsuite/binutils-all/testprog.c
+++ b/binutils/testsuite/binutils-all/testprog.c
@@ -1,6 +1,7 @@
/* This program is used to test objcopy and strip. */
#include <stdio.h>
+#include <string.h>
int common;
int global = 1;
@@ -22,9 +23,9 @@ main ()
|| strcmp (string, "string") != 0)
{
printf ("failed\n");
- exit (1);
+ return (1);
}
printf ("ok\n");
- exit (0);
+ return (0);
}
diff --git a/binutils/testsuite/config/default.exp b/binutils/testsuite/config/default.exp
index 2a2802e3a1..6b0039abc1 100644
--- a/binutils/testsuite/config/default.exp
+++ b/binutils/testsuite/config/default.exp
@@ -70,6 +70,20 @@ if ![info exists READELFFLAGS] then {
if ![file isdirectory tmpdir] {catch "exec mkdir tmpdir" status}
+# Make a symlink from tmpdir/gas/as and tmpdir/gas/ld to the assembler
+# and linker in the build tree, so that we can use a -B option to gcc
+# to force it to use the newly built assembler/linker.
+if {![file isdirectory tmpdir/gas]} then {
+ catch "exec mkdir tmpdir/gas" status
+ if {[file isfile ../gas/as-new]} then {
+ catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
+ }
+ if {[file isfile ../ld/ld-new]} then {
+ catch "exec ln -s ../../../ld/ld-new tmpdir/gas/ld" status
+ }
+}
+set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
+
#
# binutils_run
# run a program, returning the output