diff --git a/nx/source/runtime/switch_crt0.s b/nx/source/runtime/switch_crt0.s index 7cdad799..226280d3 100644 --- a/nx/source/runtime/switch_crt0.s +++ b/nx/source/runtime/switch_crt0.s @@ -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" (??) diff --git a/nx/switch.ld b/nx/switch.ld index a4101fc3..0fdfe47c 100644 --- a/nx/switch.ld +++ b/nx/switch.ld @@ -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