PowerPC64 --no-pcrel-optimize
authorAlan Modra <amodra@gmail.com>
Wed, 12 Aug 2020 14:01:28 +0000 (23:31 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 12 Aug 2020 22:40:18 +0000 (08:10 +0930)
commit6738c8a7c93cd77a0caa720c6cc21c422561be2c
treefbb7e126a4d5a43d2292ecd1faafb1a781d08dde
parent75e100a30d5dfdd3ac2b0391c17173645fc77633
PowerPC64 --no-pcrel-optimize

This new option effectively ignores R_PPC64_PCREL_OPT, disabling the
optimization of instructions marked by that relocation.  The patch
also disables GOT indirect to GOT/TOC pointer relative code editing
when --no-toc-optimize.

bfd/
* elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
* elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
optimizations when --no-toc-optimize.  Disable R_PPC64_PCREL_OPT
optimization when --no-pcrel-optimize.
ld/
* emultempl/ppc64elf.em (params): Init new field.
(enum ppc64_opt): Add OPTION_NO_PCREL_OPT.
(PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS),
(PARSE_AND_LIST_ARGS_CASES): Support --no-pcrel-optimize.
bfd/ChangeLog
bfd/elf64-ppc.c
bfd/elf64-ppc.h
ld/ChangeLog
ld/emultempl/ppc64elf.em