This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gc-sections fix
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Fri, 30 Apr 2004 18:13:43 +0930
- Subject: gc-sections fix
Now that we're doing gc-sections on apps linked with dynamic libs, we
need to be prepared to handle indirect syms.
bfd/ChangeLog
* elflink.c (elf_gc_mark): Follow indirect and warning syms.
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.66
diff -u -p -r1.66 elflink.c
--- bfd/elflink.c 21 Apr 2004 07:14:15 -0000 1.66
+++ bfd/elflink.c 30 Apr 2004 08:39:08 -0000
@@ -8173,6 +8173,9 @@ elf_gc_mark (struct bfd_link_info *info,
|| ELF_ST_BIND (isym[r_symndx].st_info) != STB_LOCAL)
{
h = sym_hashes[r_symndx - extsymoff];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
rsec = (*gc_mark_hook) (sec, info, rel, h, NULL);
}
else
--
Alan Modra
IBM OzLabs - Linux Technology Centre