[ARM][AArch64] SLSHardening: make non-comdat thunks possible
authorDaniel Kiss <daniel.kiss@arm.com>
Thu, 20 May 2021 15:06:43 +0000 (17:06 +0200)
committerDaniel Kiss <daniel.kiss@arm.com>
Thu, 20 May 2021 15:07:05 +0000 (17:07 +0200)
commit801ab71032e157eb7bcd38efeb6486742a7c53bb
tree09bc16fd26bb87be08bdfec3bca05efd5b20489e
parent5c26f895b66263803074870f82965e71cfc0444f
[ARM][AArch64] SLSHardening: make non-comdat thunks possible

Linker scripts might not handle COMDAT sections. SLSHardeing adds
new section for each __llvm_slsblr_thunk_xN. This new option allows
the generation of the thunks into the normal text section to handle these
exceptional cases.
,comdat or ,noncomdat can be added to harden-sls to control the codegen.
-mharden-sls=[all|retbr|blr],nocomdat.

Reviewed By: kristof.beyls

Differential Revision: https://reviews.llvm.org/D100546
12 files changed:
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
clang/lib/Driver/ToolChains/Arch/ARM.cpp
clang/test/Driver/sls-hardening-options.c
llvm/include/llvm/CodeGen/IndirectThunks.h
llvm/lib/Target/AArch64/AArch64.td
llvm/lib/Target/AArch64/AArch64SLSHardening.cpp
llvm/lib/Target/AArch64/AArch64Subtarget.h
llvm/lib/Target/ARM/ARM.td
llvm/lib/Target/ARM/ARMSLSHardening.cpp
llvm/lib/Target/ARM/ARMSubtarget.h
llvm/test/CodeGen/AArch64/speculation-hardening-sls.ll
llvm/test/CodeGen/ARM/speculation-hardening-sls.ll