* elflink.c (bfd_elf_final_link): When counting the relocations,
if the header size has not been set yet then assume that it will
match the output section's reloc type.
+2009-02-12 Nick Clifton <nickc@redhat.com>
+
+ PR 9827
+ * elflink.c (bfd_elf_final_link): When counting the relocations,
+ if the header size has not been set yet then assume that it will
+ match the output section's reloc type.
+
2009-02-12 Nathan Sidwell <nathan@codesourcery.com>
* elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
bfd_size_type entsize1;
entsize1 = esdi->rel_hdr.sh_entsize;
- BFD_ASSERT (entsize1 == bed->s->sizeof_rel
- || entsize1 == bed->s->sizeof_rela);
+ /* PR 9827: If the header size has not been set yet then
+ assume that it will match the output section's reloc type. */
+ if (entsize1 == 0)
+ entsize1 = o->use_rela_p ? bed->s->sizeof_rela : bed->s->sizeof_rel;
+ else
+ BFD_ASSERT (entsize1 == bed->s->sizeof_rel
+ || entsize1 == bed->s->sizeof_rela);
same_size = !o->use_rela_p == (entsize1 == bed->s->sizeof_rel);
if (!same_size)