RuntimeDyldELF: don't create thunk if not needed
commit0f4cbb99e96180de2c70fdf9184e9faca9db5e49
authorEugene Leviant <eleviant@accesssoftek.com>
Mon, 9 Jan 2017 09:56:31 +0000 (9 09:56 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Mon, 9 Jan 2017 09:56:31 +0000 (9 09:56 +0000)
treef48f52dc677a0fe40bad7fd89668edfd3d03f2ae
parentf7babeb5d8e4d5d3b069fdda72285671fa74a2de
RuntimeDyldELF: don't create thunk if not needed

This patch doesn't create thunk for branch operation when following conditions are met:
- Architecture is AArch64
- Relocation target is in the same object file
- Relocation target is close enough to be encoded in immediate offset

In such case we branch directly to the target instead of branching to thunk

Differential revision: https://reviews.llvm.org/D28108

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