]> granicus.if.org Git - llvm/commit
[AArch64][ELF] Add support for PLT decoding with BTI instructions present
authorPeter Smith <peter.smith@linaro.org>
Tue, 4 Jun 2019 16:35:40 +0000 (16:35 +0000)
committerPeter Smith <peter.smith@linaro.org>
Tue, 4 Jun 2019 16:35:40 +0000 (16:35 +0000)
commitf86c48400eef41e68017b7354e35ffca745dff85
treea9dc072fcb537d16ddd3d4e13498442038d2802f
parente03e3b716f41bedd802368296244578207446ff4
[AArch64][ELF] Add support for PLT decoding with BTI instructions present

Arm Architecture v8.5a introduces Branch Target Identification (BTI). When
enabled all indirect branches must target a bti instruction of the
appropriate form. As PLT sequences may sometimes be the target of an
indirect branch and PLT[0] always is, a static linker may need to generate
PLT sequences that contain "bti c" as the first instruction. In effect:
bti     c
adrp    x16, page offset to .got.plt
...
Instead of:
adrp    x16, page offset to .got.plt
...
At present the PLT decoding assumes the adrp will always be the first
instruction. This patch adds support for a single "bti c" to prefix it. A
test binary has been uploaded with such a PLT sequence. A forthcoming LLD
patch will make heavy use of the PLT decoding code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362523 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
test/tools/llvm-objdump/AArch64/plt.test