]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_dl_lookup_symbol_skip): Call _dl_signal_error when we can't find the
authorUlrich Drepper <drepper@redhat.com>
Tue, 20 May 1997 23:50:34 +0000 (23:50 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 20 May 1997 23:50:34 +0000 (23:50 +0000)
symbol.

elf/dl-lookup.c

index 1000a52e0df207a298f2e3c00e1ad1ccc902720c..88ffcb45d52e9f24894e64ca351a3671132d7e82 100644 (file)
@@ -1,5 +1,5 @@
 /* Look up a symbol in the loaded objects.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -162,7 +162,7 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
       (*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK))
     {
       /* We could find no value for a strong reference.  */
-      const char msg[] = "undefined symbol: ";
+      static const char msg[] = "undefined symbol: ";
       const size_t len = strlen (undef_name);
       char buf[sizeof msg + len];
       memcpy (buf, msg, sizeof msg - 1);
@@ -206,6 +206,18 @@ _dl_lookup_symbol_skip (const char *undef_name, const ElfW(Sym) **ref,
                     reference_name, skip_map, flags))
        break;
 
+  if (current_value.s == NULL &&
+      (*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK))
+    {
+      /* We could find no value for a strong reference.  */
+      static const char msg[] = "undefined symbol: ";
+      const size_t len = strlen (undef_name);
+      char buf[sizeof msg + len];
+      memcpy (buf, msg, sizeof msg - 1);
+      memcpy (&buf[sizeof msg - 1], undef_name, len + 1);
+      _dl_signal_error (0, reference_name, buf);
+    }
+
   *ref = current_value.s;
   return current_value.a;
 }