[PATCH] D56554: [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
Rui Ueyama via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 10 16:16:12 PST 2019
ruiu added a comment.
GNU linkers assume that input object files that work with non-executable stack has a .note.GNU-stack section, and they emit a PT_GNU_STACK segment to mark the stack area non-executable if all input files have that marker section.
If restoring default means we implement that behavior, then lld shouldn't do that. That mechanism is error-prone, and the consequence of an error is disabling a major security measure. To be on the safe side, we simply emit unless it is explicitly to not do that by `-z execstack`.
If you add `-z nognustack` as an alias to `-z execstack` (and changing the behavior of `-z execstack` to not add the marker segment at all), I think I'm fine with that.
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