* lib/ld-lib.exp (default_ld_nm): Run nm with LC_ALL=C to ensure

consistent sorting.
	(run_dump_test): Likewise for objdump/nm/objcopy/readelf.
	* ld-sh/sh64/sh64.exp (run_ld_link_tests): Likewise.
This commit is contained in:
Alan Modra
2002-07-02 23:54:39 +00:00
parent 139e4a7044
commit 3e8cba195d
3 changed files with 112 additions and 78 deletions

View File

@ -1,3 +1,10 @@
2002-07-03 Alan Modra <amodra@bigpond.net.au>
* lib/ld-lib.exp (default_ld_nm): Run nm with LC_ALL=C to ensure
consistent sorting.
(run_dump_test): Likewise for objdump/nm/objcopy/readelf.
* ld-sh/sh64/sh64.exp (run_ld_link_tests): Likewise.
2002-06-29 Hans-Peter Nilsson <hp@bitrange.com>
* ld-mmix/sec-8m.d, ld-mmix/sec-8m.s, ld-mmix/sec-8a.s,
@ -36,9 +43,9 @@
2002-06-07 Nick Clifton <nickc@cambridge.redhat.com>
* ld-scripts/phdrs2.s: Use .p2align instead of .align.
Use section names .foo and .bar instead of .text and .data.
* ld-scripts/phdrs2.t: Refer to .foo and .bar instead of .text
and .data.
Use section names .foo and .bar instead of .text and .data.
* ld-scripts/phdrs2.t: Refer to .foo and .bar instead of .text
and .data.
2002-06-06 David Heine <dlheine@tensilica.com>
@ -206,11 +213,11 @@
2001-03-14 DJ Delorie <dj@redhat.com>
* ld-sh/sh64/endian.dbd: New file, endian tests.
* ld-sh/sh64/endian.dld: Ditto.
* ld-sh/sh64/endian.ld: Ditto.
* ld-sh/sh64/endian.s: Ditto.
* ld-sh/sh64/endian.sbd: Ditto.
* ld-sh/sh64/endian.sld: Ditto.
* ld-sh/sh64/sh64.exp: Add above tests. Add -L option to ld.
* ld-sh/sh64/endian.ld: Ditto.
* ld-sh/sh64/endian.s: Ditto.
* ld-sh/sh64/endian.sbd: Ditto.
* ld-sh/sh64/endian.sld: Ditto.
* ld-sh/sh64/sh64.exp: Add above tests. Add -L option to ld.
2001-03-12 DJ Delorie <dj@redhat.com>
* ld-sh/sh64/relax.exp: New file, test disabling relaxing.
* ld-sh/sh64/relax1.s: Ditto.
@ -1131,9 +1138,9 @@ Wed Jun 9 12:02:33 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
Tue Feb 2 19:15:02 1999 Catherine Moore <clm@cygnus.com>
* ld-selective/selective.exp: Disable test for unsupported
targets. Change tests to check for absence of symbols instead
of address zero.
* ld-selective/selective.exp: Disable test for unsupported
targets. Change tests to check for absence of symbols instead
of address zero.
Mon Jan 18 03:44:52 1999 Ian Lance Taylor <ian@cygnus.com>
@ -1173,10 +1180,10 @@ Sun Dec 6 12:59:37 1998 H.J. Lu <hjl@gnu.org>
Fri Oct 23 16:28:29 1998 Catherine Moore <clm@cygnus.com>
* ld-selective: New directory with new files to test
selective linking.
* ld-selective: New directory with new files to test
selective linking.
* lib/ld-lib.exp (ld_nm): Strip leading underscore from $name.
* lib/ld-lib.exp (ld_nm): Strip leading underscore from $name.
Sun Oct 4 22:17:05 1998 Ian Lance Taylor <ian@cygnus.com>
@ -1793,7 +1800,7 @@ Fri May 27 09:35:04 1994 Ken Raeburn (raeburn@cygnus.com)
Tue May 17 15:06:49 1994 Bill Cox (bill@rtl.cygnus.com)
* ld.bootstrap/bootstrap.exp, lib/ld.exp: Replace error proc
calls with perror calls.
calls with perror calls.
Wed May 11 16:47:46 1994 Ken Raeburn (raeburn@rtl.cygnus.com)

