OSDN Git Service

[PowerPC] fix broken JIT-compiled code with tail call optimization
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Wed, 30 May 2018 04:48:29 +0000 (04:48 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Wed, 30 May 2018 04:48:29 +0000 (04:48 +0000)
commit9066b8af331e561337a41f2fea65c6c0723ea5cd
tree4a36b34097b4ab10ec3c90418b9b85295916090a
parent4548453c8b1ced476a7060c1c84461510b7e7f87
[PowerPC] fix broken JIT-compiled code with tail call optimization

The relocation for branch instructions in the dynamic loader of ExecutionEngine assumes branch instructions with R_PPC64_REL24 relocation type are only bl. However, with the tail call optimization, b instructions can be also used to jump into another function.
This patch makes the relocation to keep bits in the branch instruction other than the jump offset to avoid relocation rewrites a b instruction into bl.

Differential Revision: https://reviews.llvm.org/D47456

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333502 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_reloc.s [new file with mode: 0644]