summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorRenlin Li <renlin.li@arm.com>2017-12-11 15:33:18 +0000
committerRenlin Li <renlin.li@arm.com>2017-12-11 15:42:47 +0000
commit4c5ae11b42433dbffc33fbde75c9e415594504d8 (patch)
tree083809de805049eccdd86f0207498b02c1d5e996 /opcodes
parent3c0aa29aab3949363f8b23d062c2e0cb1ccf017a (diff)
[Binutils][Objdump]Check symbol section information while search a mapping symbol backward.
When checking mapping symbols backwardly, the section which defines the symbol is not considerted. This patch fixes this by moving the section checking code into get_sym_code_type () function which is shared by forward and backword mapping symbol searching. opcodes/ 2017-12-11 Petr Pavlu <petr.pavlu@arm.com> Renlin Li <renlin.li@arm.com> * aarch64-dis.c (print_insn_aarch64): Move symbol section check ... (get_sym_code_type): Here. binutils/ 2017-12-11 Renlin Li <renlin.li@arm.com> * testsuite/binutils-all/aarch64/objdump.d: New. * testsuite/binutils-all/aarch64/objdump.s: New.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/aarch64-dis.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 10d9e638e8..7751ef27b1 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-11 Petr Pavlu <petr.pavlu@arm.com>
+ Renlin Li <renlin.li@arm.com>
+
+ * aarch64-dis.c (print_insn_aarch64): Move symbol section check ...
+ (get_sym_code_type): Here.
+
2017-12-03 Alan Modra <amodra@gmail.com>
* ppc-opc.c (extract_li20): Rewrite.
diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c
index df67a066fd..8fd1ecfc92 100644
--- a/opcodes/aarch64-dis.c
+++ b/opcodes/aarch64-dis.c
@@ -3097,6 +3097,10 @@ get_sym_code_type (struct disassemble_info *info, int n,
unsigned int type;
const char *name;
+ /* If the symbol is in a different section, ignore it. */
+ if (info->section != NULL && info->section != info->symtab[n]->section)
+ return FALSE;
+
es = *(elf_symbol_type **)(info->symtab + n);
type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
@@ -3171,9 +3175,7 @@ print_insn_aarch64 (bfd_vma pc,
addr = bfd_asymbol_value (info->symtab[n]);
if (addr > pc)
break;
- if ((info->section == NULL
- || info->section == info->symtab[n]->section)
- && get_sym_code_type (info, n, &type))
+ if (get_sym_code_type (info, n, &type))
{
last_sym = n;
found = TRUE;