diff --git a/nx/source/runtime/switch_crt0.s b/nx/source/runtime/switch_crt0.s index 4f6f1fb2..14489ee2 100644 --- a/nx/source/runtime/switch_crt0.s +++ b/nx/source/runtime/switch_crt0.s @@ -40,7 +40,7 @@ bssclr_start: add x1, x1, #7 // round up to 8 bic x1, x1, #7 -bss_loop: +bss_loop: str xzr, [x0], #8 subs x1, x1, #8 bne bss_loop @@ -90,4 +90,9 @@ __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" (??) + .word 0 // "offset to runtime-generated module object" (neither needed, used nor supported in homebrew) + + // MOD0 extensions for homebrew + .ascii "LNY0" + .word __got_start__ - __nx_mod0 + .word __got_end__ - __nx_mod0 diff --git a/nx/switch.ld b/nx/switch.ld index f49cf500..d84c2e0f 100644 --- a/nx/switch.ld +++ b/nx/switch.ld @@ -14,6 +14,7 @@ SECTIONS /* =========== CODE section =========== */ PROVIDE(__start__ = 0x0); . = __start__; + __code_start = . ; .crt0 : { @@ -52,6 +53,7 @@ SECTIONS /* =========== RODATA section =========== */ . = ALIGN(0x1000); + __rodata_start = . ; .nx-module-name : { KEEP (*(.nx-module-name)) } :rodata @@ -80,6 +82,7 @@ SECTIONS /* =========== DATA section =========== */ . = ALIGN(0x1000); + __data_start = . ; .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } :data .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } :data