From d8282f0eb10a1a5759bcca4582098a8369f508f8 Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Tue, 3 Mar 2015 15:00:59 +0000 Subject: [PATCH] [ARM] Skip private symbol when doing objdump 2015-03-03 Jiong Wang opcode/ * 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. --- binutils/testsuite/ChangeLog | 5 +++++ .../testsuite/binutils-all/arm/objdump.exp | 22 +++++++++++++++++++ .../testsuite/binutils-all/arm/rvct_symbol.s | 15 +++++++++++++ opcodes/ChangeLog | 4 ++++ opcodes/arm-dis.c | 7 ++++-- 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 binutils/testsuite/binutils-all/arm/rvct_symbol.s diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index ef8efa31d1f..471cc154772 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-03 Jiong Wang + + * binutils-all/arm/rvct_symbol.s: New testcase. + * binutils-all/arm/objdump.exp: Run it. + 2015-02-26 Andrew Burgess * binutils-all/update-1.s: New file. diff --git a/binutils/testsuite/binutils-all/arm/objdump.exp b/binutils/testsuite/binutils-all/arm/objdump.exp index ce5a42c3f48..cd10c4bdd83 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 00000000000..f63240b62b3 --- /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 9cdca3cae2c..22408be7af7 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2015-03-03 Jiong Wang + + * arm-dis.c (arm_symbol_is_valid): Skip ARM private symbols. + 2015-02-25 Oleg Endo * sh-opc.h (clrs, sets): Mark as arch_sh3_nommu_up instead of diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index e0a82c0fbdd..994586d8a09 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. */ -- 2.30.2