aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-08-29 14:22:34 +0930
committerAlan Modra <amodra@gmail.com>2019-05-24 10:27:49 +0930
commit5663e321848545857a690f30a780187e3366bd2d (patch)
treec9b730b7593a41e9927039f6fa277610b468d260 /include
parent8acf14351c818d956babe50e61711740f378c941 (diff)
downloadgdb-5663e321848545857a690f30a780187e3366bd2d.zip
gdb-5663e321848545857a690f30a780187e3366bd2d.tar.gz
gdb-5663e321848545857a690f30a780187e3366bd2d.tar.bz2
PowerPC relocations for prefix insns
include/ * elf/ppc64.h (R_PPC64_PLTSEQ_NOTOC, R_PPC64_PLTCALL_NOTOC), (R_PPC64_PCREL_OPT, R_PPC64_D34, R_PPC64_D34_LO, R_PPC64_D34_HI30), (R_PPC64_D34_HA30, R_PPC64_PCREL34, R_PPC64_GOT_PCREL34), (R_PPC64_PLT_PCREL34, R_PPC64_PLT_PCREL34_NOTOC), (R_PPC64_ADDR16_HIGHER34, R_PPC64_ADDR16_HIGHERA34), (R_PPC64_ADDR16_HIGHEST34, R_PPC64_ADDR16_HIGHESTA34), (R_PPC64_REL16_HIGHER34, R_PPC64_REL16_HIGHERA34), (R_PPC64_REL16_HIGHEST34, R_PPC64_REL16_HIGHESTA34), (R_PPC64_D28, R_PPC64_PCREL28): Define. bfd/ * reloc.c (BFD_RELOC_PPC64_D34, BFD_RELOC_PPC64_D34_LO), (BFD_RELOC_PPC64_D34_HI30, BFD_RELOC_PPC64_D34_HA30), (BFD_RELOC_PPC64_PCREL34, BFD_RELOC_PPC64_GOT_PCREL34), (BFD_RELOC_PPC64_PLT_PCREL34), (BFD_RELOC_PPC64_ADDR16_HIGHER34, BFD_RELOC_PPC64_ADDR16_HIGHERA34), (BFD_RELOC_PPC64_ADDR16_HIGHEST34, BFD_RELOC_PPC64_ADDR16_HIGHESTA34), (BFD_RELOC_PPC64_REL16_HIGHER34, BFD_RELOC_PPC64_REL16_HIGHERA34), (BFD_RELOC_PPC64_REL16_HIGHEST34, BFD_RELOC_PPC64_REL16_HIGHESTA34), (BFD_RELOC_PPC64_D28, BFD_RELOC_PPC64_PCREL28): New reloc enums. * elf64-ppc.c (PNOP): Define. (ppc64_elf_howto_raw): Add reloc howtos for new relocations. (ppc64_elf_reloc_type_lookup): Translate new bfd reloc numbers. (ppc64_elf_ha_reloc): Adjust addend for highera34 and highesta34 relocs. (ppc64_elf_prefix_reloc): New function. (struct ppc_link_hash_table): Add notoc_plt. (is_branch_reloc): Add R_PPC64_PLTCALL_NOTOC. (is_plt_seq_reloc): Add R_PPC64_PLT_PCREL34, R_PPC64_PLT_PCREL34_NOTOC, and R_PPC64_PLTSEQ_NOTOC. (ppc64_elf_check_relocs): Handle pcrel got and plt relocs. Set has_pltcall for section on seeing R_PPC64_PLTCALL_NOTOC. Handle possible need for dynamic relocs on non-pcrel powerxx relocs. (dec_dynrel_count): Handle non-pcrel powerxx relocs. (ppc64_elf_inline_plt): Handle R_PPC64_PLTCALL_NOTOC. (toc_adjusting_stub_needed): Likewise. (ppc64_elf_tls_optimize): Handle R_PPC64_PLTSEQ_NOTOC. (ppc64_elf_relocate_section): Handle new powerxx relocs. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * config/tc-ppc.c (ppc_elf_suffix): Support @pcrel, @got@pcrel, @plt@pcrel, @higher34, @highera34, @highest34, and @highesta34. (fixup_size): Handle new powerxx relocs. (md_assemble): Warn for @pcrel on non-prefix insns. Accept @l, @h and @ha on prefix insns, and infer reloc without any @ suffix. Translate powerxx relocs to suit DQ and DS field instructions. Include operand tests as well as opcode test to translate BFD_RELOC_HI16_S to BFD_RELOC_PPC_16DX_HA. (ppc_fix_adjustable): Return false for pcrel GOT and PLT relocs. (md_apply_fix): Handle new powerxx relocs. * config/tc-ppc.h (TC_FORCE_RELOCATION_SUB_LOCAL): Accept BFD_RELOC_PPC64_ADDR16_HIGHER34, BFD_RELOC_PPC64_ADDR16_HIGHERA34, BFD_RELOC_PPC64_ADDR16_HIGHEST34, BFD_RELOC_PPC64_ADDR16_HIGHESTA34, BFD_RELOC_PPC64_D34, and BFD_RELOC_PPC64_D28. * testsuite/gas/ppc/prefix-reloc.d, * testsuite/gas/ppc/prefix-reloc.s: New test. * testsuite/gas/ppc/ppc.exp: Run it.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog12
-rw-r--r--include/elf/ppc64.h24
2 files changed, 36 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index c02b33a..2e84084 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,15 @@
+2019-05-24 Alan Modra <amodra@gmail.com>
+
+ * elf/ppc64.h (R_PPC64_PLTSEQ_NOTOC, R_PPC64_PLTCALL_NOTOC),
+ (R_PPC64_PCREL_OPT, R_PPC64_D34, R_PPC64_D34_LO, R_PPC64_D34_HI30),
+ (R_PPC64_D34_HA30, R_PPC64_PCREL34, R_PPC64_GOT_PCREL34),
+ (R_PPC64_PLT_PCREL34, R_PPC64_PLT_PCREL34_NOTOC),
+ (R_PPC64_ADDR16_HIGHER34, R_PPC64_ADDR16_HIGHERA34),
+ (R_PPC64_ADDR16_HIGHEST34, R_PPC64_ADDR16_HIGHESTA34),
+ (R_PPC64_REL16_HIGHER34, R_PPC64_REL16_HIGHERA34),
+ (R_PPC64_REL16_HIGHEST34, R_PPC64_REL16_HIGHESTA34),
+ (R_PPC64_D28, R_PPC64_PCREL28): Define.
+
2019-05-24 Peter Bergner <bergner@linux.ibm.com>
Alan Modra <amodra@gmail.com>
diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h
index 6dd29cd..e90c7fd 100644
--- a/include/elf/ppc64.h
+++ b/include/elf/ppc64.h
@@ -158,6 +158,30 @@ START_RELOC_NUMBERS (elf_ppc64_reloc_type)
RELOC_NUMBER (R_PPC64_PLTSEQ, 119)
RELOC_NUMBER (R_PPC64_PLTCALL, 120)
+/* Powerxx support. */
+ RELOC_NUMBER (R_PPC64_PLTSEQ_NOTOC, 121)
+ RELOC_NUMBER (R_PPC64_PLTCALL_NOTOC, 122)
+ RELOC_NUMBER (R_PPC64_PCREL_OPT, 123)
+
+ RELOC_NUMBER (R_PPC64_D34, 128)
+ RELOC_NUMBER (R_PPC64_D34_LO, 129)
+ RELOC_NUMBER (R_PPC64_D34_HI30, 130)
+ RELOC_NUMBER (R_PPC64_D34_HA30, 131)
+ RELOC_NUMBER (R_PPC64_PCREL34, 132)
+ RELOC_NUMBER (R_PPC64_GOT_PCREL34, 133)
+ RELOC_NUMBER (R_PPC64_PLT_PCREL34, 134)
+ RELOC_NUMBER (R_PPC64_PLT_PCREL34_NOTOC, 135)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHER34, 136)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA34, 137)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST34, 138)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA34, 139)
+ RELOC_NUMBER (R_PPC64_REL16_HIGHER34, 140)
+ RELOC_NUMBER (R_PPC64_REL16_HIGHERA34, 141)
+ RELOC_NUMBER (R_PPC64_REL16_HIGHEST34, 142)
+ RELOC_NUMBER (R_PPC64_REL16_HIGHESTA34, 143)
+ RELOC_NUMBER (R_PPC64_D28, 144)
+ RELOC_NUMBER (R_PPC64_PCREL28, 145)
+
#ifndef RELOC_MACROS_GEN_FUNC
/* Relocation only used internally by gas or ld. If you need to use
these reloc numbers, you can change them to some other unused value