[PATCH] D49456: [AArch64] Support execute-only LOAD segments.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 15:13:58 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/ScriptParser.cpp:491
   Config->SingleRoRx = true;
+  Config->ExecuteOnly = false;
 
----------------
ivanlozano wrote:
> ruiu wrote:
> > I don't think silently disabling a security feature is a good idea. I'd just mark executable sections execute-only even if linker script is in use, because that's what user told to the linker to do. Other option would be to report an error when -execute-only and a linker script is used together, but I think that confuses users as to why that combination is not allowed.
> That's a good point, I agree we shouldn't fail silently here.
> 
> Leaving ExecuteOnly as-is here while setting SingleRoRx to true doesn't make sense to me; there'd be no RX segments to merge the RO segments into. Adding an error here if ExecuteOnly is true might be better. For the error message, something along the lines of "execute-only cannot be used with a linker script containing SECTIONS because this implies -no-rosegment". That be a bit confusing, but it does cover the reason.
You can still use linker scripts along with -execute-only if you carefully write a script so that the script is compatible with execute-only segment, no?



https://reviews.llvm.org/D49456





More information about the llvm-commits mailing list