|ARM Technical Support Knowledge Articles|
Since RVCT 4.0 build 697, a new feature for supporting GNU-stack has been added to the compiler, assembler and linker.
The compiler undocumented option
--[no_]execstack causes the compiler to generate or not generate the
.note.GNU-stack ELF section, marking the stack as executable or non-executable. If this option is not used then the
.note section is not generated. Also
The linker will derive executable status of the stack from the
.note.GNU-stack sections in input objects, including library objects. For backwards compatibility, objects without the
.note.GNU-stack are considered as needing executable stack, unless all input objects do not have this section. So if linking the following objects:
.note.GNU-stack, regardless of whether the section's execution flag is set or not
then armlink will set the
FP_X flag for the
PT_GNU_STACK segment in the resultant image, indicating an executable GNU-stack.
The above linker behaviour can be verified with the "
--info execstack" option, for example:
Executable Stack Usage Information. Some input objects have no executable stack information, assumed to require executable stack: main.o
To override the choice made by the linker, use:
More information about
PT_GNU_STACK can be found at: http://sourceware.org/ml/binutils/2003-05/msg00741.html
Did you find this article helpful? Yes No
How can we improve this article?