summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-05-20 23:50:34 +0000
committerUlrich Drepper <drepper@redhat.com>1997-05-20 23:50:34 +0000
commit65c0c1fd3611eb88f526cfb217d2371d5fa6ed47 (patch)
treedd6ba04e2101919ec42b06a991b51021043ecccd /elf
parentee815d3f296df75d79709e2b57fcebf695fb36a8 (diff)
(_dl_lookup_symbol_skip): Call _dl_signal_error when we can't find the
symbol.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-lookup.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 1000a52e0d..88ffcb45d5 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -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;
}