Hi!
This patch introduces PT_GNU_STACK segment header, which tells the kernel or
dynamic linker whether the binary or library needs executable stack or not.
GCC would need to create
.section .note.GNU-stack, ""
in each object which does not require executable stack and
.section .note.GNU-stack, "x"
in each object which requires executable stack.
For backwards compatibility, objects without this section are considered
as needing executable stack, unless all input objects don't have this
section, in which case no PT_GNU_STACK segment header is created.
During linking, this can be overridden with -z execstack or -z noexecstack.