diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-04-06 15:13:59 +0200 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-04-06 15:13:59 +0200 |
commit | 3b3285b1b7c02d36c74a6ae265fdb02ca991c96b (patch) | |
tree | 0f3bf060794323ff690f6f4a86dc903c4570f540 /libc/misc/internals/__uClibc_main.c | |
parent | 289d19f45d7f8af9a4079938a3426aafdd2674ba (diff) | |
parent | 85f4b028d767fc390a7b866d2f58d58be489242d (diff) |
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (137 commits)
utils/ldd: Check for returned pointer from strrchr not the value it holds
cris: add provide arch-specific vfork implementation
lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined
bump version to 0.9.32-rc3-git
release 0.9.32-rc3
memalign: include sys/param.h for MAX
arm/bits/atomic.h: Include common/bit/atomic.h for thumb1
wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace
add libc_hidden_proto for wcs[n]casecmp_l
really fix missing __libc_drand48_data
Revert "missing prototype of __libc_drand48_data fixed"
missing prototype of __libc_drand48_data fixed
time.c, time.h: remove unused hidden strftime/strptime
nanosleep.c: remove duplicated libc_hidden_proto
ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31
_wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions
time.c, wchar.h: remove unused hidden wcsftime
str[n]casecmp.c: fix hidden usage
remove unused hidden functions
frv/memset.S: add missing libc_hidden_def
...
Conflicts:
ldso/ldso/ldso.c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/misc/internals/__uClibc_main.c')
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 36c0c6c63..71fdbd8a7 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -45,22 +45,15 @@ void *__libc_stack_end = NULL; # ifdef __UCLIBC_HAS_SSP__ # include <dl-osinfo.h> +static uintptr_t stack_chk_guard; # ifndef THREAD_SET_STACK_GUARD /* Only exported for architectures that don't store the stack guard canary * in thread local area. */ -# include <stdint.h> -uintptr_t stack_chk_guard; /* for gcc-4.1 non-TLS */ uintptr_t __stack_chk_guard attribute_relro; +# endif /* for gcc-3.x + Etoh ssp */ -# ifdef __UCLIBC_HAS_SSP_COMPAT__ -# ifdef __HAVE_SHARED__ -strong_alias(__stack_chk_guard,__guard) -# else -uintptr_t __guard attribute_relro; -# endif -# endif -# elif defined __UCLIBC_HAS_SSP_COMPAT__ +# ifdef __UCLIBC_HAS_SSP_COMPAT__ uintptr_t __guard attribute_relro; # endif # endif @@ -255,18 +248,14 @@ void __uClibc_init(void) #ifndef SHARED # ifdef __UCLIBC_HAS_SSP__ /* Set up the stack checker's canary. */ + stack_chk_guard = _dl_setup_stack_chk_guard(); # ifdef THREAD_SET_STACK_GUARD - uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard(); THREAD_SET_STACK_GUARD (stack_chk_guard); -# ifdef __UCLIBC_HAS_SSP_COMPAT__ - stack_chk_guard = _dl_setup_stack_chk_guard(); - __guard = stack_chk_guard; -# endif # else __stack_chk_guard = stack_chk_guard; -# if !defined __HAVE_SHARED__ && defined __UCLIBC_HAS_SSP_COMPAT__ - __guard = stack_chk_guard; -# endif +# endif +# ifdef __UCLIBC_HAS_SSP_COMPAT__ + __guard = stack_chk_guard; # endif # endif #endif @@ -317,6 +306,11 @@ void __uClibc_fini(void) } libc_hidden_def(__uClibc_fini) +#ifndef SHARED +extern void __nptl_deallocate_tsd (void) __attribute ((weak)); +extern unsigned int __nptl_nthreads __attribute ((weak)); +#endif + /* __uClibc_main is the new main stub for uClibc. This function is * called from crt1 (version 0.9.28 or newer), after ALL shared libraries * are initialized, just before we call the application's main function. @@ -497,7 +491,6 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc, # ifdef SHARED __libc_pthread_functions.ptr__nptl_deallocate_tsd (); # else - extern void __nptl_deallocate_tsd (void) __attribute ((weak)); __nptl_deallocate_tsd (); # endif @@ -507,7 +500,6 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc, # ifdef SHARED unsigned int *const ptr = __libc_pthread_functions.ptr_nthreads; # else - extern unsigned int __nptl_nthreads __attribute ((weak)); unsigned int *const ptr = &__nptl_nthreads; # endif |