Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
1999-02-03  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dlsym.c (dlsym_doit): If no symbol for RTLD_NEXT is found
	initialize ref element of args object so that dlsym does not dump
	a core.
	* elf/dlvsym.c (dlvsym_doit): Likewise.
  • Loading branch information
Ulrich Drepper committed Feb 3, 1999
1 parent f549233 commit 649ad05
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1999-02-03 Ulrich Drepper <drepper@cygnus.com>

* elf/dlsym.c (dlsym_doit): If no symbol for RTLD_NEXT is found
initialize ref element of args object so that dlsym does not dump
a core.
* elf/dlvsym.c (dlvsym_doit): Likewise.

1999-02-03 Jakub Jelinek <jj@ultra.linux.cz>

* sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S: Set branch
Expand Down
12 changes: 11 additions & 1 deletion elf/dlsym.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Look up a symbol in a shared object loaded by `dlopen'.
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999 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
Expand Down Expand Up @@ -65,6 +65,16 @@ RTLD_NEXT used in code not dynamically loaded"));

args->loadbase = _dl_lookup_symbol_skip (args->name, &args->ref,
l->l_local_scope, NULL, match);

if (args->loadbase == 0)
{
/* This means that no such symbol is defined. In this case we
have to provide a phony Elfxx_Sym entry since the value is
referenced in `dlsym'. */
static const ElfW(Sym) null_result;

args->ref = &null_result;
}
}
else
{
Expand Down
12 changes: 11 additions & 1 deletion elf/dlvsym.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Look up a versioned symbol in a shared object loaded by `dlopen'.
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999 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
Expand Down Expand Up @@ -71,6 +71,16 @@ RTLD_NEXT used in code not dynamically loaded"));
l->l_local_scope,
NULL, &args->version,
match);

if (args->loadbase == 0)
{
/* This means that no such symbol is defined. In this case we
have to provide a phony Elfxx_Sym entry since the value is
referenced in `dlsym'. */
static const ElfW(Sym) null_result;

args->ref = &null_result;
}
}
else
{
Expand Down

0 comments on commit 649ad05

Please sign in to comment.