aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all/nm.exp
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-05-18 16:35:03 +0000
committerNick Clifton <nickc@redhat.com>2011-05-18 16:35:03 +0000
commit0ba0c2b3438846e98e254ea2019901ea42bd986f (patch)
tree1e2a0b65a39459341aac047551429acef698e949 /binutils/testsuite/binutils-all/nm.exp
parent1d06ead6876712e45010dae36b8e4745fa3321ea (diff)
downloadgdb-0ba0c2b3438846e98e254ea2019901ea42bd986f.zip
gdb-0ba0c2b3438846e98e254ea2019901ea42bd986f.tar.gz
gdb-0ba0c2b3438846e98e254ea2019901ea42bd986f.tar.bz2
PR binutils/12753
* nm.c (filter_symbols): Treat unique symbols as global symbols. * doc/binutils.texi (nm): Mention that some lowercase letters actually indicate global symbols. * lib/utils-lib.exp (run_dump_test): Allow nm as a program. * binutils-all/nm.exp: Test running "nm -g" on an object file containing a unique symbol.
Diffstat (limited to 'binutils/testsuite/binutils-all/nm.exp')
-rw-r--r--binutils/testsuite/binutils-all/nm.exp35
1 files changed, 35 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/nm.exp b/binutils/testsuite/binutils-all/nm.exp
index 67d0cbd..685794d 100644
--- a/binutils/testsuite/binutils-all/nm.exp
+++ b/binutils/testsuite/binutils-all/nm.exp
@@ -98,6 +98,41 @@ if {![info exists vars(text_symbol)] \
pass "nm -g"
}
+if [is_elf_format] {
+ # PR binutils/12753
+ # Test nm -g on a unique global symbol.
+
+ # Only some targets support unique symbols.
+ if {([istarget "i?86-*-*"]
+ || [istarget "x86_64-*-*"]
+ || [istarget "arm-*-*"]
+ || [istarget "powerpc*-*-*"]
+ || [istarget "sparc*-*-*"])} then {
+
+ if {![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.o]} then {
+ fail "nm -g on unique symbols (assembling)"
+ } else {
+ if [is_remote host] {
+ set tmpfile [remote_download host tmpdir/unique.o]
+ } else {
+ set tmpfile tmpdir/unique.o
+ }
+
+ set got [binutils_run $NM "$NMFLAGS -g $tmpfile"]
+
+ if [regexp "u foo" $got] then {
+ pass "nm -g on unique symbols"
+ } else {
+ fail "nm -g on unique symbols"
+ }
+
+ if { $verbose < 1 } {
+ remote_file host delete "tmpdir/unique.o"
+ }
+ }
+ }
+}
+
# Test nm -P
# This test does not work correctly on ECOFF targets, because ECOFF