[PATCH] D130145: [AArch64] Simplify BTI/PAC-RET module flags

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 15:26:00 PDT 2022


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: llvm/lib/IR/AutoUpgrade.cpp:4415-4430
-    // Upgrade branch protection and return address signing module flags. The
-    // module flag behavior for these fields were Error and now they are Min.
-    if (ID->getString() == "branch-target-enforcement" ||
-        ID->getString().startswith("sign-return-address")) {
-      if (auto *Behavior =
-              mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(0))) {
-        if (Behavior->getLimitedValue() == Module::Error) {
----------------
danielkiss wrote:
> In a full LTO build the linker will complain about the mis match between the flags if one of the objects compiled with an older compiler that emitted `Module:Error` for these flags.
The new approach doesnot emit a flag for 0 value, so there won't be an error even with old bitcode files using `Error`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130145/new/

https://reviews.llvm.org/D130145



More information about the llvm-commits mailing list