aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 384348e..e437427 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3866,6 +3866,11 @@ ppc64_elf_edit_opd (obfd, info)
sec->_cooked_size = wptr - sec->contents;
sec->reloc_count = write_rel - relstart;
+ /* Fudge the size too, as this is used later in
+ elf_bfd_final_link if we are emitting relocs. */
+ elf_section_data (sec)->rel_hdr.sh_size
+ = sec->reloc_count * elf_section_data (sec)->rel_hdr.sh_entsize;
+ BFD_ASSERT (elf_section_data (sec)->rel_hdr2 == NULL);
}
else if (elf_section_data (sec)->relocs != relstart)
free (relstart);