diff options
author | Alan Modra <amodra@gmail.com> | 2014-08-30 09:44:47 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-08-30 10:12:44 +0930 |
commit | 6128f9cf2b2c4188145faba45596ce49dd0f08be (patch) | |
tree | ff192bcc7fe76a155cfbd84e43b8c8fad373790a /bfd/elf32-ppc.c | |
parent | 70cc888ddc8b51e5a2cf030941446f0373681463 (diff) | |
download | gdb-6128f9cf2b2c4188145faba45596ce49dd0f08be.zip gdb-6128f9cf2b2c4188145faba45596ce49dd0f08be.tar.gz gdb-6128f9cf2b2c4188145faba45596ce49dd0f08be.tar.bz2 |
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.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r-- | bfd/elf32-ppc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 97f4724..6fb603d 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) |