To support non-executable stacks, the linker generates the
PT_GNU_STACK program header when
you specify either:
--arm_linux, because this option implies
The linker derives the executable status of the stack from
the presence of the
.note.GNU-stack section in
If any of the input objects does not contain a
.note.GNU-stacksection, the linker assumes the final image requires an executable stack.
If no input object has a
.note.GNU-stacksection then the linker does not generate a PT_GNU_STACK program header.
If at least one object has a
.note.GNU-stackthen the linker generates a PT_GNU_STACK program header. It is marked non-executable if all input objects have a
.note.GNU-stacksection that is non-executable. In all other cases the program header is marked executable.
To override the choice made by the linker, use:
--execstackto force the use of an executable stack
--no_execstackto force the use of a non-executable stack.