[ELF] Optimize Arm PLT sequences
authorPeter Smith <peter.smith@linaro.org>
Mon, 18 Dec 2017 14:46:27 +0000 (14:46 +0000)
committerPeter Smith <peter.smith@linaro.org>
Mon, 18 Dec 2017 14:46:27 +0000 (14:46 +0000)
commit3c73a411285dd5ae9c49e3afa013c14c4d6e52c5
tree00a2d818403b3e95f8fe2184cbc20e213a7268ab
parent190979189a9aca2d9475caed279e1d29b15329b5
[ELF] Optimize Arm PLT sequences

A more efficient PLT sequence can be used when the distance between the
.plt and the end of the .plt.got is less than 128 Megabytes, which is
frequently true. We fall back to the old sequence when the offset is larger
than 128 Megabytes. This gives us an alternative to forcing the longer
entries with --long-plt as we gracefully fall back to it as needed.

See ELF for the ARM Architecture Appendix A for details of the PLT sequence.

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

llvm-svn: 320987
lld/ELF/Arch/ARM.cpp
lld/test/ELF/arm-branch-undef-weak-plt-thunk.s
lld/test/ELF/arm-exidx-shared.s
lld/test/ELF/arm-gnu-ifunc-plt.s
lld/test/ELF/arm-gnu-ifunc.s
lld/test/ELF/arm-plt-reloc.s
lld/test/ELF/arm-thumb-interwork-shared.s
lld/test/ELF/arm-thumb-plt-range-thunk-os.s
lld/test/ELF/arm-thumb-plt-reloc.s
lld/test/ELF/arm-thunk-re-add.s