Fix buggy __syscall6() again.The last argument is stored 8(%rsp),not
(%rsp)
This commit is contained in:
parent
ea670ff2d8
commit
e17817664e
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
musl-tcc
|
||||
File:/src/internal/x86_64/syscall.S
|
||||
Date:2022.04.15
|
||||
Copyright(c) 2022 ziyao.
|
||||
*/
|
||||
|
||||
|
@ -18,34 +19,34 @@
|
|||
|
||||
.type __syscall4,@function
|
||||
__syscall4:
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rdi
|
||||
movq %rdx, %rsi
|
||||
movq %rcx, %rdx
|
||||
movq %r8, %r10
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rdi
|
||||
movq %rdx, %rsi
|
||||
movq %rcx, %rdx
|
||||
movq %r8, %r10
|
||||
syscall
|
||||
retq
|
||||
|
||||
.type __syscall5,@function
|
||||
__syscall5:
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rdi
|
||||
movq %rdx, %rsi
|
||||
movq %rcx, %rdx
|
||||
movq %r8, %r10
|
||||
movq %r9, %r8
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rdi
|
||||
movq %rdx, %rsi
|
||||
movq %rcx, %rdx
|
||||
movq %r8, %r10
|
||||
movq %r9, %r8
|
||||
syscall
|
||||
retq
|
||||
|
||||
.type __syscall6,@function
|
||||
__syscall6:
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rdi
|
||||
movq %rdx, %rsi
|
||||
movq %rcx, %rdx
|
||||
movq %r8, %r10
|
||||
movq %r9, %r8
|
||||
movq (%rsp), %r9 // The last argument is stored on
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rdi
|
||||
movq %rdx, %rsi
|
||||
movq %rcx, %rdx
|
||||
movq %r8, %r10
|
||||
movq %r9, %r8
|
||||
movq 8(%rsp), %r9 // The last argument is stored on
|
||||
// the stack
|
||||
// But do NOT mess up the stack
|
||||
syscall
|
||||
|
|
Loading…
Reference in New Issue