aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-08-26 00:07:26 +0000
committerUlrich Drepper <drepper@redhat.com>1998-08-26 00:07:26 +0000
commit08cac4ac19abd40887afbd9d841cd96a8efbbe98 (patch)
tree4bf358e1cb79b646a43b0fc527436e240ee4edaa /elf/dl-open.c
parent6dbb7062ff2af970c6b8befecf71d7284d5813fb (diff)
downloadglibc-08cac4ac19abd40887afbd9d841cd96a8efbbe98.zip
glibc-08cac4ac19abd40887afbd9d841cd96a8efbbe98.tar.gz
glibc-08cac4ac19abd40887afbd9d841cd96a8efbbe98.tar.bz2
Update.
1998-08-25 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/dl-cache.c: Move static variable cache and cachesize to toplevel. (_dl_unload_cache): New function. * elf/Versions [libc GLIBC_2.1]: Add _dl_unload_cache. * elf/dl-open.c (_dl_open): Unload map file before freeing the lock. * elf/rtld (dl_main): Unload map file before jumping to user code. * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Define O_DIRECT. Correct comment for O_LARGEFILE. * sysdeps/unix/sysv/linux/bits/fcntl.h: Define O_DIRECT. Change O_LARGEFILE to correct value. 1998-08-25 14:34 Ulrich Drepper <drepper@cygnus.com> * libio/iogetline.c (_IO_getline_info): Don't read anything for N == 0. Patch by HJ Lu.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index b595f2d..3670657 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/mman.h> /* Check whether MAP_COPY is defined. */
#include <bits/libc-lock.h>
#include <elf/ldsodefs.h>
@@ -31,6 +32,9 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
ElfW(Addr) *user_entry));
weak_extern (_dl_sysdep_start)
+/* This function is used to unload the cache file if necessary. */
+extern void _dl_unload_cache (void);
+
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
extern int __libc_argc;
@@ -224,6 +228,11 @@ _dl_open (const char *file, int mode)
args.map = NULL;
errcode = _dl_catch_error (&errstring, dl_open_worker, &args);
+#ifndef MAP_COPY
+ /* We must munmap() the cache file. */
+ _dl_unload_cache ();
+#endif
+
/* Release the lock. */
__libc_lock_unlock (_dl_load_lock);