diff options
author | Jiong Wang <jiong.wang@arm.com> | 2015-03-11 13:44:30 +0000 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2015-03-11 13:44:30 +0000 |
commit | f7cf878e4313bab934b8ce473feb9ece763821cc (patch) | |
tree | f52bd013d6386d61c25f6e6be7e2ec95ffc356db | |
parent | e879c695ef8f542f9bec64bf62a08e5fc55e3197 (diff) | |
download | binutils-f7cf878e4313bab934b8ce473feb9ece763821cc.zip binutils-f7cf878e4313bab934b8ce473feb9ece763821cc.tar.gz binutils-f7cf878e4313bab934b8ce473feb9ece763821cc.tar.bz2 |
[ARM] Backport "Skip private symbol when doing objdump"
2015-03-11 Jiong Wang <jiong.wang@arm.com>
opcodes/
* arm-dis.c (arm_symbol_is_valid): Skip ARM private symbols.
binutils/testsuite/
* binutils-all/arm/rvct_symbol.s: New testcase.
* binutils-all/arm/objdump.exp: Run it.
-rw-r--r-- | binutils/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/arm/objdump.exp | 22 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/arm/rvct_symbol.s | 15 | ||||
-rw-r--r-- | opcodes/ChangeLog | 4 | ||||
-rw-r--r-- | opcodes/arm-dis.c | 7 |
5 files changed, 51 insertions, 2 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index 8e541c0..0864510 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-11 Jiong Wang <jiong.wang@arm.com> + + * binutils-all/arm/rvct_symbol.s: New testcase. + * binutils-all/arm/objdump.exp: Run it. + 2015-02-11 Alan Modra <amodra@gmail.com> Apply from master. diff --git a/binutils/testsuite/binutils-all/arm/objdump.exp b/binutils/testsuite/binutils-all/arm/objdump.exp index 93c44da..272dfee 100644 --- a/binutils/testsuite/binutils-all/arm/objdump.exp +++ b/binutils/testsuite/binutils-all/arm/objdump.exp @@ -86,3 +86,25 @@ if [regexp $want $got] then { } else { fail "multiple input files" } + +if {![binutils_assemble $srcdir/$subdir/rvct_symbol.s tmpdir/rvct_symbol.o]} then { + return +} + +if [is_remote host] { + set objfile [remote_download host tmpdir/rvct_symbol.o] +} else { + set objfile tmpdir/rvct_symbol.o +} + +# Make sure multiple disassemblies come out the same + +set got [binutils_run $OBJDUMP "-D $objfile $objfile"] + +set want "foo.*global_a.*global_b" + +if [regexp $want $got] then { + pass "skip rvct symbol" +} else { + fail "skip rvct symbol" +} diff --git a/binutils/testsuite/binutils-all/arm/rvct_symbol.s b/binutils/testsuite/binutils-all/arm/rvct_symbol.s new file mode 100644 index 0000000..f63240b --- /dev/null +++ b/binutils/testsuite/binutils-all/arm/rvct_symbol.s @@ -0,0 +1,15 @@ + .text +foo: +__tagsym$$0: + add r0, r1, r2 + + .data + .global global_a +__tagsym$$used0: +global_a: + .word 0xcafedead + + .global __tagsym$$used1 +__tagsym$$used1: +global_b: + .word 0xcafecafe diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index e19e382..5541bd0 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2015-03-11 Jiong Wang <jiong.wang@arm.com> + + * arm-dis.c (arm_symbol_is_valid): Skip ARM private symbols. + 2014-12-23 Tristan Gingold <gingold@adacore.com> * configure: Regenerate. diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 8f399fb..3fda1da 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -4558,7 +4558,10 @@ print_insn_data (bfd_vma pc ATTRIBUTE_UNUSED, } /* Disallow mapping symbols ($a, $b, $d, $t etc) from - being displayed in symbol relative addresses. */ + being displayed in symbol relative addresses. + + Also disallow private symbol, with __tagsym$$ prefix, + from ARM RVCT toolchain being displayed. */ bfd_boolean arm_symbol_is_valid (asymbol * sym, @@ -4571,7 +4574,7 @@ arm_symbol_is_valid (asymbol * sym, name = bfd_asymbol_name (sym); - return (name && *name != '$'); + return (name && *name != '$' && strncmp (name, "__tagsym$$", 10)); } /* Parse an individual disassembler option. */ |