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
|
pushq %rdi
|
||||||
|
|
||||||
# Prepare signals, memory allocation, stdio and such.
|
# Prepare signals, memory allocation, stdio and such.
|
||||||
call initialize_standard_library
|
# call initialize_standard_library
|
||||||
|
|
||||||
# Run the global constructors.
|
# Run the global constructors.
|
||||||
call _init
|
call _init
|
||||||
|
@ -23,9 +23,24 @@ _start:
|
||||||
popq %rsi
|
popq %rsi
|
||||||
|
|
||||||
# Run main
|
# Run main
|
||||||
call main
|
# call main
|
||||||
|
|
||||||
# Terminate the process with the exit code.
|
# Terminate the process with the exit code.
|
||||||
movl %eax, %edi
|
movl %eax, %edi
|
||||||
call exit
|
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
|
.section .init
|
||||||
.global _init
|
.global _init
|
||||||
|
.type _init, @function
|
||||||
_init:
|
_init:
|
||||||
push %rbp
|
push %rbp
|
||||||
movq %rsp, %rbp
|
movq %rsp, %rbp
|
||||||
|
@ -7,6 +8,7 @@ _init:
|
||||||
|
|
||||||
.section .fini
|
.section .fini
|
||||||
.global _fini
|
.global _fini
|
||||||
|
.type _fini, @function
|
||||||
_fini:
|
_fini:
|
||||||
push %rbp
|
push %rbp
|
||||||
movq %rsp, %rbp
|
movq %rsp, %rbp
|
||||||
|
|
Loading…
Reference in New Issue