libc: Add dummy argv
This commit is contained in:
parent
6d7a8a0d0b
commit
62fa773b27
@ -6,6 +6,8 @@ extern _fini
|
|||||||
extern initialize_libc
|
extern initialize_libc
|
||||||
extern exit
|
extern exit
|
||||||
|
|
||||||
|
extern __argv
|
||||||
|
|
||||||
global _start
|
global _start
|
||||||
_start:
|
_start:
|
||||||
; Set up end of the stack frame linked list.
|
; Set up end of the stack frame linked list.
|
||||||
@ -19,7 +21,7 @@ _start:
|
|||||||
call _init
|
call _init
|
||||||
|
|
||||||
mov rdi, 0 ; argc = 0
|
mov rdi, 0 ; argc = 0
|
||||||
mov rsi, 0 ; argv = 0
|
mov rsi, __argv ; Dummy argv which is equal to {NULL}
|
||||||
|
|
||||||
call main
|
call main
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
__attribute__((used)) const char* __argv[] = {NULL}; // For now.
|
||||||
|
|
||||||
static void terminate_libc()
|
static void terminate_libc()
|
||||||
{
|
{
|
||||||
fclose(stdout);
|
fclose(stdout);
|
||||||
|
Loading…
Reference in New Issue
Block a user