summary refs log tree commit diff
path: root/elf/dl-lookup.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-05-31 13:23:14 +0000
committerRoland McGrath <roland@gnu.org>1995-05-31 13:23:14 +0000
commita1a9d215963c548aef245cacd8efa944de69503b (patch)
treeff96263310f3c2e3c1f90d4ec8b332b7af028d84 /elf/dl-lookup.c
parent4174072112e4e2b43cc65a5093a433b4270aed49 (diff)
downloadglibc-a1a9d215963c548aef245cacd8efa944de69503b.tar.gz
glibc-a1a9d215963c548aef245cacd8efa944de69503b.tar.xz
glibc-a1a9d215963c548aef245cacd8efa944de69503b.zip
Tue May 30 15:52:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* mach/Makefile (server-interfaces): Removed notify and
 	device_reply.  For shlibs with eager binding, libmachuser.so must
 	not refer to any functions not defined in libc.
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r--elf/dl-lookup.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index a7afcc79bb..4d5d795ee5 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -20,6 +20,7 @@ Cambridge, MA 02139, USA.  */
 #include <stddef.h>
 #include <libelf.h>
 #include <link.h>
+#include <assert.h>
 
 /* Search loaded objects' symbol tables for a definition of 
    the symbol UNDEF_NAME.  Don't use a PLT defn in UNDEF_MAP, since
@@ -70,13 +71,13 @@ _dl_lookup_symbol (const char *undef_name, const Elf32_Sym **ref,
 	      continue;
 	    }
 
-	  if (sym == *ref)
+	  if (sym->st_shndx == SHN_UNDEF)
 	    /* This is the same symbol we are looking for the value for.
 	       If it is a PLT entry, it will have a value of its own;
 	       but that is not what we are looking for.  */
-	    continue;
+	      continue;
 
-	  if (strcmp (strtab + sym->st_name, undef_name))
+	  if (sym != *ref && strcmp (strtab + sym->st_name, undef_name))
 	    /* Not the symbol we are looking for.  */
 	    continue;
 
@@ -106,8 +107,8 @@ _dl_lookup_symbol (const char *undef_name, const Elf32_Sym **ref,
       const char msg[] = "undefined symbol: ";
       char buf[sizeof msg + strlen (undef_name)];
       memcpy (buf, msg, sizeof msg - 1);
-      memcpy (&buf[sizeof msg - 1], undef_name, sizeof buf - sizeof msg);
-      _dl_signal_error (0, reference_name, msg);
+      memcpy (&buf[sizeof msg - 1], undef_name, sizeof buf - sizeof msg + 1);
+      _dl_signal_error (0, reference_name, buf);
     }
 
   *ref = weak_value.s;