This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR ld/3953: ld crashes upon use of .gnu.warning.<symbol> sections
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 2 Feb 2007 11:51:48 -0800
- Subject: PATCH: PR ld/3953: ld crashes upon use of .gnu.warning.<symbol> sections
We need to check warning symbol when adding default symbol.
H.J.
----
2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3953
* elflink.c (_bfd_elf_add_default_symbol): Check warning symbol
when adding default symbol.
--- bfd/elflink.c.warn 2007-02-02 09:21:56.000000000 -0800
+++ bfd/elflink.c 2007-02-02 11:47:01.000000000 -0800
@@ -1595,6 +1595,10 @@ _bfd_elf_add_default_symbol (bfd *abfd,
hi = h;
}
+ /* Check if HI is a warning symbol. */
+ if (hi->root.type == bfd_link_hash_warning)
+ hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
+
/* If there is a duplicate definition somewhere, then HI may not
point to an indirect symbol. We will have reported an error to
the user in that case. */