[PATCH] D100546: [ARM][AArch64] SLSHardening: make non-comdat thunks possible

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 13:27:55 PDT 2021


danielkiss added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:837-840
+    if ((EnableRetBr || EnableBlr) && DisableComdat) {
+      CmdArgs.push_back("-mllvm");
+      CmdArgs.push_back("-arm-sls-hardening-comdat=false");
+    }
----------------
kristof.beyls wrote:
> I think it would be better if comdat/nocomdat were also communicated through Features.
> It keeps the interface on this part of the code base consistent (no need to introduce a CmdArgs feature); and also makes sure that LTO vs non-LTO builds keep on behaving the same way, as the feature is set per function, not per translation unit.
> 
> I haven't really thought about how to best specify that feature. Maybe just have an extra 2 features: +harden-sls-comdat and +harden-sls-nocomdat?
I almost added a feature for the `harden-sls-noncomdat` but that is not really a HW feature so felt the backed flag is better.
One feature bit seems enough to describe the two states.


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

https://reviews.llvm.org/D100546



More information about the llvm-commits mailing list