diff options
author | Matthew Hiller <hiller@redhat.com> | 2001-03-01 19:13:27 +0000 |
---|---|---|
committer | Matthew Hiller <hiller@redhat.com> | 2001-03-01 19:13:27 +0000 |
commit | 1688b748f19ed942913859467382773a66ed8943 (patch) | |
tree | 052d27558fa7cfaaa79d9624b74ba37b70ecafc8 /ld/testsuite/lib | |
parent | d1b17ab0f362b32de0c012003ff07d745aefe1e6 (diff) | |
download | gdb-1688b748f19ed942913859467382773a66ed8943.zip gdb-1688b748f19ed942913859467382773a66ed8943.tar.gz gdb-1688b748f19ed942913859467382773a66ed8943.tar.bz2 |
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.
Diffstat (limited to 'ld/testsuite/lib')
-rw-r--r-- | ld/testsuite/lib/ld-lib.exp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 11185d8..6c0c7f1 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -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" |