aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-02-12 15:06:55 +0000
committerNick Clifton <nickc@redhat.com>2009-02-12 15:06:55 +0000
commit2c2b4ed43a10475ae8707c032bcf9acdf4f1b0a8 (patch)
treebe4b548ed5aea8bcc62e1fb7f56792bcd69d3978 /bfd
parentd401d98a57f2e2d30befd5dbe479aaa2d5e83deb (diff)
downloadgdb-2c2b4ed43a10475ae8707c032bcf9acdf4f1b0a8.zip
gdb-2c2b4ed43a10475ae8707c032bcf9acdf4f1b0a8.tar.gz
gdb-2c2b4ed43a10475ae8707c032bcf9acdf4f1b0a8.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elflink.c9
2 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9343b34..f0515a2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 8685a2f..d0e4534 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -10228,8 +10228,13 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
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)