]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ppc476 icache workaround fix for bctr
authorAlan Modra <amodra@gmail.com>
Sat, 5 Apr 2014 07:13:36 +0000 (17:43 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Apr 2014 02:38:35 +0000 (12:08 +0930)
commitd7a41b12be3dac389ffb2567bc09abbf4b74e793
tree19c1308fda5205a0b57cd14997ef25b7eb17e5df
parent1e82f67aeaeffb362b2960b444b9fbc2b3628358
ppc476 icache workaround fix for bctr

I got the ppc476 workaround wrong.  bctr (and bctrl) as the last
instruction in a page can hit the icache bug if the preceding mtctr
insn is close by, and the destination is in the first few instructions
on the next page.  This scenario can occur with code generated by gcc
to implement switch statements, or in code generated to call by
function pointer.

To prevent the bctr problem it is also necessary to remove other
instructions that otherwise would be safe.

bfd/
* elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list
of safe ppc476 insns at end of page.  Also remove non-branch insns.
Expand comments.
ld/
* emultempl/ppc32elf.em (no_zero_padding, ppc_finish): New functions.
(LDEMUL_FINISH): Define.
bfd/ChangeLog
bfd/elf32-ppc.c
ld/ChangeLog
ld/emultempl/ppc32elf.em