summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-01-17 00:38:26 -0800
committerOri Bernstein <ori@eigenstate.org>2017-01-17 00:40:41 -0800
commit94ee9832f5861c4d09afa12338720eb3a479c342 (patch)
tree0f2700787300217db22a132fc2e33eafa022dd97 /rt
parentb4fed18974bfdfc41a813578cb56b5a54964395b (diff)
downloadmc-94ee9832f5861c4d09afa12338720eb3a479c342.tar.gz
Add the ability to do setenv() on posixy systems.
Diffstat (limited to 'rt')
-rw-r--r--rt/start-freebsd.s14
1 files changed, 1 insertions, 13 deletions
diff --git a/rt/start-freebsd.s b/rt/start-freebsd.s
index 92f5435..186a76c 100644
--- a/rt/start-freebsd.s
+++ b/rt/start-freebsd.s
@@ -1,11 +1,4 @@
.data
-/* std._environment : byte[:][:] */
-.globl sys$__environment
-sys$__environment:
-.envbase:
-.quad 0 /* env size */
-.envlen:
-.quad 0 /* env ptr */
.globl sys$__cenvp
sys$__cenvp:
@@ -38,14 +31,9 @@ _start:
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)
- movq %r9,%rax
- movq %rsp, %rcx
- movq %r9,.envlen(%rip)
- movq %rdx,.envbase(%rip)
- call cvt
- movq %rcx,%rdx
/* convert argc, argv to byte[:][:] for args. */
+ movq %rsp, %rcx
movq (%rdi), %rax /* argc */
leaq 8(%rdi), %rbx /* argv */
movq (%rdi), %rsi /* saved argc */