ppc476 linker workaround shared lib fixes
authorAlan Modra <amodra@gmail.com>
Fri, 5 Jun 2015 09:05:40 +0000 (18:35 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 5 Jun 2015 10:42:11 +0000 (20:12 +0930)
commitf8b447819b3d65c3bea65dee860110aa198c081e
tree9d43b6357d2341e839d71ee5b6b3babf64366a62
parentbdd2d2b7e6fbe90a07bd631cb599266fc6e12b5e
ppc476 linker workaround shared lib fixes

When building a shared lib from non-PIC objects, we'll get dynamic
text relocations.  These need to move with any insns we move.
Otherwise the dynamic reloc will modify the branch, resulting in
crashes and other unpleasant behaviour.

Also, ld -r --ppc476-workaround used with sufficiently aligned PIC
objects needs a fix for emitted REL16 relocs.

bfd/
* elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
relocs with insns moved by --ppc476-workaround.  Correct
output of REL16 relocs.
ld/testsuite/
* ld-powerpc/ppc476-shared.s,
* ld-powerpc/ppc476-shared.lnk,
* ld-powerpc/ppc476-shared.d,
* ld-powerpc/ppc476-shared2.d: New tests.
* ld-powerpc/powerpc.exp: Run them.
bfd/ChangeLog
bfd/elf32-ppc.c
ld/testsuite/ChangeLog
ld/testsuite/ld-powerpc/powerpc.exp
ld/testsuite/ld-powerpc/ppc476-shared.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/ppc476-shared.lnk [new file with mode: 0644]
ld/testsuite/ld-powerpc/ppc476-shared.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/ppc476-shared2.d [new file with mode: 0644]
This page took 0.025428 seconds and 4 git commands to generate.