Skip to content

Using rax in x86_64_linux_stub causes a crash if the stack does not have a 16 byte alignment. #3

@artur-augustyniak

Description

@artur-augustyniak

Hey,
When calling printf stub uses rax, so this register is nonzero.
This causes printf to "see" floating point arguments and starts using SSE.
At the same time if the stack does not have the proper alignment asmloader will crash.
With my friend we hopefully solved the problem using another register 'r15' in 'vaarg_converter':
https://github.com/artur-augustyniak/asmloader/blob/makefile_asmloader/stubs/x86_64_linux_stub.nasm#L60
Code causing crash:
https://github.com/artur-augustyniak/asmloader/blob/makefile_asmloader/examples/call_conv64.asm
Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions