aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-03-07 11:06:15 +1030
committerAlan Modra <amodra@gmail.com>2018-03-07 16:56:39 +1030
commit52fe4420b771a0f3b4fc7c6535bbd6e9b279f775 (patch)
tree5c95445c7b005e3ffacf0c1f6af007aa50243c69 /opcodes
parent0118219e1850a05ceb181a4f47a6906c01c17c83 (diff)
downloadgdb-52fe4420b771a0f3b4fc7c6535bbd6e9b279f775.zip
gdb-52fe4420b771a0f3b4fc7c6535bbd6e9b279f775.tar.gz
gdb-52fe4420b771a0f3b4fc7c6535bbd6e9b279f775.tar.bz2
XCOFF disassembler
xcoff (32-bit) objdump accepted but ignored -M options unless -mpowerpc was also given. This patch fixes that, leaving the default as -Mpwr for xcoff. I've also enabled more tests for xcoff targets. binutils/ * configure.ac: Add objdump_private_desc_xcoff for rs6000. * configure: Regenerate. gas/ * testsuite/gas/ppc/aix.exp: Run for rs6000 too. * testsuite/gas/ppc/ppc.exp: Run more tests for non-ELF targets. * testsuite/gas/ppc/machine.d: Don't run for PE targets. opcodes/ * disassemble.c (disassembler): Use bfd_arch_powerpc entry for bfd_arch_rs6000. * disassemble.h (print_insn_rs6000): Delete. * ppc-dis.c (powerpc_init_dialect): Handle rs6000. (disassemble_init_powerpc): Call powerpc_init_dialect for rs6000. (print_insn_rs6000): Delete.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog9
-rw-r--r--opcodes/disassemble.c13
-rw-r--r--opcodes/disassemble.h1
-rw-r--r--opcodes/ppc-dis.c16
4 files changed, 19 insertions, 20 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 9fe7a13..7a309bb 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,12 @@
+2018-03-07 Alan Modra <amodra@gmail.com>
+
+ * disassemble.c (disassembler): Use bfd_arch_powerpc entry for
+ bfd_arch_rs6000.
+ * disassemble.h (print_insn_rs6000): Delete.
+ * ppc-dis.c (powerpc_init_dialect): Handle rs6000.
+ (disassemble_init_powerpc): Call powerpc_init_dialect for rs6000.
+ (print_insn_rs6000): Delete.
+
2018-03-03 Alan Modra <amodra@gmail.com>
* sysdep.h (opcodes_error_handler): Define.
diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
index 78f0995..9fbf603 100644
--- a/opcodes/disassemble.c
+++ b/opcodes/disassemble.c
@@ -375,6 +375,11 @@ disassembler (enum bfd_architecture a,
#endif
#ifdef ARCH_powerpc
case bfd_arch_powerpc:
+#endif
+#ifdef ARCH_rs6000
+ case bfd_arch_rs6000:
+#endif
+#if defined ARCH_powerpc || defined ARCH_rs6000
if (big)
disassemble = print_insn_big_powerpc;
else
@@ -391,14 +396,6 @@ disassembler (enum bfd_architecture a,
disassemble = print_insn_riscv;
break;
#endif
-#ifdef ARCH_rs6000
- case bfd_arch_rs6000:
- if (mach == bfd_mach_ppc_620)
- disassemble = print_insn_big_powerpc;
- else
- disassemble = print_insn_rs6000;
- break;
-#endif
#ifdef ARCH_rl78
case bfd_arch_rl78:
disassemble = rl78_get_disassembler (abfd);
diff --git a/opcodes/disassemble.h b/opcodes/disassemble.h
index 6968700..ee7a9c8 100644
--- a/opcodes/disassemble.h
+++ b/opcodes/disassemble.h
@@ -82,7 +82,6 @@ extern int print_insn_or1k (bfd_vma, disassemble_info *);
extern int print_insn_pdp11 (bfd_vma, disassemble_info *);
extern int print_insn_pj (bfd_vma, disassemble_info *);
extern int print_insn_pru (bfd_vma, disassemble_info *);
-extern int print_insn_rs6000 (bfd_vma, disassemble_info *);
extern int print_insn_s390 (bfd_vma, disassemble_info *);
extern int print_insn_sh64 (bfd_vma, disassemble_info *);
extern int print_insn_spu (bfd_vma, disassemble_info *);
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index a2cfc0b..efa7898 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -340,7 +340,10 @@ powerpc_init_dialect (struct disassemble_info *info)
dialect = ppc_parse_cpu (dialect, &sticky, "vle");
break;
default:
- dialect = ppc_parse_cpu (dialect, &sticky, "power9") | PPC_OPCODE_ANY;
+ if (info->arch == bfd_arch_powerpc)
+ dialect = ppc_parse_cpu (dialect, &sticky, "power9") | PPC_OPCODE_ANY;
+ else
+ dialect = ppc_parse_cpu (dialect, &sticky, "pwr");
break;
}
@@ -431,8 +434,7 @@ disassemble_init_powerpc (struct disassemble_info *info)
last = spe2_opcd_indices[i];
}
- if (info->arch == bfd_arch_powerpc)
- powerpc_init_dialect (info);
+ powerpc_init_dialect (info);
}
/* Print a big endian PowerPC instruction. */
@@ -451,14 +453,6 @@ print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info)
return print_insn_powerpc (memaddr, info, 0, get_powerpc_dialect (info));
}
-/* Print a POWER (RS/6000) instruction. */
-
-int
-print_insn_rs6000 (bfd_vma memaddr, struct disassemble_info *info)
-{
- return print_insn_powerpc (memaddr, info, 1, PPC_OPCODE_POWER);
-}
-
/* Extract the operand value from the PowerPC or POWER instruction. */
static int64_t