]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PowerPC64 debian bug 886264, out-of-line save/restore functions
authorAlan Modra <amodra@gmail.com>
Wed, 14 Mar 2018 11:39:33 +0000 (22:09 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 21 Mar 2018 09:00:47 +0000 (19:30 +1030)
commitd66deb71f1537e2e30dccdfda22eed5d46ec47eb
treeb76935854e5106d5ab1154df5fd5b6937ee5f018
parent345da48bf531f73b87f68b0146f3cb3934a6a069
PowerPC64 debian bug 886264, out-of-line save/restore functions

This calculation in relocate_section

      if (stub_entry->stub_type == ppc_stub_save_res)
relocation += (stub_sec->output_offset
       + stub_sec->output_section->vma
       + stub_sec->size - htab->sfpr->size
       - htab->sfpr->output_offset
       - htab->sfpr->output_section->vma);

to adjust from the original out-of-line save/restore function address
in sfpr to a copy at the end of stub_sec goes wrong when stub_sec is
padded, because the copy is no longer at the end of stub_sec.  The
solution is to pad before copying sfpr, so the copy is always at the
end of stub_sec.

* elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
sfpr size added before defining alias symbols.
(ppc64_elf_build_stubs): Add stub section padding before
copying sfpr contents and defining save/restore alias symbols.

(cherry picked from commit 7dda8d3cf3b089bb7e03c4cdbec827fc6a188c88)
bfd/ChangeLog
bfd/elf64-ppc.c