aboutsummaryrefslogtreecommitdiff
path: root/include/elf
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-11-10 08:49:05 +1030
committerAlan Modra <amodra@gmail.com>2021-11-15 12:20:13 +1030
commit7aba54da426b9999085d8f84e7896b8afdbb9ca6 (patch)
tree58612237fa11e0a5f5a9c001163a4c979c8482d8 /include/elf
parent64f5c8167b1bf098d7e054fb32a65bc252f9d18b (diff)
downloadgdb-7aba54da426b9999085d8f84e7896b8afdbb9ca6.zip
gdb-7aba54da426b9999085d8f84e7896b8afdbb9ca6.tar.gz
gdb-7aba54da426b9999085d8f84e7896b8afdbb9ca6.tar.bz2
PowerPC64 @notoc in non-power10 code
R_PPC64_REL24_P9NOTOC is a variant of R_PPC64_REL24_NOTOC for use on @notoc cals from non-power10 code in the rare case that using such a construct is useful. R_PPC64_REL24_P9NOTOC will be emitted by gas rather than R_PPC64_REL24_NOTOC when @notoc is used in a branch instruction if power10 instructions are not enabled at that point. The new relocation tells the linker to not use power10 instructions on any stub emitted for that branch, unless overridden by --power10-stubs=yes. The current linker heuristic of only generating power10 instructions for stubs if power10-only relocations are detected, continues to be used. include/ * elf/ppc64.h (R_PPC64_REL24_P9NOTOC): Define. bfd/ * reloc.c (BFD_RELOC_PPC64_REL24_P9NOTOC): Define. * elf64-ppc.c (ppc64_elf_howto_raw): Add entry for new reloc. (ppc64_elf_reloc_type_lookup): Handle it. (enum ppc_stub_type): Delete. (enum ppc_stub_main_type, ppc_stub_sub_type): New. (struct ppc_stub_type): New. (struct ppc_stub_hash_entry): Use the above new type. (struct ppc_link_hash_table): Update stub_count. (is_branch_reloc, ppc64_elf_check_relocs), (toc_adjusting_stub_needed): Handle new reloc. (stub_hash_newfunc, select_alt_stub, ppc_merge_stub), (ppc_type_of_stub, plt_stub_size, build_plt_stub), (build_tls_get_addr_head, build_tls_get_addr_tail), (ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_size_stubs), (ppc64_elf_build_stubs, ppc64_elf_relocate_section): Handle new reloc. Modify stub handling to suit new scheme. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * config/tc-ppc.c (ppc_elf_suffix): When power10 is not enabled return BFD_RELOC_PPC64_REL24_P9NOTOC for @notoc. (fixup_size, ppc_force_relocation, ppc_fix_adjustable): Handle BFD_RELOC_PPC64_REL24_P9NOTOC. ld/ * testsuite/ld-powerpc/callstub-2.s: Add .machine power10.
Diffstat (limited to 'include/elf')
-rw-r--r--include/elf/ppc64.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h
index e9f72b0..2d503c1 100644
--- a/include/elf/ppc64.h
+++ b/include/elf/ppc64.h
@@ -162,6 +162,7 @@ START_RELOC_NUMBERS (elf_ppc64_reloc_type)
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_REL24_P9NOTOC, 124)
RELOC_NUMBER (R_PPC64_D34, 128)
RELOC_NUMBER (R_PPC64_D34_LO, 129)