aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-load.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 /elf/dl-load.c
parent17c263876bf38178d3a4ba720bf81d7a214bba51 (diff)
downloadglibc-eec8b6cae586451deadf30c371f7b5e4c9d573d1.zip
glibc-eec8b6cae586451deadf30c371f7b5e4c9d573d1.tar.gz
glibc-eec8b6cae586451deadf30c371f7b5e4c9d573d1.tar.bz2
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 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 1a3c9c5..162fb30 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1110,7 +1110,7 @@ cannot allocate TLS data structures for initial thread");
unallocated. Then jump into the normal segment-mapping loop to
handle the portion of the segment past the end of the file
mapping. */
- __mprotect ((caddr_t) (l->l_addr + c->mapend),
+ __mprotect ((caddr_t) l->l_text_end,
loadcmds[nloadcmds - 1].allocend - c->mapend,
PROT_NONE);
@@ -1146,6 +1146,9 @@ cannot allocate TLS data structures for initial thread");
goto map_error;
postmap:
+ if (c->prot & PROT_EXEC)
+ l->l_text_end = l->l_addr + c->mapend;
+
if (l->l_phdr == 0
&& (ElfW(Off)) c->mapoff <= header->e_phoff
&& ((size_t) (c->mapend - c->mapstart + c->mapoff)