View File

@ -132,6 +132,7 @@ proc run_ld_link_tests { ldtests } {
global readelf
global srcdir
global subdir
global env
set binfile "tmpdir/linked"
@ -199,8 +200,19 @@ proc run_ld_link_tests { ldtests } {
set dumpfile [lindex $actionlist 2]
set binary $dump_prog
send_log "$binary $progopts $binfile > dump.out\n"
catch "exec $binary $progopts $binfile > dump.out" comp_output
# Ensure consistent sorting of symbols
if {[info exists env(LC_ALL)]} {
set old_lc_all $env(LC_ALL)
}
set env(LC_ALL) "C"
set cmd "$binary $progopts $binfile > dump.out"
send_log "$cmd\n"
catch "exec $cmd" comp_output
if {[info exists old_lc_all]} {
set env(LC_ALL) $old_lc_all
} else {
unset env(LC_ALL)
}
set comp_output [prune_warnings $comp_output]
if ![string match "" $comp_output] then {

View File

@ -1,5 +1,5 @@
# Support routines for LD testsuite.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
@ -299,9 +299,19 @@ proc default_ld_nm { nm nmflags object } {
if ![info exists NMFLAGS] { set NMFLAGS "" }
# Ensure consistent sorting of symbols
if {[info exists env(LC_ALL)]} {
set old_lc_all $env(LC_ALL)
}
set env(LC_ALL) "C"
verbose -log "$nm $NMFLAGS $nmflags $object >tmpdir/nm.out"
catch "exec $nm $NMFLAGS $nmflags $object >tmpdir/nm.out" exec_output
if {[info exists old_lc_all]} {
set env(LC_ALL) $old_lc_all
} else {
unset env(LC_ALL)
}
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
set file [open tmpdir/nm.out r]
@ -474,6 +484,8 @@ proc simple_diff { file_1 file_2 } {
# objcopy: FLAGS
# Use the specified program to analyze the assembler or linker
# output file, and pass it FLAGS, in addition to the output name.
# Note that they are run with LC_ALL=C in the environment to give
# consistent sorting of symbols.
#
# source: SOURCE [FLAGS]
# Assemble the file SOURCE.s using the flags in the "as" directive
@ -512,6 +524,7 @@ proc run_dump_test { name } {
global OBJDUMP NM AS OBJCOPY READELF LD
global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS LDFLAGS
global host_triplet runtests
global env
if [string match "*/*" $name] {
set file $name
@ -778,26 +791,28 @@ proc run_dump_test { name } {
# Objcopy, unlike the other two, won't send its output to stdout,
# so we have to run it specially.
set cmd "$binary $progopts $progopts1 $objfile > $dumpfile"
if { $program == "objcopy" } {
set cmd "$binary $progopts $progopts1 $objfile $dumpfile"
send_log "$cmd\n"
catch "exec $cmd" comp_output
set comp_output [prune_warnings $comp_output]
if ![string match "" $comp_output] then {
send_log "$comp_output\n"
fail $testname
return
}
}
# Ensure consistent sorting of symbols
if {[info exists env(LC_ALL)]} {
set old_lc_all $env(LC_ALL)
}
set env(LC_ALL) "C"
send_log "$cmd\n"
catch "exec $cmd" comp_output
if {[info exists old_lc_all]} {
set env(LC_ALL) $old_lc_all
} else {
set cmd "$binary $progopts $progopts1 $objfile > $dumpfile"
send_log "$cmd\n"
catch "exec $cmd" comp_output
set comp_output [prune_warnings $comp_output]
if ![string match "" $comp_output] then {
send_log "$comp_output\n"
fail $testname
return
}
unset env(LC_ALL)
}
set comp_output [prune_warnings $comp_output]
if ![string match "" $comp_output] then {
send_log "$comp_output\n"
fail $testname
return
}
verbose_eval {[file_contents $dumpfile]} 3