This is the mail archive of the binutils@sources.redhat.com 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]

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


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