This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Handle undefined symbol in DSO from DT_NEEDED
- To: binutils at sourceware dot cygnus dot com
- Subject: PATCH: Handle undefined symbol in DSO from DT_NEEDED
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Tue, 8 May 2001 21:02:53 -0700
- Cc: libc-alpha at sources dot redhat dot com
glibc 2.2.3 changes atexit from default to hidden. DSOs with
unversioned references to atexit fail to link if they are loaded
in via a DT_NEEDED entry. This patch makes it non-fatal. I will
check it in if I don't hear any objections by Thursday.
Thanks.
H.J.
----
2001-05-08 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_output_extsym): Undefined symbol in DSO
loaded in via a DT_NEEDED entry is not fatal.
Index: elflink.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elflink.h,v
retrieving revision 1.58
diff -u -p -r1.58 elflink.h
--- elflink.h 2001/05/03 06:45:26 1.58
+++ elflink.h 2001/05/09 03:52:01
@@ -5171,9 +5171,13 @@ elf_link_output_extsym (h, data)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
{
+ /* If elf_dt_soname (h->root.u.undef.abfd) != NULL, that means
+ this DSO is loaded in via a DT_NEEDED entry. The undefined
+ symbol isn't fatal. */
if (! ((*finfo->info->callbacks->undefined_symbol)
(finfo->info, h->root.root.string, h->root.u.undef.abfd,
- (asection *) NULL, 0, true)))
+ (asection *) NULL, 0,
+ elf_dt_soname (h->root.u.undef.abfd) == NULL)))
{
eoinfo->failed = true;
return false;