x86 asm: align stack to 16-bits for abort() call

Fixes the failing tests that called abort(). For coincidence, only native
tests were failing.

Asked at: https://stackoverflow.com/questions/56324948/why-does-calling-the-c-abort-function-from-an-x86-64-assembly-function-lead-to
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-27 00:00:03 +00:00
parent 48079d0843
commit 6e790042f0
2 changed files with 5 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
* https://github.com/cirosantilli/linux-kernel-module-cheat#x86_64-calling-convention
*/
#define LKMC_EPILOGUE \
add $8, %rsp; \
pop %rbx; \
pop %r12; \
pop %r13; \
@@ -56,6 +57,7 @@ main: \
push %r13; \
push %r12; \
push %rbx; \
sub $8, %rsp; \
main_after_prologue: \
;