diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-12-20 09:29:29 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-12-20 09:29:29 +0100 |
commit | a65dd355fb80a05215e15ae97649de52aec885e3 (patch) | |
tree | 81701bb0c6b648630f2bf1729a85d7f5eb49e67b /csu | |
parent | 296a5732f94abe4d5699dc981e4ccfb950b48cee (diff) | |
parent | b4578bab30f72cddd2cf38abfb39f9c8dc892249 (diff) |
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'csu')
-rw-r--r-- | csu/init-first.c | 5 | ||||
-rw-r--r-- | csu/libc-start.c | 16 |
2 files changed, 17 insertions, 4 deletions
diff --git a/csu/init-first.c b/csu/init-first.c index f0ebc94b8d..b4d22ce6aa 100644 --- a/csu/init-first.c +++ b/csu/init-first.c @@ -61,11 +61,8 @@ _init (int argc, char **argv, char **envp) if (!__libc_multiple_libcs) { /* Set the FPU control word to the proper default value if the - kernel would use a different value. (In a static program we - don't have this information.) */ -#ifdef SHARED + kernel would use a different value. */ if (__fpu_control != GLRO(dl_fpu_control)) -#endif __setfpucw (__fpu_control); } diff --git a/csu/libc-start.c b/csu/libc-start.c index 04b013b770..46e56126bb 100644 --- a/csu/libc-start.c +++ b/csu/libc-start.c @@ -37,6 +37,12 @@ extern void __pthread_initialize_minimal (void); in thread local area. */ uintptr_t __stack_chk_guard attribute_relro; # endif +# ifndef THREAD_SET_POINTER_GUARD +/* Only exported for architectures that don't store the pointer guard + value in thread local area. */ +uintptr_t __pointer_chk_guard_local + attribute_relro attribute_hidden __attribute__ ((nocommon)); +# endif #endif #ifdef HAVE_PTR_NTHREADS @@ -197,6 +203,16 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), # else __stack_chk_guard = stack_chk_guard; # endif + + /* Set up the pointer guard value. */ + uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random, + stack_chk_guard); +# ifdef THREAD_SET_POINTER_GUARD + THREAD_SET_POINTER_GUARD (pointer_chk_guard); +# else + __pointer_chk_guard_local = pointer_chk_guard; +# endif + #endif /* Register the destructor of the dynamic linker if there is any. */ |