Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nasm-2.09 changed __OUTPUT_FORMAT__ derivation #614

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

nasm-2.09 changed __OUTPUT_FORMAT__ derivation #614

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2011-02-24 09:36:07 +0000, Petr Pisar wrote:

While compiling SDL-1.2.14 with newer nasm (Hermes library in x86 assembler is embedded), I found the GNU-stack notice is missing resulting in library marked as requiring executable stack.

I discovered nasm-2.09 changed a way how output format argument (nasm -f elf) becomes a OUTPUT_FORMAT macro used to conditionalize the GNU-stack section:

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

Olde nasm defined OUTPUT_FORMAT as elf'. Version 2.09 defines it as elf32' on x86:

Short aliases \c{win}, \c{elf} and \c{macho} for output formats are
introduced. Each stands for \c{win32}, \c{elf32} and \c{macho32}
accordingly.

Thus SDL compiled with newer nasm misses the section and linker assumes the stack is executable.

On 2011-02-24 09:37:56 +0000, Petr Pisar wrote:

Created attachment 588
Fix

This patch changes the elf' format to elf32' (as the code is used on x86 only). It can be compiled with old and with new nasm successfully. Also I believe it still works with yasm, as it supports `elf32' format too.

On 2011-02-24 09:41:47 +0000, Sam Lantinga wrote:

This fix is in, thanks!
http://hg.libsdl.org/SDL/rev/30e4d724fe98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant