This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]