Skip to content

Commit 4baeffa

Browse files
committed
binutils nm testsuite tidy
We can run the gnu_unique_object symbol test on all ELF targets. Those that don't support the symbol type and fail to assemble can just be resolved as "unsupported". This means binutils_assemble can't report an error on assembly failure, but it probably should never have done that anyway. * testsuite/lib/utils-lib.exp (default_binutils_assemble_flags): Don't perror on assembler diagnostic output. * testsuite/binutils-all/nm.exp: Run unique symbol test on all ELF targets. Resolve as "unsupported" on assembly failure.
1 parent 8af5c48 commit 4baeffa

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

Diff for: binutils/ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2017-12-14 Alan Modra <[email protected]>
2+
3+
* testsuite/lib/utils-lib.exp (default_binutils_assemble_flags):
4+
Don't perror on assembler diagnostic output.
5+
* testsuite/binutils-all/nm.exp: Run unique symbol test on all
6+
ELF targets. Resolve as "unsupported" on assembly failure.
7+
18
2017-12-11 Renlin Li <[email protected]>
29

310
* testsuite/binutils-all/aarch64/objdump.d: New.

Diff for: binutils/testsuite/binutils-all/nm.exp

+16-25
Original file line numberDiff line numberDiff line change
@@ -101,36 +101,27 @@ if {![info exists vars(text_symbol)] \
101101
if [is_elf_format] {
102102
# PR binutils/12753
103103
# Test nm -g on a unique global symbol.
104+
if {![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o]} then {
105+
unsupported "nm -g on unique symbols"
106+
} else {
107+
if [is_remote host] {
108+
set tmpfile [remote_download host tmpdir/unique.o]
109+
} else {
110+
set tmpfile tmpdir/unique.o
111+
}
104112

105-
# Only some targets support unique symbols.
106-
if {([istarget "i?86-*-*"]
107-
|| [istarget "x86_64-*-*"]
108-
|| [istarget "arm-*-*"]
109-
|| [istarget "powerpc*-*-*"]
110-
|| [istarget "sparc*-*-*"])} then {
113+
set got [binutils_run $NM "$NMFLAGS -g $tmpfile"]
111114

112-
if {![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o]} then {
113-
fail "nm -g on unique symbols (assembling)"
115+
if [regexp "u foo" $got] then {
116+
pass "nm -g on unique symbols"
114117
} else {
115-
if [is_remote host] {
116-
set tmpfile [remote_download host tmpdir/unique.o]
117-
} else {
118-
set tmpfile tmpdir/unique.o
119-
}
120-
121-
set got [binutils_run $NM "$NMFLAGS -g $tmpfile"]
122-
123-
if [regexp "u foo" $got] then {
124-
pass "nm -g on unique symbols"
125-
} else {
126-
fail "nm -g on unique symbols"
127-
}
118+
fail "nm -g on unique symbols"
119+
}
128120

129-
if { $verbose < 1 } {
130-
remote_file host delete "tmpdir/unique.o"
131-
}
121+
if { $verbose < 1 } {
122+
remote_file host delete "tmpdir/unique.o"
132123
}
133-
}
124+
}
134125
}
135126

136127
# Test nm -P

Diff for: binutils/testsuite/lib/utils-lib.exp

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ proc default_binutils_assemble_flags { source object asflags } {
127127
} else {
128128
send_log "$exec_output\n"
129129
verbose "$exec_output"
130-
perror "$source: assembly failed"
131130
return 0
132131
}
133132
}

0 commit comments

Comments
 (0)