ELF: Add support for short thunks on ARM.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 29 Mar 2018 22:43:52 +0000 (22:43 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 29 Mar 2018 22:43:52 +0000 (22:43 +0000)
commit015d30c807970c7ba9f42df5b2a3b3552bbd5e00
tree5117410485a336179944863b42998c10f0e4ce1d
parent9e3eb9f9d2a2e34d360d740fe95fc84411010b85
ELF: Add support for short thunks on ARM.

A short thunk uses a direct branch (b or b.w) instruction, and is used
when the target has the same thumbness as the thunk and is within
direct branch range (32MB for ARM, 16MB for Thumb-2). Reduces the
size of Chromium for Android's .text section by around 160KB.

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

llvm-svn: 328846
12 files changed:
lld/ELF/Thunks.cpp
lld/test/ELF/Inputs/arm-long-thunk-converge.lds [new file with mode: 0644]
lld/test/ELF/Inputs/far-long-arm-abs.s [new file with mode: 0644]
lld/test/ELF/arm-branch-rangethunk.s
lld/test/ELF/arm-long-thunk-converge.s [new file with mode: 0644]
lld/test/ELF/arm-thumb-condbranch-thunk.s
lld/test/ELF/arm-thumb-range-thunk-os.s
lld/test/ELF/arm-thumb-thunk-empty-pass.s
lld/test/ELF/arm-thunk-largesection.s
lld/test/ELF/arm-thunk-linkerscript-large.s
lld/test/ELF/arm-thunk-linkerscript-sort.s
lld/test/ELF/arm-thunk-multipass.s