diff options
author | Ambrose Feinstein <ambrose@google.com> | 2019-09-11 14:53:28 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-08-27 17:26:02 -0700 |
commit | af63681769182a8e29568088d6c9cd3c916b22f9 (patch) | |
tree | 1301b529ae9683e34e21e4b07a7422c490ead04c /sysdeps/generic/ldsodefs.h | |
parent | 6733782381a84fe18cf89d11c88d7df497e3a275 (diff) | |
download | glibc-af63681769182a8e29568088d6c9cd3c916b22f9.zip glibc-af63681769182a8e29568088d6c9cd3c916b22f9.tar.gz glibc-af63681769182a8e29568088d6c9cd3c916b22f9.tar.bz2 |
Redesign the fastload support for additional performance
Diffstat (limited to 'sysdeps/generic/ldsodefs.h')
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 329a367..32647f8 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -589,23 +589,14 @@ struct rtld_global_ro below. */ EXTERN struct r_search_path_elem *_dl_init_all_dirs; - /* The merged hash table used if we have a lot of shared objects. */ - EXTERN dl_position_table_entry_t *_dl_position_hash_table; - EXTERN int _dl_position_hash_mask; - EXTERN int _dl_position_hash_bits; EXTERN int _dl_position_hash_cutoff; -#define DL_POSITION_HASH_BITS_MAX 27 /* (1 << 27) entries. */ #if defined(__powerpc__) && !defined(__powerpc64__) #define DL_POSITION_HASH_CUTOFF_DEFAULT -1 /* Disabled. */ #else #define DL_POSITION_HASH_CUTOFF_DEFAULT 32 /* > 32 shared libs. */ #endif - /* Colon-separated list of absolute paths to ld.so.cache files - we'll load. */ - EXTERN const char *_google_ld_so_cache_list; - #if HP_SMALL_TIMING_AVAIL || HP_TIMING_PAD /* Overhead of a high-precision timing measurement. */ EXTERN hp_timing_t _dl_hp_timing_overhead; @@ -969,6 +960,12 @@ extern lookup_t _dl_lookup_symbol_x (const char *undef, extern void _dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid) attribute_hidden; +/* Update hashtables when objects are loaded or unloaded. */ +extern void _dl_hash_add_object (struct link_map *lib) + attribute_hidden; +extern void _dl_hash_del_object (struct link_map *lib) + attribute_hidden; + /* Allocate a `struct link_map' for a new object being loaded. */ extern struct link_map *_dl_new_object (char *realname, const char *libname, int type, struct link_map *loader, @@ -1257,6 +1254,15 @@ _dl_last_entry (struct link_namespaces *ns) return map; } +static inline uint_fast32_t +dl_new_hash (const char *s) +{ + uint_fast32_t h = 5381; + for (unsigned char c = *s; c != '\0'; c = *++s) + h = h * 33 + c; + return h & 0xffffffff; +} + __END_DECLS #endif /* ldsodefs.h */ |