[PATCH] D14571: [ELF2] - Implemented PT_GNU_STACK support, -z execstack option.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 12:32:57 PST 2015


On Mon, Nov 16, 2015 at 12:29 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > What do you mean by legacy? An old loader will just ignore this
> > program header, no?
>
> Sorry, just read that that was not the case.
>
> OK, I think we are all in agreement on the objective: non executable
> stacks by default.
>
> The problem them is that how to do it is dependent on the dynamic
> linker, and we don't have a reliable way saying which dynamic linker
> will be used.
>
> How about
>
> * -z execstack: add the program header marking the stack exectuable.
> * -z noexecstack: add the program header marking the stack non exectuable.
> * If neither, mark the stack non executable if we ever see
> .note.GNU-stack. I.E., use it as an indication that the dynamic linker
> uses that segment.


Is the last one reliable sign that the linker can emit PT_GNU_STACK
segment? If it is, that means compilers knew whether PT_GNU_STACK is
supported or not for each platform, no?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151116/6be05889/attachment.html>


More information about the llvm-commits mailing list