https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107971
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- You can use the assembler note to communicate to the linker that the assembly code does not use executable stack. This is all documented in the linker documentation and is not part of gcc documentation.