From 6128f9cf2b2c4188145faba45596ce49dd0f08be Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 30 Aug 2014 09:44:47 +0930 Subject: [PATCH] ppc476 patch area size miscalculation ppc476 sections that end exactly on a page boundary need the workaround applied when a function ends in "bctr", or when pasting together code from multiple sections. The space allocated for the patch area didn't allow for this case, while the code in relocate_section performing the patches did, leading to an assertion failure. * elf32-ppc.c (ppc_elf_relax_section): Fix off by one error. --- bfd/ChangeLog | 4 ++++ bfd/elf32-ppc.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fae94fd00a5..8cbab99e3c1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2014-08-30 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Fix off by one error. + 2014-08-29 Alan Modra * elf64-ppc.c (ppc64_elf_relocate_section): Report a different diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 97f47243302..6fb603d3aea 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -7165,7 +7165,7 @@ ppc_elf_relax_section (bfd *abfd, bfd_vma pagesize = (bfd_vma) 1 << htab->params->pagesize_p2; addr = isec->output_section->vma + isec->output_offset; - end_addr = addr + trampoff - 1; + end_addr = addr + trampoff; addr &= -pagesize; crossings = ((end_addr & -pagesize) - addr) >> htab->params->pagesize_p2; if (crossings != 0) -- 2.30.2