diff options
author | Alan Modra <amodra@gmail.com> | 2018-01-17 14:19:08 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-01-17 18:52:57 +1030 |
commit | 1be5d8d3bbec4c9a112114993ac5c85b2b26c4c4 (patch) | |
tree | df7f34ee05bf516ced0b7547c40ea3185087b662 /ld/ChangeLog | |
parent | 9e390558cef76767a98123994c422d0642d86cf8 (diff) | |
download | gdb-1be5d8d3bbec4c9a112114993ac5c85b2b26c4c4.zip gdb-1be5d8d3bbec4c9a112114993ac5c85b2b26c4c4.tar.gz gdb-1be5d8d3bbec4c9a112114993ac5c85b2b26c4c4.tar.bz2 |
PowerPC PLT speculative execution barriers
Spectre variant 2 mitigation for PowerPC and PowerPC64.
bfd/
* elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
(CRSETEQ, BEQCTRM): Define.
(is_nonpic_glink_stub): Don't check bctr.
(ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
(ppc_elf_relax_section): Size speculation barrier.
(output_bctr): New function.
(write_glink_stub): Use output_bctr.
(ppc_elf_relocate_section): Use output_bctr for long branch stub.
(ppc_elf_finish_dynamic_symbol): Likewise.
(ppc_elf_finish_dynamic_sections): Use output_bctr.
* elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
* elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
(GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
(size_global_entry_stubs): Handle speculation barrier sizing.
(plt_stub_size): Likewise.
(output_bctr): New function.
(build_plt_stub, build_tls_get_addr_stub): Output speculation
barrier.
(ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
(ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
(build_global_entry_stubs): Output speculation barrier.
(ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
* elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
gold/
* options.h (speculate_indirect_jumps): New option.
* powerpc.cc (beqctrm, beqctrlm, crseteq): New insn constants.
(output_bctr): New function.
(Stub_table::plt_call_size): Add space for speculation barrier.
(Stub_table::branch_stub_size): Likewise.
(Output_data_glink::pltresolve_size): Likewise.
(Stub_table::do_write): Output speculation barriers.
ld/
* emultempl/ppc32elf.em (params): Init new field.
(OPTION_SPECULATE_INDIRECT_JUMPS): Define.
(OPTION_NO_SPECULATE_INDIRECT_JUMPS): Define.
(PARSE_AND_LIST_LONGOPTS): Handle new options.
(PARSE_AND_LIST_ARGS_CASES): Likewise.
(PARSE_AND_LIST_OPTIONS): Likewise.
* emultempl/ppc64elf.em (params): Init new field.
(OPTION_SPECULATE_INDIRECT_JUMPS): Define.
(OPTION_NO_SPECULATE_INDIRECT_JUMPS): Define.
(PARSE_AND_LIST_LONGOPTS): Handle --speculate-indirect-jumps.
(PARSE_AND_LIST_OPTIONS): Likewise.
(PARSE_AND_LIST_ARGS_CASES): Likewise.
* ld.texinfo (--no-plt-thread-safe): Correct itemx.
(--speculate-indirect-jumps): Document.
* testsuite/ld-powerpc/elfv2exe.d,
* testsuite/ld-powerpc/elfv2so.d,
* testsuite/ld-powerpc/relbrlt.d,
* testsuite/ld-powerpc/powerpc.exp: Disable plt alignment and
speculation barriers on various tests.
Diffstat (limited to 'ld/ChangeLog')
-rw-r--r-- | ld/ChangeLog | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index f95032d..9ee555b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,6 +1,28 @@ 2018-01-17 Alan Modra <amodra@gmail.com> * emultempl/ppc32elf.em (params): Init new field. + (OPTION_SPECULATE_INDIRECT_JUMPS): Define. + (OPTION_NO_SPECULATE_INDIRECT_JUMPS): Define. + (PARSE_AND_LIST_LONGOPTS): Handle new options. + (PARSE_AND_LIST_ARGS_CASES): Likewise. + (PARSE_AND_LIST_OPTIONS): Likewise. + * emultempl/ppc64elf.em (params): Init new field. + (OPTION_SPECULATE_INDIRECT_JUMPS): Define. + (OPTION_NO_SPECULATE_INDIRECT_JUMPS): Define. + (PARSE_AND_LIST_LONGOPTS): Handle --speculate-indirect-jumps. + (PARSE_AND_LIST_OPTIONS): Likewise. + (PARSE_AND_LIST_ARGS_CASES): Likewise. + * ld.texinfo (--no-plt-thread-safe): Correct itemx. + (--speculate-indirect-jumps): Document. + * testsuite/ld-powerpc/elfv2exe.d, + * testsuite/ld-powerpc/elfv2so.d, + * testsuite/ld-powerpc/relbrlt.d, + * testsuite/ld-powerpc/powerpc.exp: Disable plt alignment and + speculation barriers on various tests. + +2018-01-17 Alan Modra <amodra@gmail.com> + + * emultempl/ppc32elf.em (params): Init new field. (enum ppc32_opt): New enum to define OPTION_* values. Add OPTION_PLT_ALIGN and OPTION_NO_PLT_ALIGN. (PARSE_AND_LIST_LONGOPTS): Handle new options. |