+2004-08-17 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add "deleted_section".
+ (adjust_opd_syms): Attach opd syms for deleted entries to one of
+ the sections that will be discarded.
+
2004-08-16 Alan Modra <amodra@bigpond.net.au>
* elflink.c (elf_section_complain_discarded): Ignore .fixup.
asection *got;
asection *relgot;
+ /* Used during garbage collection. We attach global symbols defined
+ on removed .opd entries to this section so that the sym is removed. */
+ asection *deleted_section;
+
/* TLS local dynamic got entry handling. Suppose for multiple GOT
sections means we potentially need one of these for each input bfd. */
union {
if (adjust == -1)
{
/* This entry has been deleted. */
+ asection *dsec = ppc64_elf_tdata (sym_sec->owner)->deleted_section;
+ if (dsec == NULL)
+ {
+ for (dsec = sym_sec->owner->sections; dsec; dsec = dsec->next)
+ if (elf_discarded_section (dsec))
+ {
+ ppc64_elf_tdata (sym_sec->owner)->deleted_section = dsec;
+ break;
+ }
+ }
eh->elf.root.u.def.value = 0;
- eh->elf.root.u.def.section = &bfd_abs_section;
+ eh->elf.root.u.def.section = dsec;
}
else
eh->elf.root.u.def.value += adjust;