diff options
| author | 2019-07-21 03:54:16 +0000 | |
|---|---|---|
| committer | 2019-07-21 03:54:16 +0000 | |
| commit | 518321a888a192cda6e8b9a18a281330aa108186 (patch) | |
| tree | 74726ea82c2c62567be9079bef6ab2d9782d6155 /libexec/ld.so/resolve.c | |
| parent | Get rid of `ddb_is_active' instead use `db_active'. (diff) | |
| download | wireguard-openbsd-518321a888a192cda6e8b9a18a281330aa108186.tar.xz wireguard-openbsd-518321a888a192cda6e8b9a18a281330aa108186.zip | |
In 2004, we upgraded to binutils 2.14 with did -zcombreloc by default.
In 2013, I implemented the single-entry LRU cache that gets the maximal
symbol reuse from combreloc. Since then, the ld.so generic relocation
symcache has been a waste of CPU and memory with 0% hit-rate, so kill it.
ok mpi@
Diffstat (limited to 'libexec/ld.so/resolve.c')
| -rw-r--r-- | libexec/ld.so/resolve.c | 49 |
1 files changed, 4 insertions, 45 deletions
diff --git a/libexec/ld.so/resolve.c b/libexec/ld.so/resolve.c index 2574cc3b953..2b9874ba7b3 100644 --- a/libexec/ld.so/resolve.c +++ b/libexec/ld.so/resolve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolve.c,v 1.90 2019/07/14 03:23:12 guenther Exp $ */ +/* $OpenBSD: resolve.c,v 1.91 2019/07/21 03:54:16 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -518,60 +518,19 @@ _dl_remove_object(elf_object_t *object) } -sym_cache *_dl_symcache; -int _dl_symcachestat_hits; -int _dl_symcachestat_lookups; - - Elf_Addr _dl_find_symbol_bysym(elf_object_t *req_obj, unsigned int symidx, - const Elf_Sym **this, int flags, const Elf_Sym *ref_sym, const elf_object_t **pobj) + const Elf_Sym **this, int flags, const Elf_Sym *ref_sym, + const elf_object_t **pobj) { - Elf_Addr ret; const Elf_Sym *sym; const char *symn; - const elf_object_t *sobj; - - _dl_symcachestat_lookups ++; - if (_dl_symcache != NULL && - symidx < req_obj->nchains && - _dl_symcache[symidx].obj != NULL && - _dl_symcache[symidx].sym != NULL && - _dl_symcache[symidx].flags == flags) { - - _dl_symcachestat_hits++; - sobj = _dl_symcache[symidx].obj; - *this = _dl_symcache[symidx].sym; - if (pobj) - *pobj = sobj; - return sobj->obj_base; - } sym = req_obj->dyn.symtab; sym += symidx; symn = req_obj->dyn.strtab + sym->st_name; - ret = _dl_find_symbol(symn, this, flags, ref_sym, req_obj, &sobj); - - if (pobj) - *pobj = sobj; - - if (_dl_symcache != NULL && symidx < req_obj->nchains) { -#if 0 - DL_DEB(("cache miss %d %p %p, %p %p %s %s %d %d %s\n", - symidx, - _dl_symcache[symidx].sym, *this, - _dl_symcache[symidx].obj, sobj, sobj->load_name, - sobj->dyn.strtab + (*this)->st_name, - _dl_symcache[symidx].flags, flags, req_obj->load_name)); -#endif - - _dl_symcache[symidx].sym = *this; - _dl_symcache[symidx].obj = sobj; - _dl_symcache[symidx].flags = flags; - } - - return ret; + return _dl_find_symbol(symn, this, flags, ref_sym, req_obj, pobj); } static int |
