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
|
musl-tcc
|
||||||
File:/src/internal/x86_64/syscall.S
|
File:/src/internal/x86_64/syscall.S
|
||||||
|
Date:2022.04.15
|
||||||
Copyright(c) 2022 ziyao.
|
Copyright(c) 2022 ziyao.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -18,34 +19,34 @@
|
||||||
|
|
||||||
.type __syscall4,@function
|
.type __syscall4,@function
|
||||||
__syscall4:
|
__syscall4:
|
||||||
movq %rdi, %rax
|
movq %rdi, %rax
|
||||||
movq %rsi, %rdi
|
movq %rsi, %rdi
|
||||||
movq %rdx, %rsi
|
movq %rdx, %rsi
|
||||||
movq %rcx, %rdx
|
movq %rcx, %rdx
|
||||||
movq %r8, %r10
|
movq %r8, %r10
|
||||||
syscall
|
syscall
|
||||||
retq
|
retq
|
||||||
|
|
||||||
.type __syscall5,@function
|
.type __syscall5,@function
|
||||||
__syscall5:
|
__syscall5:
|
||||||
movq %rdi, %rax
|
movq %rdi, %rax
|
||||||
movq %rsi, %rdi
|
movq %rsi, %rdi
|
||||||
movq %rdx, %rsi
|
movq %rdx, %rsi
|
||||||
movq %rcx, %rdx
|
movq %rcx, %rdx
|
||||||
movq %r8, %r10
|
movq %r8, %r10
|
||||||
movq %r9, %r8
|
movq %r9, %r8
|
||||||
syscall
|
syscall
|
||||||
retq
|
retq
|
||||||
|
|
||||||
.type __syscall6,@function
|
.type __syscall6,@function
|
||||||
__syscall6:
|
__syscall6:
|
||||||
movq %rdi, %rax
|
movq %rdi, %rax
|
||||||
movq %rsi, %rdi
|
movq %rsi, %rdi
|
||||||
movq %rdx, %rsi
|
movq %rdx, %rsi
|
||||||
movq %rcx, %rdx
|
movq %rcx, %rdx
|
||||||
movq %r8, %r10
|
movq %r8, %r10
|
||||||
movq %r9, %r8
|
movq %r9, %r8
|
||||||
movq (%rsp), %r9 // The last argument is stored on
|
movq 8(%rsp), %r9 // The last argument is stored on
|
||||||
// the stack
|
// the stack
|
||||||
// But do NOT mess up the stack
|
// But do NOT mess up the stack
|
||||||
syscall
|
syscall
|
||||||
|
|
Loading…
Reference in New Issue