aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c4
-rw-r--r--elf/dl-support.c10
-rw-r--r--elf/rtld.c2
3 files changed, 10 insertions, 6 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 2832ab3..918ec75 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1368,7 +1368,11 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd,
check_consistency ();
#endif
+#if PTHREAD_IN_LIBC
+ errval = _dl_make_stacks_executable (stack_endp);
+#else
errval = (*GL(dl_make_stack_executable_hook)) (stack_endp);
+#endif
if (errval)
{
errstring = N_("\
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 580b020..dfc9ab7 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -183,12 +183,6 @@ uint64_t _dl_hwcap_mask __attribute__ ((nocommon));
* executable but this isn't true for all platforms. */
ElfW(Word) _dl_stack_flags = DEFAULT_STACK_PERMS;
-/* If loading a shared object requires that we make the stack executable
- when it was not, we do it by calling this function.
- It returns an errno code or zero on success. */
-int (*_dl_make_stack_executable_hook) (void **) = _dl_make_stack_executable;
-
-
#if THREAD_GSCOPE_IN_TCB
list_t _dl_stack_used;
list_t _dl_stack_user;
@@ -197,6 +191,10 @@ size_t _dl_stack_cache_actsize;
uintptr_t _dl_in_flight_stack;
int _dl_stack_cache_lock;
#else
+/* If loading a shared object requires that we make the stack executable
+ when it was not, we do it by calling this function.
+ It returns an errno code or zero on success. */
+int (*_dl_make_stack_executable_hook) (void **) = _dl_make_stack_executable;
int _dl_thread_gscope_count;
void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls;
#endif
diff --git a/elf/rtld.c b/elf/rtld.c
index 1255d5c..fbbd60b 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1125,9 +1125,11 @@ dl_main (const ElfW(Phdr) *phdr,
__tls_pre_init_tp ();
+#if !PTHREAD_IN_LIBC
/* The explicit initialization here is cheaper than processing the reloc
in the _rtld_local definition's initializer. */
GL(dl_make_stack_executable_hook) = &_dl_make_stack_executable;
+#endif
/* Process the environment variable which control the behaviour. */
process_envvars (&state);