summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2014-04-01 09:28:31 +0000
committerJohn van Groningen2014-04-01 09:28:31 +0000
commitdec6f40c219c6ccdee039fdb3e98a2100aa33a17 (patch)
treee61ca8515980e75ec2f26bc209b2d8028ecd4584
parentsave registers r12-r15, don't save registers rcx and rdx in abc_main (diff)
save registers r12-r15, don't save registers rcx and rdx in abc_main
-rw-r--r--macho64/astartup.s34
1 files changed, 30 insertions, 4 deletions
diff --git a/macho64/astartup.s b/macho64/astartup.s
index 1f1878b..112367b 100644
--- a/macho64/astartup.s
+++ b/macho64/astartup.s
@@ -629,11 +629,24 @@ first_one_bit_table:
_abc_main:
push rbx
- push rcx
- push rdx
push rbp
push rsi
push rdi
+ .if ! LINUX
+ .byte 0x49
+ push rsp
+ .byte 0x49
+ push rbp
+ .byte 0x49
+ push rsi
+ .byte 0x49
+ push rdi
+ .else
+ push r12
+ push r13
+ push r14
+ push r15
+ .endif
call init_clean
test rax,rax
@@ -660,11 +673,24 @@ exit:
call exit_clean
init_error:
+ .if ! LINUX
+ .byte 0x49
+ pop rdi
+ .byte 0x49
+ pop rsi
+ .byte 0x49
+ pop rbp
+ .byte 0x49
+ pop rsp
+ .else
+ pop r15
+ pop r14
+ pop r13
+ pop r12
+ .endif
pop rdi
pop rsi
pop rbp
- pop rdx
- pop rcx
pop rbx
.if LINUX