<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 16, 2015 at 12:29 PM, Rafael EspĂ­ndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> What do you mean by legacy? An old loader will just ignore this<br>
> program header, no?<br>
<br>
</span>Sorry, just read that that was not the case.<br>
<br>
OK, I think we are all in agreement on the objective: non executable<br>
stacks by default.<br>
<br>
The problem them is that how to do it is dependent on the dynamic<br>
linker, and we don't have a reliable way saying which dynamic linker<br>
will be used.<br>
<br>
How about<br>
<br>
* -z execstack: add the program header marking the stack exectuable.<br>
* -z noexecstack: add the program header marking the stack non exectuable.<br>
* If neither, mark the stack non executable if we ever see<br>
.note.GNU-stack. I.E., use it as an indication that the dynamic linker<br>
uses that segment.</blockquote><div><br></div><div>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?</div></div></div></div>