[PATCH] D74537: [LLD][ELF][AArch64] Change the semantics of -z pac-plt.

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 15 02:19:04 PST 2020


danielkiss marked 2 inline comments as done.
danielkiss added inline comments.


================
Comment at: lld/ELF/Arch/AArch64.cpp:607
   btiEntry = btiHeader && !config->shared;
-  pacEntry = (config->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_PAC);
+  pacEntry = config->pacPlt;
 
----------------
MaskRay wrote:
> Unless I missed something, this change is not needed
If all object has GNU_PROPERTY_AARCH64_FEATURE_1_PAC then it could trigger the PAC protected PLT generation that we want to avoid.
PAC protection for PLT is only needed when explicitly requested because usually it is not needed because PLT.GOT is in a read only memory.
With this change the PAC protected PLT will be generated only in case of -z pac-plt.


================
Comment at: lld/ELF/SyntheticSections.cpp:1404
       addInt(DT_AARCH64_BTI_PLT, 0);
-    if (config->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_PAC)
+    if (config->pacPlt)
       addInt(DT_AARCH64_PAC_PLT, 0);
----------------
MaskRay wrote:
> Unless I missed something, this change is not needed
same as above.


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

https://reviews.llvm.org/D74537





More information about the llvm-commits mailing list