Skip to content

Commit

Permalink
nasm 2.09 compatibility
Browse files Browse the repository at this point in the history
nasm-2.09 makes `elf' alias to `elf32', thus __OUTPUT_FORMAT__ macro
becomes `elf32' instead of `elf' (on x86). Unmatched macro value causes
omitting .note.GNU-stack marker and creates ELFs with executable stack.
This is unneeded and attracts security policies like SELinux.
  • Loading branch information
slouken committed Feb 24, 2011
1 parent 10e9663 commit 3bbf8b3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions configure.in
Expand Up @@ -740,13 +740,13 @@ AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes
NASMFLAGS="-f macho"
;;
*)
NASMFLAGS="-f elf"
NASMFLAGS="-f elf32"
;;
esac
fi

AC_PATH_PROG(NASM, nasm)
echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
echo "%ifidn __OUTPUT_FORMAT__,elf32" > unquoted-sections
echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
echo "%endif" >> unquoted-sections
CompileNASM unquoted-sections || NASM=""
Expand Down
2 changes: 1 addition & 1 deletion src/hermes/mmx_main.asm
Expand Up @@ -69,6 +69,6 @@ endconvert:
ret

%ifidn __OUTPUT_FORMAT__,elf
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
2 changes: 1 addition & 1 deletion src/hermes/mmxp2_32.asm
Expand Up @@ -400,6 +400,6 @@ _convert_bgr555_cheat:
.L4:
retn

%ifidn __OUTPUT_FORMAT__,elf
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
2 changes: 1 addition & 1 deletion src/hermes/x86_main.asm
Expand Up @@ -70,6 +70,6 @@ endconvert:



%ifidn __OUTPUT_FORMAT__,elf
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
2 changes: 1 addition & 1 deletion src/hermes/x86p_16.asm
Expand Up @@ -485,6 +485,6 @@ _ConvertX86p16_8RGB332:
.L7 pop ebp
retn

%ifidn __OUTPUT_FORMAT__,elf
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
2 changes: 1 addition & 1 deletion src/hermes/x86p_32.asm
Expand Up @@ -1040,6 +1040,6 @@ _ConvertX86p32_8RGB332:
.L4:
retn

%ifidn __OUTPUT_FORMAT__,elf
%ifidn __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%endif

0 comments on commit 3bbf8b3

Please sign in to comment.