about summary refs log tree commit diff
path: root/elf/rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 3fd13179ba..13c4f2698e 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -40,6 +40,9 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
 						     ElfW(Addr) *user_entry));
 extern void _dl_sysdep_start_cleanup (void);
 
+/* This function is used to unload the cache file if necessary.  */
+extern void _dl_unload_cache (void);
+
 /* System-dependent function to read a file's whole contents
    in the most convenient manner available.  */
 extern void *_dl_sysdep_read_whole_file (const char *filename,
@@ -918,6 +921,11 @@ of this helper program; chances are you did not intend to run this program.\n\
     _dl_debug_state ();
   }
 
+#ifndef MAP_COPY
+  /* We must munmap() the cache file.  */
+  _dl_unload_cache ();
+#endif
+
   /* Now enable profiling if needed.  */
   if (_dl_profile_map != NULL)
     /* We must prepare the profiling.  */