Files
KirkOS/user/include/mlibc/sysdeps/ironclad/crt-riscv64/Scrt1.S
T
kaguya 9a9b91c940 user: implement mlibc as the libc, finally.
It's finally done..

Signed-off-by: kaguya <vpshinomiya@protonmail.com>
2026-05-02 03:31:49 -04:00

31 lines
569 B
ArmAsm

.weak __global_pointer$
.hidden __global_pointer$
.section .text
.global _start
_start:
# Load gp.
.option push
.option norelax
lla gp, __global_pointer$
.option pop
mv a0, sp
la a1, main
call __mlibc_entry@plt
unimp
# Load gp from .preinit_array since it may be used by the executable's .init_array.
# We still load it in _start to account for static binaries. This matches glibc's behavior.
load_gp:
.option push
.option norelax
lla gp, __global_pointer$
.option pop
ret
.section .preinit_array,"aw"
.dword load_gp
.section .note.GNU-stack,"",%progbits