Tidy objdump_symstuff and objdump_dynsymstuff

* testsuite/ld-elfvers/vers.exp (objdump_symstuff): Remove unused
	variable.  Init list_a and list_b to empty.
	(objdump_dynsymstuff): Likewise, and remove undefined list_a
	handling.
	* testsuite/ld-elfweak/elfweak.exp (objdump_symstuff): Similarly.
	(objdump_dynsymstuff): Similarly.
This commit is contained in:
Alan Modra
2020-08-03 10:57:09 +09:30
parent 38883e3839
commit 39d744bdcc
3 changed files with 21 additions and 39 deletions

View File

@@ -1,3 +1,12 @@
2020-08-03 Alan Modra <amodra@gmail.com>
* testsuite/ld-elfvers/vers.exp (objdump_symstuff): Remove unused
variable. Init list_a and list_b to empty.
(objdump_dynsymstuff): Likewise, and remove undefined list_a
handling.
* testsuite/ld-elfweak/elfweak.exp (objdump_symstuff): Similarly.
(objdump_dynsymstuff): Similarly.
2020-07-31 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/indirect.exp: Append -fno-lto to CC.

View File

@@ -261,7 +261,8 @@ proc objdump_symstuff { objdump object expectfile } {
verbose "# Diff'ing: $expectfile $tmpdir/objdump.out" 2
set eof -1
set differences 0
set list_a {}
set list_b {}
while { [gets $file_a line] != $eof } {
if [regexp "^#.*$" $line] then {
@@ -286,7 +287,6 @@ proc objdump_symstuff { objdump object expectfile } {
set line_a [lindex $list_a $i]
set line_b [lindex $list_b $i]
verbose "\t$expectfile: $i: $line_a" 3
verbose "\t/tmp/objdump.out: $i: $line_b" 3
if [regexp $line_a $line_b] then {
@@ -303,17 +303,12 @@ proc objdump_symstuff { objdump object expectfile } {
verbose -log "Line count"
return 0
}
return 1
if $differences<1 then {
return 1
}
return 0
} else {
verbose -log "$exec_output"
return 0
}
}
#
@@ -357,7 +352,8 @@ proc objdump_dynsymstuff { objdump object expectfile } {
verbose "# Diff'ing: $expectfile $tmpdir/objdump.out" 2
set eof -1
set differences 0
set list_a {}
set list_b {}
while { [gets $file_a line] != $eof } {
if [regexp "^#.*$" $line] then {
@@ -378,15 +374,6 @@ proc objdump_dynsymstuff { objdump object expectfile } {
}
close $file_b
# Support empty files.
if { ![info exists list_a] } then {
if { ![info exists list_b] } then {
return 1
}
verbose -log "\t$tmpdir/objdump.out: $list_b"
return 0
}
for { set i 0 } { $i < [llength $list_b] } { incr i } {
set line_b [lindex $list_b $i]
@@ -423,17 +410,12 @@ proc objdump_dynsymstuff { objdump object expectfile } {
verbose -log "Line count"
return 0
}
return 1
if $differences<1 then {
return 1
}
return 0
} else {
verbose -log "$exec_output"
return 0
}
}
#

View File

@@ -103,7 +103,8 @@ proc objdump_symstuff { objdump object expectfile } {
verbose "# Diff'ing: $expectfile $tmpdir/objdump.out" 2
set eof -1
set differences 0
set list_a {}
set list_b {}
while { [gets $file_a line] != $eof } {
if [regexp "^#.*$" $line] then {
@@ -128,7 +129,6 @@ proc objdump_symstuff { objdump object expectfile } {
set line_a [lindex $list_a $i]
set line_b [lindex $list_b $i]
verbose "\t$expectfile: $i: $line_a" 3
verbose "\t/tmp/objdump.out: $i: $line_b" 3
if [regexp $line_a $line_b] then {
@@ -145,17 +145,12 @@ proc objdump_symstuff { objdump object expectfile } {
verbose -log "Line count"
return 0
}
return 1
if $differences<1 then {
return 1
}
return 0
} else {
verbose -log "$exec_output"
return 0
}
}
#
@@ -199,7 +194,8 @@ proc objdump_dynsymstuff { objdump object expectfile } {
verbose "# Diff'ing: $expectfile $tmpdir/objdump.out" 2
set eof -1
set differences 0
set list_a {}
set list_b {}
while { [gets $file_a line] != $eof } {
if [regexp "^#.*$" $line] then {
@@ -256,17 +252,12 @@ proc objdump_dynsymstuff { objdump object expectfile } {
verbose -log "Line count"
return 0
}
return 1
if $differences<1 then {
return 1
}
return 0
} else {
verbose -log "$exec_output"
return 0
}
}
proc build_lib {test libname objs dynsymexp} {