[PATCH 7/8] elf: Remove _dl_unload_cache

Adhemerval Zanella <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
It is a no-op since b9957a70b82.
---
 elf/dl-cache.c             | 13 -------------
 elf/dl-open.c              |  5 -----
 elf/rtld.c                 |  5 -----
 sysdeps/generic/ldsodefs.h |  6 ------
 4 files changed, 29 deletions(-)

diff --git a/elf/dl-cache.c b/elf/dl-cache.c
index 03bcd5bd06e..c6820a9f414 100644
--- a/elf/dl-cache.c
+++ b/elf/dl-cache.c
@@ -606,19 +606,6 @@ _dl_load_cache_lookup (const char *name)
   return result;
 }
 
-#ifndef MAP_COPY
-/* If the system does not support MAP_COPY we cannot leave the file open
-   all the time since this would create problems when the file is replaced.
-   Therefore we provide this function to close the file and open it again
-   once needed.  */
-void
-_dl_unload_cache (void)
-{
-  /* Functionality is no longer needed, but kept for internal ABI for
-     now.  */
-}
-#endif
-
 const struct tunable_header_cached *
 _dl_load_cache_tunables (const char **data)
 {
diff --git a/elf/dl-open.c b/elf/dl-open.c
index cf4749694f9..87fcee8b028 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -898,11 +898,6 @@ no more namespaces available for dlmopen()"));
   struct dl_exception exception;
   int errcode = _dl_catch_exception (&exception, dl_open_worker, &args);
 
-#if defined USE_LDCONFIG && !defined MAP_COPY
-  /* We must unmap the cache file.  */
-  _dl_unload_cache ();
-#endif
-
   /* Do this for both the error and success cases.  The old value has
      only been determined if the namespace ID was assigned (i.e., it
      is not __LM_ID_CALLER).  In the success case, we actually may
diff --git a/elf/rtld.c b/elf/rtld.c
index e5ba71fef18..fc053df8586 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2371,11 +2371,6 @@ dl_main (const ElfW(Phdr) *phdr,
   /* Auditing checkpoint: we have added all objects.  */
   _dl_audit_activity_nsid (LM_ID_BASE, LA_ACT_CONSISTENT);
 
-#if defined USE_LDCONFIG && !defined MAP_COPY
-  /* We must munmap() the cache file.  */
-  _dl_unload_cache ();
-#endif
-
   /* Once we return, _dl_sysdep_start will invoke
      the DT_INIT functions and then *USER_ENTRY.  */
 }
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f94247ad9fb..c0deb11c02e 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1151,12 +1151,6 @@ const struct r_strlenpair *_dl_important_hwcaps (const char *prepend,
    or null if none is found.  Caller must free returned string.  */
 extern char *_dl_load_cache_lookup (const char *name) attribute_hidden;
 
-/* If the system does not support MAP_COPY we cannot leave the file open
-   all the time since this would create problems when the file is replaced.
-   Therefore we provide this function to close the file and open it again
-   once needed.  */
-extern void _dl_unload_cache (void) attribute_hidden;
-
 /* System-dependent function to read a file's whole contents in the
    most convenient manner available.  *SIZEP gets the size of the
    file.  On error MAP_FAILED is returned.  */
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.