This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: A patch to only warn undefined symbol in DSO to be built
- To: "H . J . Lu" <hjl at valinux dot com>
- Subject: Re: A patch to only warn undefined symbol in DSO to be built
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Wed, 7 Feb 2001 19:03:58 +1100 (EST)
- cc: fjh at cs dot mu dot oz dot au, binutils at sourceware dot cygnus dot com, Ian Lance Taylor <ian at zembu dot com>
On Tue, 6 Feb 2001, H . J . Lu wrote:
> Here is a patch.
I have a competing one that I was busy checking when your email arrived.
:-)
Index: elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.78
diff -u -p -r1.78 elflink.h
--- elflink.h 2001/01/23 11:45:53 1.78
+++ elflink.h 2001/02/07 07:58:30
@@ -5092,9 +5092,10 @@ elf_link_output_extsym (h, data)
warnings for them. */
if (! finfo->info->relocateable
&& ! finfo->info->allow_shlib_undefined
- && ! (finfo->info->shared
- && !finfo->info->no_undefined)
&& h->root.type == bfd_link_hash_undefined
+ && (! finfo->info->shared
+ || ! finfo->info->no_undefined
+ || (h->root.u.undef.abfd->flags & DYNAMIC) == 0)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
{
It does the same thing in a slightly different way, but also checks for
bfd_link_hash_undefined before accessing h_.root.u.undef
Alan