This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR ld/13962: Misleading error message when linking a library with an empty library
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Mon, 14 May 2012 06:50:29 -0700
- Subject: PATCH: PR ld/13962: Misleading error message when linking a library with an empty library
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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. */