crt0 cleanup

- use the generic 'crt0.s' for Linux
- move the read-only '__dso_handle' definition into the '.text' section
- move the '__initial_sp' definition into the '.bss' section
- remove the '_main_utcb' definition

Part of #766.
This commit is contained in:
Christian Prochaska
2013-06-06 17:43:13 +02:00
committed by Norman Feske
parent 1b96e8a7e1
commit c962240922
22 changed files with 44 additions and 450 deletions

View File

@ -3,4 +3,6 @@ SRC_CC += _main.cc
REP_INC_DIR += src/platform
LIBS += syscall
vpath _main.cc $(BASE_DIR)/src/platform

View File

@ -26,15 +26,8 @@ _start:
.initial_sp: .word __initial_sp
.stack_high: .word _stack_high
/*--------------------------------------------------*/
.data
.globl __dso_handle
__dso_handle:
.long 0
.globl __initial_sp
__initial_sp:
.long 0
__dso_handle: .long 0
/*--- .bss (non-initialized data) ------------------*/
.section ".bss"
@ -46,10 +39,6 @@ _stack_low:
.globl _stack_high
_stack_high:
/*
* Symbol referenced by ldso's crt0.s, which is needed by base-hw only.
* It is defined here merely to resolve the symbol for non-base-hw
* platforms.
*/
.globl _main_utcb
_main_utcb: .long 0
/* initial value of the SP register */
.globl __initial_sp
__initial_sp: .space 4

View File

@ -33,16 +33,8 @@ _start:
.ascii "_main() returned."
2: jmp 1b
/*--------------------------------------------------*/
.data
.globl __dso_handle
__dso_handle:
.long 0
.globl __initial_sp
__initial_sp:
.long 0
__dso_handle: .long 0
/*--- .eh_frame (exception frames) -----------------*/
/*
@ -59,3 +51,7 @@ _stack_low:
.space 64*1024
.global _stack_high
_stack_high:
/* initial value of the ESP register */
.globl __initial_sp
__initial_sp: .space 4

View File

@ -36,17 +36,8 @@ _start:
.ascii "_main() returned."
2: jmp 1b
/*--------------------------------------------------*/
.data
.p2align 8
.globl __dso_handle
__dso_handle:
.quad 0
.globl __initial_sp
__initial_sp:
.quad 0
__dso_handle: .quad 0
/*--- .eh_frame (exception frames) -----------------*/
/*
@ -63,3 +54,7 @@ _stack_low:
.space 64*1024
.global _stack_high
_stack_high:
/* initial value of the RSP register */
.globl __initial_sp
__initial_sp: .space 8