summaryrefslogtreecommitdiff
path: root/csu
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-12-20 09:29:33 +0100
committerThomas Schwinge <thomas@codesourcery.com>2013-12-20 09:29:33 +0100
commit36375a0379b46f2f76348de24a7838206879a25d (patch)
treef8ac58fe9e3f6c395df3cbd181c7464cadc68649 /csu
parent5a92339ad317991475c5628c073a3411447775d5 (diff)
parentb4578bab30f72cddd2cf38abfb39f9c8dc892249 (diff)
Merge commit 'refs/top-bases/t/tls' into t/tls
Diffstat (limited to 'csu')
-rw-r--r--csu/init-first.c5
-rw-r--r--csu/libc-start.c16
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. */