[PATCH] D56554: [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK

Kamil Rytarowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 10 15:15:23 PST 2019


krytarowski added a comment.

In D56554#1353368 <https://reviews.llvm.org/D56554#1353368>, @ruiu wrote:

> The absence of PT_GNU_STACK segment makes stack area executable on systems that recognizes PT_GNU_STACK segment. So, I think if `-z execstack` is specified, we should omit PT_GNU_STACK segment rather than adding it, which I think you guys want. If we do that, it seems `-z nognustack` is a redundant option. That option name is unfortunate (you don't really mean you want an executable stack area), but that's I think still better than adding an option that is very similar to an existing feature.


If we are going to change the meaning of `-z execstack`, can we rename the option in lld? Probably to `-z gnustack` vs `-z nognustack`, probably there is no other use-case than RWX->RW protection change.

Systems like fuchsia don't need/want it either. FreeBSD&Linux recognize this  ELF segment.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56554/new/

https://reviews.llvm.org/D56554





More information about the cfe-commits mailing list