Some little fixes (now gcc compiles empty file without errors)
This commit is contained in:
parent
8e5823ad96
commit
1766a07e16
|
@ -13,7 +13,7 @@ _start:
|
|||
pushq %rdi
|
||||
|
||||
# Prepare signals, memory allocation, stdio and such.
|
||||
call initialize_standard_library
|
||||
# call initialize_standard_library
|
||||
|
||||
# Run the global constructors.
|
||||
call _init
|
||||
|
@ -23,9 +23,24 @@ _start:
|
|||
popq %rsi
|
||||
|
||||
# Run main
|
||||
call main
|
||||
# call main
|
||||
|
||||
# Terminate the process with the exit code.
|
||||
movl %eax, %edi
|
||||
call exit
|
||||
.size _start, . - _start
|
||||
|
||||
.global _init
|
||||
_init:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
||||
|
||||
.global _fini
|
||||
_fini:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
||||
|
||||
.global exit
|
||||
exit:
|
||||
call _fini
|
||||
|
||||
.size _start, . - _start
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.section .init
|
||||
.global _init
|
||||
.type _init, @function
|
||||
_init:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
||||
|
@ -7,6 +8,7 @@ _init:
|
|||
|
||||
.section .fini
|
||||
.global _fini
|
||||
.type _fini, @function
|
||||
_fini:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
||||
|
|
Loading…
Reference in New Issue