crt-posix.s (338B)
1 .bss 2 .globl _environ 3 _environ: 4 .quad 0 5 6 .text 7 .global _start 8 _start: 9 movq %rsp,%rbp 10 11 /* load argc, argv, envp from stack */ 12 movq (%rbp),%rdi /* argc */ 13 leaq 8(%rbp),%rsi /* argv */ 14 leaq 16(%rbp,%rdi,8),%rdx /* envp = argv + 8*argc + 8 */ 15 movq %rdx,_environ(%rip) 16 17 call main 18 movl %eax,%edi 19 jmp exit