9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e273e5fbbbd1f541503ed1e62984dc65bda5d8f6
parent 1e00d852398a479e5a3d74ded9913b2a605f2d44
Author: Roberto Vargas <roberto.vargas@arm.com>
Date:   Thu, 11 Oct 2018 09:12:47 +0100

Makes crt-linux.s more similar to crt-bsd.s

They are basically the same file, so having differences
between them didn't make sense.

Diffstat:
March/amd64/crt-bsd.s | 4++--
March/amd64/crt-linux.s | 17++++++++++++-----
2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/amd64/crt-bsd.s b/arch/amd64/crt-bsd.s @@ -7,7 +7,7 @@ _environ: .text .align 8 - .globl _start,_Exit + .globl _start _start: movq %rsp,%rbp @@ -19,4 +19,4 @@ _start: call main movl %eax,%edi - jmp _Exit + jmp exit diff --git a/arch/amd64/crt-linux.s b/arch/amd64/crt-linux.s @@ -1,15 +1,22 @@ .file "crt-linux.s" + .bss + .globl _environ +_environ: + .quad 0 + .text - .globl _start,_Exit + .align 8 + .globl _start _start: movq %rsp,%rbp /* load argc, argv, envp from stack */ - movq (%rbp),%rdi /* argc */ - leaq 8(%rbp),%rsi /* argv */ - leaq 16(%rbp,%rax,8),%rcx /* envp = argv + 8*argc + 8 */ + movq (%rbp),%rdi /* argc */ + leaq 8(%rbp),%rsi /* argv */ + leaq 16(%rbp,%rax,8),%rcx /* envp = argv + 8*argc + 8 */ + movq %rdx,_environ call main movl %eax,%edi - jmp _Exit + jmp exit