about summary refs log tree commit diff
path: root/elf/do-lookup.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-08 03:03:00 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-08 03:03:00 +0000
commitdec126b41a0bf2d807c3fc908bd8a0f1a9fa9277 (patch)
treed61bbc6512ab4f496d69ed494f1344704cb215ec /elf/do-lookup.h
parentb8565e7817d7c6afd8eac804867b88c9bad1c9f1 (diff)
downloadglibc-dec126b41a0bf2d807c3fc908bd8a0f1a9fa9277.tar.gz
glibc-dec126b41a0bf2d807c3fc908bd8a0f1a9fa9277.tar.xz
glibc-dec126b41a0bf2d807c3fc908bd8a0f1a9fa9277.zip
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.
Diffstat (limited to 'elf/do-lookup.h')
-rw-r--r--elf/do-lookup.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/elf/do-lookup.h b/elf/do-lookup.h
index 873e95322c..ffc98ab624 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;