From dfdaec14b0db059497b47b515d753b6383772b6b Mon Sep 17 00:00:00 2001 From: Andrew Jenner Date: Mon, 1 Aug 2016 09:42:31 -0700 Subject: Fix some PowerPC VLE BFD issues and add some PowerPC VLE instructions. bfd/ * elf32-ppc.c (is_branch_reloc): Recognise VLE branch relocations. (ppc_elf_howto_raw): Fix dst_mask of R_PPC_VLE_REL15. (ppc_elf_vle_split16): Clear field before inserting. opcodes/ * ppc-opc.c (vle_opcodes): Alias 'e_cmpwi' to 'e_cmpi' and 'e_cmplwi' to 'e_cmpli' instead. (OPVUPRT, OPVUPRT_MASK): Define. (powerpc_opcodes): Add E200Z4 insns. (vle_opcodes): Add context save/restore insns. include/ * opcode/ppc.h (PPC_OPCODE_E200Z4): New define. --- bfd/elf32-ppc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bfd/elf32-ppc.c') diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 81b3d84..8d5131a 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1425,7 +1425,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { "R_PPC_VLE_REL15", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - 0xfe, /* dst_mask */ + 0xfffe, /* dst_mask */ TRUE), /* pcrel_offset */ /* A relative 24 bit branch. */ @@ -3948,7 +3948,8 @@ is_branch_reloc (enum elf_ppc_reloc_type r_type) || r_type == R_PPC_ADDR24 || r_type == R_PPC_ADDR14 || r_type == R_PPC_ADDR14_BRTAKEN - || r_type == R_PPC_ADDR14_BRNTAKEN); + || r_type == R_PPC_ADDR14_BRNTAKEN + || r_type == R_PPC_VLE_REL24); } static void @@ -4899,6 +4900,7 @@ ppc_elf_vle_split16 (bfd *output_bfd, bfd_byte *loc, insn = bfd_get_32 (output_bfd, loc); top5 = value & 0xf800; top5 = top5 << (split16_format == split16a_type ? 9 : 5); + insn &= (split16_format == split16a_type ? ~0x1f007ff : ~0x1f07ff); insn |= top5; insn |= value & 0x7ff; bfd_put_32 (output_bfd, insn, loc); -- cgit v1.1