about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-03 15:25:38 -0800
committerPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-03 15:25:38 -0800
commitbd853af0314ee98ecdec49ff32745963f24b3bb4 (patch)
treea094e7ec936ef73c8e929a97711bee860d85c45b /sysdeps
parent630cc91e1bb6762360c7640d58cb21eb50f9c2dd (diff)
downloadglibc-bd853af0314ee98ecdec49ff32745963f24b3bb4.tar.gz
glibc-bd853af0314ee98ecdec49ff32745963f24b3bb4.tar.xz
glibc-bd853af0314ee98ecdec49ff32745963f24b3bb4.zip
For b/2471323, implement multi-level cache search for shared libraries.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/ldsodefs.h11
-rw-r--r--sysdeps/generic/unsecvars.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 72de344b9c..5afa846859 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -129,6 +129,13 @@ typedef struct link_map *lookup_t;
    | ((PROT_WRITE | PROT_EXEC) << (PF_W | PF_X) * 4)			      \
    | ((PROT_READ | PROT_WRITE | PROT_EXEC) << ((PF_R | PF_W | PF_X) * 4)))
 
+#ifndef GOOGLE_LD_SO_CACHE_LIST
+/* List of absolute paths to ld.so.cache files we'll load.
+   By default we use "$prefix/etc/ld.so.cache:/etc/ld.so.cache". The second
+   is needed so we can find system libraries not included in GRTE.  */
+#define GOOGLE_LD_SO_CACHE_LIST LD_SO_CACHE ":/etc/ld.so.cache"
+#endif
+
 /* The filename itself, or the main program name, if available.  */
 #define DSO_FILENAME(name) ((name)[0] ? (name)				      \
 			    : (rtld_progname ?: "<main program>"))
@@ -540,6 +547,10 @@ struct rtld_global_ro
   /* All search directories defined at startup.  */
   EXTERN struct r_search_path_elem *_dl_init_all_dirs;
 
+  /* Colon-separated list of absolute paths to ld.so.cache files
+     we'll load.  */
+  EXTERN const char *_google_ld_so_cache_list;
+
 #if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
   /* Overhead of a high-precision timing measurement.  */
   EXTERN hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/generic/unsecvars.h b/sysdeps/generic/unsecvars.h
index d5b8119c9c..fb277438f0 100644
--- a/sysdeps/generic/unsecvars.h
+++ b/sysdeps/generic/unsecvars.h
@@ -9,6 +9,7 @@
   "LD_DEBUG\0"								      \
   "LD_DEBUG_OUTPUT\0"							      \
   "LD_DYNAMIC_WEAK\0"							      \
+  "LD_GOOGLE_LD_SO_CACHE_LIST\0"					      \
   "LD_LIBRARY_PATH\0"							      \
   "LD_ORIGIN_PATH\0"							      \
   "LD_PRELOAD\0"							      \