2001-02-28 Matt Hiller <hiller@redhat.com>
authorMatthew Hiller <hiller@redhat.com>
Thu, 1 Mar 2001 19:13:27 +0000 (19:13 +0000)
committerMatthew Hiller <hiller@redhat.com>
Thu, 1 Mar 2001 19:13:27 +0000 (19:13 +0000)
* testsuite/ld-scripts/crossref.exp: Initialize flags to
[big_or_little_endian].
* testsuite/ld-undefined/undefined.exp: Ditto, and include $flags
in ld invocations.
* testsuite/lib/ld-lib.exp (big_or_little_endian): Recognize -EB,
-eb, EL and el.
(is_endian_output_format): New function.
(default_ld_link): Set flags to [big_or_little_endian] only if ld
is being invoked such that the output format being used is of
known endianness.
(default_ld_simple_link): Ditto.

ld/ChangeLog
ld/testsuite/ld-scripts/crossref.exp
ld/testsuite/ld-undefined/undefined.exp
ld/testsuite/lib/ld-lib.exp

index 53c9dc63d03c7d2f3e141b231f2a9b2135dd59f3..a59d2806f1fea08583f8f05ce5494480c86ac3ac 100644 (file)
@@ -1,3 +1,17 @@
+2001-02-28  Matt Hiller  <hiller@redhat.com>
+
+       * testsuite/ld-scripts/crossref.exp: Initialize flags to
+       [big_or_little_endian].
+       * testsuite/ld-undefined/undefined.exp: Ditto, and include $flags
+       in ld invocations.
+       * testsuite/lib/ld-lib.exp (big_or_little_endian): Recognize -EB,
+       -eb, EL and el.
+       (is_endian_output_format): New function.
+       (default_ld_link): Set flags to [big_or_little_endian] only if ld
+       is being invoked such that the output format being used is of
+       known endianness.
+       (default_ld_simple_link): Ditto.
+
 2001-02-27  Alan Modra  <alan@linuxcare.com.au>
 
        * configure.in (BFD_VERSION): New.
index b52d92c3e13338cea32511f8b218c13ecd0d7fcb..b39f741c06b61d960df223aa771881246077bf55 100644 (file)
@@ -17,7 +17,7 @@ if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \
     return
 }
 
-set flags ""
+set flags [big_or_little_endian]
 
 # 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
index e49b90cc91bfc0c8f67f2f0e1dba77b687390b38..05df5113770aa71afbd7d19a89133eb4e559507d 100644 (file)
@@ -39,12 +39,14 @@ if ![ld_compile "$CC -g" $srcdir/$subdir/undefined.c tmpdir/undefined.o] {
 
 catch "exec rm -f tmpdir/undefined" exec_output
 
+set flags [big_or_little_endian]
+
 # Using -e start prevents the SunOS linker from trying to build a
 # shared library.
-send_log "$ld -e start -o tmpdir/undefined tmpdir/undefined.o\n"
-verbose "$ld -e start -o tmpdir/undefined tmpdir/undefined.o"
+send_log "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o\n"
+verbose "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o"
 
-catch "exec $ld -e start -o tmpdir/undefined tmpdir/undefined.o" exec_output
+catch "exec $ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o" exec_output
 send_log "$exec_output\n"
 verbose "$exec_output"
 
index 11185d825fd8521e9a561a6f3d47719159ca9123..6c0c7f1daa084c56ca4cf75a15dcb63d44b09142 100644 (file)
@@ -43,6 +43,23 @@ proc default_ld_relocate { ld target objects } {
     }
 }
 
+# Check to see if ld is being invoked with a non-endian output format
+
+proc is_endian_output_format { object_flags } {
+
+    if {[string match "*-oformat binary*" $object_flags] ||      \
+        [string match "*-oformat ieee*" $object_flags] ||        \
+       [string match "*-oformat ihex*" $object_flags] ||        \
+       [string match "*-oformat netbsd-core*" $object_flags] || \
+       [string match "*-oformat srec*" $object_flags] ||        \
+       [string match "*-oformat tekhex*" $object_flags] ||      \
+       [string match "*-oformat trad-core*" $object_flags] } then {
+        return 0
+    } else {
+       return 1
+    }
+}
+
 # Look for big-endian or little-endian switches in the multlib
 # options and translate these into a -EB or -EL switch.  Note
 # we cannot rely upon proc process_multilib_options to do this
@@ -59,11 +76,11 @@ proc big_or_little_endian {} {
 
        foreach x $tmp_flags {
            case $x in {
-               {*big*endian eb EB} {
+               {*big*endian eb EB -eb -EB} {
                    set flags " -EB"
                    return $flags
                }
-               {*little*endian el EL} {
+               {*little*endian el EL -el -EL} {
                    set flags " -EL"
                    return $flags
                }
@@ -94,9 +111,12 @@ proc default_ld_link { ld target objects } {
        perror "$ld does not exist"
        return 0
     }
-    
-    set flags [big_or_little_endian]
-    
+
+    if [is_endian_output_format $objects] then {
+       set flags [big_or_little_endian]
+    } else {
+       set flags ""
+    }
     verbose -log "$ld $HOSTING_EMU $flags -o $target $objs $libs"
     
     catch "exec $ld $HOSTING_EMU $flags -o $target $objs $libs" link_output
@@ -122,7 +142,11 @@ proc default_ld_simple_link { ld target objects } {
        return 0
     }
     
-    set flags [big_or_little_endian]
+    if [is_endian_output_format $objects] then {
+       set flags [big_or_little_endian]
+    } else {
+       set flags ""
+    }
     
     verbose -log "$ld $flags -o $target $objects"
     
This page took 0.033182 seconds and 4 git commands to generate.