2
0
mirror of git://sourceware.org/git/glibc.git synced 2025-04-24 14:41:06 +08:00

(__libc_start_main): Initialize thread library for static programs

This commit is contained in:
Andreas Jaeger 2000-07-06 21:16:06 +00:00
parent 394d3277fb
commit 4fb7a71f12

@ -29,6 +29,10 @@ weak_extern (_dl_starting_up)
extern int __libc_multiple_libcs;
extern void *__libc_stack_end;
#ifndef SHARED
extern void __pthread_initialize_minimal (void) __attribute__ ((weak));
#endif
/* Prototype for local function. */
extern void __libc_check_standard_fds (void);
@ -62,6 +66,12 @@ BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
__libc_stack_end = stack_end;
#ifndef SHARED
/* Initialize the thread library at least a bit since the libgcc
functions are using thread functions if these are available and
we need to setup errno. */
if (__pthread_initialize_minimal)
__pthread_initialize_minimal ();
/* Some security at this point. Prevent starting a SUID binary where
the standard file descriptors are not opened. We have to do this
only for statically linked applications since otherwise the dynamic