Linux: fix executable stack in resulting binary which was caused by crypto assembly files missing the GNU-stack note.

This commit is contained in:
Mounir IDRASSI 2017-06-13 01:23:54 +02:00
parent 95bf8f8574
commit ba1fbb688e
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC
5 changed files with 48 additions and 0 deletions

View File

@ -331,3 +331,14 @@
%endif ; __BITS__ != 16
%ifidn __OUTPUT_FORMAT__,elf
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
%endif

View File

@ -905,3 +905,14 @@ end_prologue
%endif
%endif
%ifidn __OUTPUT_FORMAT__,elf
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
%endif

View File

@ -644,3 +644,14 @@ stk_spc equ 20 ; stack space
do_exit
%endif
%ifidn __OUTPUT_FORMAT__,elf
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
%endif

View File

@ -312,3 +312,8 @@ movq %r8, %rdx;
.endif
ret;
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -0,0 +1,10 @@
%ifidn __OUTPUT_FORMAT__,elf
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidn __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
%endif