diff options
Diffstat (limited to 'src/env')
-rw-r--r-- | src/env/__libc_start_main.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c index 7ffada0b..5c79be28 100644 --- a/src/env/__libc_start_main.c +++ b/src/env/__libc_start_main.c @@ -8,9 +8,11 @@ void __init_tls(size_t *); -extern void _init() __attribute__((weak)); -extern void (*const __init_array_start)() __attribute__((weak)); -extern void (*const __init_array_end)() __attribute__((weak)); +static void dummy(void) {} +weak_alias(dummy, _init); + +__attribute__((__weak__, __visibility__("hidden"))) +extern void (*const __init_array_start)(void), (*const __init_array_end)(void); static void dummy1(void *p) {} weak_alias(dummy1, __init_ssp); @@ -53,7 +55,7 @@ void __init_libc(char **envp, char *pn) static void libc_start_init(void) { - if (_init) _init(); + _init(); uintptr_t a = (uintptr_t)&__init_array_start; for (; a<(uintptr_t)&__init_array_end; a+=sizeof(void(*)())) (*(void (**)())a)(); |