PATCH: PR ld/13962: Misleading error message when linking a library with an empty library

H.J. Lu hongjiu.lu@intel.com
Mon May 14 13:50:00 GMT 2012


Hi,

Linker should ignore object without symbols.  OK to install?

Thanks.

H.J.
---
2012-05-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13962
	* elflink.c (elf_link_add_object_symbols): Ignore object
	without symbols.

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 03f07a9..fb3b242 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3693,6 +3693,10 @@ error_free_dyn:
 
   symcount = hdr->sh_size / bed->s->sizeof_sym;
 
+  /* If this object has no symbols, just ignore it.   */
+  if (symcount == 0)
+    return TRUE;
+
   /* The sh_info field of the symtab header tells us where the
      external symbols start.  We don't care about the local symbols at
      this point.  */



More information about the Binutils mailing list