about summary refs log tree commit diff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-27 03:40:33 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-27 03:40:33 +0000
commiteec8b6cae586451deadf30c371f7b5e4c9d573d1 (patch)
treeb005437b5b7d69778e06694e4bd836a3e7c42f6a /nptl/allocatestack.c
parent17c263876bf38178d3a4ba720bf81d7a214bba51 (diff)
downloadglibc-eec8b6cae586451deadf30c371f7b5e4c9d573d1.tar.gz
glibc-eec8b6cae586451deadf30c371f7b5e4c9d573d1.tar.xz
glibc-eec8b6cae586451deadf30c371f7b5e4c9d573d1.zip
Update.
2004-03-26  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-caller.c: New file.
	* include/caller.h: New file.
	* Makefile (distribute): Add include/caller.h.
	* elf/Makefile (dl-routines): Add dl-caller.
	* elf/dl-load.c (_dl_map_object_from_fd): Record l_text_end.
	* elf/dl-open.c (check_libc_caller): Removed.
	(dl_open_worker): Use __check_caller instead.
	* elf/rtld.c (_rtld_global_ro): Initialize _dl_check_caller.
	(_dl_start_final): Record l_text_end for ld.so map.
	(dl_main): Record l_text_end for main object and vdso.
	* include/link.h (struct link_map): Add l_text_end field.
	* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Add
	_dl_check_caller field.
	Define enum allowmask.  Add declaration of _dl_check_caller.
	* sysdeps/unix/sysv/linux/dl-execstack.c: Also use __check_caller test.
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 7983bed273..4b5af82f06 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -676,9 +676,10 @@ int
 internal_function
 __make_stacks_executable (void **stack_endp)
 {
-  /* Challenge the caller.  */
-  if (*stack_endp != __libc_stack_end)
-    return EPERM;
+  /* First the main thread's stack.  */
+  int err = _dl_make_stack_executable (stack_endp);
+  if (err != 0)
+    return err;
 
 #ifdef NEED_SEPARATE_REGISTER_STACK
   const size_t pagemask = ~(__getpagesize () - 1);
@@ -686,7 +687,6 @@ __make_stacks_executable (void **stack_endp)
 
   lll_lock (stack_cache_lock);
 
-  int err = 0;
   list_t *runp;
   list_for_each (runp, &stack_used)
     {
@@ -716,9 +716,6 @@ __make_stacks_executable (void **stack_endp)
 
   lll_unlock (stack_cache_lock);
 
-  if (err == 0)
-    err = _dl_make_stack_executable (stack_endp);
-
   return err;
 }