A patch to only warn undefined symbol in DSO to be built
H . J . Lu
hjl@valinux.com
Tue Feb 6 23:51:00 GMT 2001
Here is a patch.
--
H.J. Lu (hjl@valinux.com)
---
2001-02-06 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_output_extsym): Only warn undefined
symbol in the shared library to be built.
Index: elflink.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elflink.h,v
retrieving revision 1.49
diff -u -p -r1.49 elflink.h
--- elflink.h 2001/02/06 17:27:06 1.49
+++ elflink.h 2001/02/07 07:45:43
@@ -5101,11 +5101,13 @@ elf_link_output_extsym (h, data)
linker will complain that the symbol is undefined when the
program is run. We don't have to worry about symbols that are
referenced by regular files, because we will already have issued
- warnings for them. */
+ warnings for them. If we are creating a shared library, we only
+ warn the undefined symbol in the shared library to be built. */
if (! finfo->info->relocateable
&& ! finfo->info->allow_shlib_undefined
- && ! (finfo->info->shared
- && !finfo->info->no_undefined)
+ && (!finfo->info->shared
+ || (finfo->info->no_undefined
+ && finfo->output_bfd == h->root.u.undef.abfd))
&& h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
More information about the Binutils
mailing list