[PATCH] D48795: [AArch64] Add support for SHF_ARM_PURECODE.
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 2 04:16:53 PDT 2018
peter.smith added a comment.
I've left a comment about the ABI problems with using SHF_ARM_PURECODE. I've raised an issue to support execute only on AArch64 with the ABI team at Arm.
================
Comment at: ELF/OutputSections.cpp:47
+ if ((Config->EMachine != EM_ARM && Config->EMachine != EM_AARCH64 ) ||
+ !(Flags & SHF_ARM_PURECODE))
Ret |= PF_R;
----------------
As mentioned in D48791 SHF_ARM_PURECODE is defined in the SHF_MASKPROC space and is currently defined for ARM Processor so we shouldn't be using that flag when the machine isn't EM_ARM. I think it is highly likely that a SHF_AARCH64_PURECODE flag gets defined. When that arises this code might be best extracted into a function such as isExecuteOnly(Flags) so that this becomes:
```
if (!isExecuteOnly(Flags))
Ret |= PF_R;
```
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D48795
More information about the llvm-commits
mailing list