From a1a9d215963c548aef245cacd8efa944de69503b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 31 May 1995 13:23:14 +0000 Subject: Tue May 30 15:52:32 1995 Roland McGrath * 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. --- elf/dl-lookup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'elf/dl-lookup.c') 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 #include #include +#include /* 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; -- cgit v1.2.3