From dec126b41a0bf2d807c3fc908bd8a0f1a9fa9277 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 8 Jun 2000 03:03:00 +0000 Subject: Update. * dlfcn/dlfcn.h: Pretty print dladdr declaraction. * elf/rtld.c (process_envvars): Recognize LD_DYNAMIC_WEAK. (_dl_dynamic_weak): New variable. * elf/dl-support.c: Likewise. * sysdeps/generic/ldsodefs.h: Declare _dl_dynamic_weak. * elf/do-lookup.h: If we find a weak definition treat it like a normal symbol unless _dl_dynamic_weak is nonzero. In the latter case treat it like before. --- elf/do-lookup.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'elf/do-lookup.h') diff --git a/elf/do-lookup.h b/elf/do-lookup.h index 873e953..ffc98ab 100644 --- a/elf/do-lookup.h +++ b/elf/do-lookup.h @@ -157,19 +157,23 @@ FCT (const char *undef_name, struct link_map *undef_map, found_it: switch (ELFW(ST_BIND) (sym->st_info)) { + case STB_WEAK: + /* Weak definition. Use this value if we don't find another. */ + if (__builtin_expect (_dl_dynamic_weak, 0)) + { + if (! result->s) + { + result->s = sym; + result->m = map; + } + break; + } + /* FALLTHROUGH */ case STB_GLOBAL: /* Global definition. Just what we need. */ result->s = sym; result->m = map; return 1; - case STB_WEAK: - /* Weak definition. Use this value if we don't find another. */ - if (! result->s) - { - result->s = sym; - result->m = map; - } - break; default: /* Local symbols are ignored. */ break; -- cgit v1.1