aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorDaniel Kiss <daniel.kiss@arm.com>2024-07-10 10:06:14 +0200
committerGitHub <noreply@github.com>2024-07-10 10:06:14 +0200
commite15d67cfc2e5775cc79281aa860f3ad3be628f39 (patch)
tree59e0637b11bddae70cf8021a7c7ed6c6340b5259 /llvm/lib/IR/Function.cpp
parent9ae24c9ac94017e15eb827e25c5693418e6cdb4b (diff)
downloadllvm-e15d67cfc2e5775cc79281aa860f3ad3be628f39.zip
llvm-e15d67cfc2e5775cc79281aa860f3ad3be628f39.tar.gz
llvm-e15d67cfc2e5775cc79281aa860f3ad3be628f39.tar.bz2
[Clang][ARM][AArch64] Alway emit protection attributes for functions. (#82819)
So far branch protection, sign return address, guarded control stack attributes are only emitted as module flags to indicate the functions need to be generated with those features. The problem is in case of an LTO build the module flags are merged with the `min` rule which means if one of the module is not build with sign return address then the features will be turned off for all functions. Due to the functions take the branch-protection and sign-return-address features from the module flags. The sign-return-address is function level option therefore it is expected functions from files that is compiled with -mbranch-protection=pac-ret to be protected. The inliner might inline functions with different set of flags as it doesn't consider the module flags. This patch adds the attributes to all functions and drops the checking of the module flags for the code generation. Module flag is still used for generating the ELF markers. Also drops the "true"/"false" values from the branch-protection-enforcement, branch-protection-pauth-lr, guarded-control-stack attributes as presence of the attribute means it is on absence means off and no other option.
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
0 files changed, 0 insertions, 0 deletions