Add MOD0 header to crt0

This commit is contained in:
fincs 2018-08-24 16:29:36 +02:00
parent ce23a139f4
commit 80439a186b
2 changed files with 12 additions and 2 deletions

View File

@ -3,7 +3,7 @@
_start:
b startup
.word 0
.word __nx_mod0 - _start
.ascii "HOMEBREW"
.org _start+0x80
@ -69,3 +69,13 @@ __nx_exit:
// jump back to loader
br x1
.global __nx_mod0
__nx_mod0:
.ascii "MOD0"
.word _DYNAMIC - __nx_mod0
.word __bss_start__ - __nx_mod0
.word __bss_end__ - __nx_mod0
.word __eh_frame_hdr_start - __nx_mod0
.word __eh_frame_hdr_end - __nx_mod0
.word 0 // "offset to runtime-generated module object" (??)

View File

@ -59,7 +59,7 @@ SECTIONS
. = ALIGN(8);
} :rodata
.eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } :rodata
.eh_frame_hdr : { __eh_frame_hdr_start = .; *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) __eh_frame_hdr_end = .; } :rodata
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } :rodata
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } :rodata
.gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } : rodata