-
Notifications
You must be signed in to change notification settings - Fork 11
Description
This assembly instruction changes the section which all future code is added to be the .note.GNU-stack section. This means that code following the inline assembly macro could be added to this section, which is discarded by the linker (the sole purpose of this section is to transmit information to the linker if the stack should be executable).
This can cause linker failures on GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93190), which I have observed while compiling KiCad.
This is needed in the standalone .S files to define that they should have a non-executable stack, but it appears that cpp files will have this section added by the compiler behind the scenes (alternatively, it can also be forced through the flag -z noexecstack or -Wa,--noexecstack).