+2005-03-22 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
+ SEC_LINKER_CREATED. Attach to dynobj.
+ (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
+
2005-03-21 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
htab = ppc_elf_hash_table (info);
if (htab->sbss == NULL)
{
- flagword flags = SEC_IS_COMMON;
+ flagword flags = SEC_IS_COMMON | SEC_LINKER_CREATED;
- htab->sbss = bfd_make_section_anyway (abfd, ".sbss");
+ if (!htab->elf.dynobj)
+ htab->elf.dynobj = abfd;
+
+ htab->sbss = bfd_make_section_anyway (htab->elf.dynobj, ".sbss");
if (htab->sbss == NULL
- || ! bfd_set_section_flags (abfd, htab->sbss, flags))
+ || ! bfd_set_section_flags (htab->elf.dynobj, htab->sbss, flags))
return FALSE;
}
continue;
if (s == htab->plt
- || s == htab->got)
+ || s == htab->got
+ || s == htab->sbss)
{
/* Strip this section if we don't need it; see the
comment below. */
continue;
}
+ if (s == htab->sbss)
+ continue;
+
/* Allocate memory for the section contents. */
s->contents = bfd_zalloc (htab->elf.dynobj, s->size);
if (s->contents == NULL)