diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/riscv64/crt1.S | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 6611090bd..affa0ce0a 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -500,6 +500,7 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc, #endif } # endif +#endif /* Note: It is possible that any initialization done above could * have resulted in errno being set nonzero, so set it to 0 before @@ -511,7 +512,6 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc, /* Set h_errno to 0 as well */ if (likely(not_null_ptr(__h_errno_location))) *(__h_errno_location()) = 0; -#endif #if defined HAVE_CLEANUP_JMP_BUF && defined __UCLIBC_HAS_THREADS_NATIVE__ /* Memory for the cancellation buffer. */ diff --git a/libc/sysdeps/linux/riscv64/crt1.S b/libc/sysdeps/linux/riscv64/crt1.S index 1e8403d26..15aa0763c 100644 --- a/libc/sysdeps/linux/riscv64/crt1.S +++ b/libc/sysdeps/linux/riscv64/crt1.S @@ -45,6 +45,9 @@ .globl _start .type _start,%function + .weak _init + .weak _fini + _start: call .Lload_gp mv a5, a0 /* rtld_fini. */ @@ -52,12 +55,9 @@ _start: la a0, main REG_L a1, 0(sp) /* argc. */ addi a2, sp, SZREG /* argv. */ - /* - * No support fo app_init/app_fini as we don't support shared libraries. - */ - mv a3, zero - mv a4, zero andi sp, sp, ALMASK /* Align stack. */ + lla a3, _init + lla a4, _fini mv a6, sp /* stack_end. */ tail __uClibc_main@plt |