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

Ivan Lozano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 15:07:21 PDT 2018


ivanlozano added inline comments.


================
Comment at: ELF/ScriptParser.cpp:491
   Config->SingleRoRx = true;
+  Config->ExecuteOnly = false;
 
----------------
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.


https://reviews.llvm.org/D49456





More information about the llvm-commits mailing list