[ARM] Skip private symbol when doing objdump
authorJiong Wang <jiong.wang@arm.com>
Tue, 3 Mar 2015 15:00:59 +0000 (15:00 +0000)
committerJiong Wang <jiong.wang@arm.com>
Tue, 3 Mar 2015 15:00:59 +0000 (15:00 +0000)
2015-03-03  Jiong Wang  <jiong.wang@arm.com>

  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
binutils/testsuite/binutils-all/arm/objdump.exp
binutils/testsuite/binutils-all/arm/rvct_symbol.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/arm-dis.c

index ef8efa31d1f13d34f91b70a107a4b9fcadb49bb5..471cc15477268969af1bf3f4273b8afb0fe06b8e 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-03  Jiong Wang  <jiong.wang@arm.com>
+
+       * binutils-all/arm/rvct_symbol.s: New testcase.
+       * binutils-all/arm/objdump.exp: Run it.
+
 2015-02-26  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * binutils-all/update-1.s: New file.
index ce5a42c3f48184ff19d992e86bcd50f860d508b4..cd10c4bdd83abaa8814940d0758d807e150d8761 100644 (file)
@@ -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 (file)
index 0000000..f63240b
--- /dev/null
@@ -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
index 9cdca3cae2c3b7001f19ebfc04dc46c1d13c3123..22408be7af7c7fdc38db0ad1180140bcd169eacc 100644 (file)
@@ -1,3 +1,7 @@
+2015-03-03  Jiong Wang  <jiong.wang@arm.com>
+
+       * arm-dis.c (arm_symbol_is_valid): Skip ARM private symbols.
+
 2015-02-25  Oleg Endo  <olegendo@gcc.gnu.org>
 
        * sh-opc.h (clrs, sets): Mark as arch_sh3_nommu_up instead of
index e0a82c0fbdd6dc48800360343d90d91ba6e17c3a..994586d8a0972bff5af1abfea98dfb40196377a9 100644 (file)
@@ -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.  */
This page took 0.031987 seconds and 4 git commands to generate.