ref: b040d8ccff7557ea1a33428020ae1c484081eab6
parent: 199b9cbd18da9e32a3bacdee6266a098036b34be
parent: fc7a3c0d5470cece4a3e444750181f7101cbe98f
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jan 15 04:26:42 EST 2016
Merge pull request #44 from andrewchambers/openbsd minor fixes to rt asm files
--- a/rt/abort-freebsd.s
+++ b/rt/abort-freebsd.s
@@ -8,11 +8,11 @@
movq (%rsp),%rax
movq $15,%rdx
leaq .digitchars(%rip),%r8
- leaq .pcstr(%rip),%r9
+ leaq .pcstr(%rip),%r9
.loop:
movq %rax, %rcx
andq $0xf, %rcx
- movb (%r8,%rcx),%r10b
+ movb (%r8,%rcx),%r10b
movb %r10b,(%r9,%rdx)
subq $1, %rdx
shrq $4, %rax
--- a/rt/abort-osx.s
+++ b/rt/abort-osx.s
@@ -8,11 +8,11 @@
movq (%rsp),%rax
movq $15,%rdx
leaq .digitchars(%rip),%r8
- leaq .pcstr(%rip),%r9
+ leaq .pcstr(%rip),%r9
.loop:
movq %rax, %rcx
andq $0xf, %rcx
- movb (%r8,%rcx),%r10b
+ movb (%r8,%rcx),%r10b
movb %r10b,(%r9,%rdx)
subq $1, %rdx
shrq $4, %rax
--- a/rt/common.s
+++ b/rt/common.s
@@ -40,7 +40,7 @@
* argc in %rax, argv in %rbx, dest vector in %rcx
*/
cvt:
- jmp .cvttest
+ jmp .cvttest
.cvtloop:
subq $1,%rax
movq (%rbx),%r8
@@ -53,5 +53,5 @@
testq %rax,%rax
jnz .cvtloop
.cvtdone:
- ret
+ ret
--- a/rt/start-freebsd.s
+++ b/rt/start-freebsd.s
@@ -27,7 +27,7 @@
/* stack allocate sizeof(byte[:])*(argc + len(envp)) */
movq (%rdi),%rax
leaq 16(%rdi,%rax,8), %rbx /* argp = argv + 8*argc + 8 */
- call count
+ call count
addq %r9,%rax
imulq $16,%rax
subq %rax,%rsp
@@ -36,20 +36,20 @@
/* convert envp to byte[:][:] for std._environment */
movq (%rdi),%rax
leaq 16(%rdi,%rax,8), %rbx /* envp = argv + 8*argc + 8 */
- /* store envp for some syscalls to use without spurious conversion. */
- movq %rbx,sys$__cenvp(%rip)
+ /* store envp for some syscalls to use without spurious conversion. */
+ movq %rbx,sys$__cenvp(%rip)
movq %r9,%rax
movq %rsp, %rcx
- movq %r9,.envlen
- movq %rdx,.envbase
- call cvt
+ movq %r9,.envlen(%rip)
+ movq %rdx,.envbase(%rip)
+ call cvt
movq %rcx,%rdx
- /* convert argc, argv to byte[:][:] for args. */
+ /* convert argc, argv to byte[:][:] for args. */
movq (%rdi), %rax /* argc */
leaq 8(%rdi), %rbx /* argv */
movq (%rdi), %rsi /* saved argc */
- call cvt
+ call cvt
pushq %rsi
pushq %rdx
@@ -59,7 +59,7 @@
/* enter the main program */
call main
/* exit(0) */
- xorq %rdi,%rdi
+ xorq %rdi,%rdi
movq $1,%rax
syscall
--- a/rt/start-linux.s
+++ b/rt/start-linux.s
@@ -49,22 +49,22 @@
/* convert envp to byte[:][:] for sys._environment */
movq (%rbp),%rax
leaq 16(%rbp,%rax,8), %rbx /* envp = argv + 8*argc + 8 */
- /* store envp for some syscalls to use without converting */
- movq %rbx,sys$__cenvp(%rip)
+ /* store envp for some syscalls to use without converting */
+ movq %rbx,sys$__cenvp(%rip)
movq %r9,%rax
movq %rsp, %rcx
- movq %r9,.envlen
- movq %rdx,.envbase
- call cvt
+ movq %r9,.envlen(%rip)
+ movq %rdx,.envbase(%rip)
+ call cvt
movq %rcx,%rdx
- /* convert argc, argv to byte[:][:] for args. */
+ /* convert argc, argv to byte[:][:] for args. */
movq (%rbp), %rax /* argc */
leaq 8(%rbp), %rbx /* argv */
movq (%rbp), %rsi /* saved argc */
- call cvt
- pushq %rsi
- pushq %rdx
+ call cvt
+ pushq %rsi
+ pushq %rdx
/* call pre-main initializers */
call __init__
@@ -71,7 +71,7 @@
/* enter the main program */
call main
/* exit(0) */
- xorq %rdi,%rdi
+ xorq %rdi,%rdi
movq $60,%rax
syscall
--- a/rt/start-osx.s
+++ b/rt/start-osx.s
@@ -29,7 +29,7 @@
/* stack allocate sizeof(byte[:])*(argc + len(envp)) */
movq (%rbp),%rax
leaq 16(%rbp,%rax,8), %rbx /* argp = argv + 8*argc + 8 */
- call count
+ call count
addq %r9,%rax
imulq $16,%rax
subq %rax,%rsp
@@ -38,21 +38,21 @@
/* convert envp to byte[:][:] for sys._environment */
movq (%rbp),%rax
leaq 16(%rbp,%rax,8), %rbx /* envp = argv + 8*argc + 8 */
- movq %rbx,_sys$__cenvp(%rip)
+ movq %rbx,_sys$__cenvp(%rip)
movq %r9,%rax
movq %rsp, %rcx
movq %r9,.envlen(%rip)
movq %rdx,.envbase(%rip)
- call cvt
+ call cvt
movq %rcx,%rdx
- /* convert argc, argv to byte[:][:] for args. */
+ /* convert argc, argv to byte[:][:] for args. */
movq (%rbp), %rax /* argc */
leaq 8(%rbp), %rbx /* argv */
movq (%rbp), %rsi /* saved argc */
- call cvt
- pushq %rsi
- pushq %rdx
+ call cvt
+ pushq %rsi
+ pushq %rdx
call ___init__
/* enter the main program */