diff options
author | Alan Modra <amodra@gmail.com> | 2018-08-29 13:28:21 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-08-31 22:15:05 +0930 |
commit | 4a9699735b04d4629bd3dc418c265e7f0bc1f9ce (patch) | |
tree | 6f92e1b94b3aa09e8a36e65d8d83823c94278ec3 /include | |
parent | f891966ff66639673a5207b94bd68ec928fb68bc (diff) | |
download | gdb-4a9699735b04d4629bd3dc418c265e7f0bc1f9ce.zip gdb-4a9699735b04d4629bd3dc418c265e7f0bc1f9ce.tar.gz gdb-4a9699735b04d4629bd3dc418c265e7f0bc1f9ce.tar.bz2 |
PowerPC64 higher REL16 relocations
There are occasions where someone might want to build a 64-bit
pc-relative offset from 16-bit pieces. This adds the necessary REL16
relocs corresponding to existing ADDR16 relocs that can be used to
build 64-bit absolute values.
include/
* elf/ppc64.h (R_PPC64_REL16_HIGH, R_PPC64_REL16_HIGHA),
(R_PPC64_REL16_HIGHER, R_PPC64_REL16_HIGHERA),
(R_PPC64_REL16_HIGHEST, R_PPC64_REL16_HIGHESTA): Define.
(R_PPC64_LO_DS_OPT, R_PPC64_16DX_HA): Bump value.
bfd/
* reloc.c (BFD_RELOC_PPC64_REL16_HIGH, BFD_RELOC_PPC64_REL16_HIGHA),
(BFD_RELOC_PPC64_REL16_HIGHER, BFD_RELOC_PPC64_REL16_HIGHERA),
(BFD_RELOC_PPC64_REL16_HIGHEST, BFD_RELOC_PPC64_REL16_HIGHESTA):
Define.
* elf64-ppc.c (ppc64_elf_howto_raw): Add new REL16 howtos.
(ppc64_elf_reloc_type_lookup): Translate new REL16 relocs.
(ppc64_elf_check_relocs, ppc64_elf_relocate_section): Handle them.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
gas/
* config/tc-ppc.h (TC_FORCE_RELOCATION_SUB_LOCAL): Allow ADDR16
HIGH, HIGHA, HIGHER, HIGHERA, HIGHEST, and HIGHESTA relocs.
Group 16-bit relocs.
* config/tc-ppc.c (md_apply_fix): Translate those ADDR16 relocs
to REL16 when pcrel. Sort relocs.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 7 | ||||
-rw-r--r-- | include/elf/ppc64.h | 16 |
2 files changed, 18 insertions, 5 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index b8fcefd..63fdde6 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,10 @@ +2018-08-31 Alan Modra <amodra@gmail.com> + + * elf/ppc64.h (R_PPC64_REL16_HIGH, R_PPC64_REL16_HIGHA), + (R_PPC64_REL16_HIGHER, R_PPC64_REL16_HIGHERA), + (R_PPC64_REL16_HIGHEST, R_PPC64_REL16_HIGHESTA): Define. + (R_PPC64_LO_DS_OPT, R_PPC64_16DX_HA): Bump value. + 2018-08-30 Kito Cheng <kito@andestech.com> * opcode/riscv.h (MAX_SUBSET_NUM): New. diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h index 387c1d6..700c9a4 100644 --- a/include/elf/ppc64.h +++ b/include/elf/ppc64.h @@ -159,14 +159,20 @@ START_RELOC_NUMBERS (elf_ppc64_reloc_type) RELOC_NUMBER (R_PPC64_PLTCALL, 120) #ifndef RELOC_MACROS_GEN_FUNC -/* Relocation only used internally by ld. If you need to use these - reloc numbers, you can change them to some other unused value +/* 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 without affecting the ABI. They will never appear in object files. */ - RELOC_NUMBER (R_PPC64_LO_DS_OPT, 128) -/* Reloc only used internally by gas. As above, value is unimportant. */ - RELOC_NUMBER (R_PPC64_16DX_HA, 129) + RELOC_NUMBER (R_PPC64_LO_DS_OPT, 200) + RELOC_NUMBER (R_PPC64_16DX_HA, 201) #endif + RELOC_NUMBER (R_PPC64_REL16_HIGH, 240) + RELOC_NUMBER (R_PPC64_REL16_HIGHA, 241) + RELOC_NUMBER (R_PPC64_REL16_HIGHER, 242) + RELOC_NUMBER (R_PPC64_REL16_HIGHERA, 243) + RELOC_NUMBER (R_PPC64_REL16_HIGHEST, 244) + RELOC_NUMBER (R_PPC64_REL16_HIGHESTA, 245) + /* Power9 split rel16 for addpcis. */ RELOC_NUMBER (R_PPC64_REL16DX_HA, 246) |