[ELF] Pre-create ThunkSections at Target specific intervals
authorPeter Smith <peter.smith@linaro.org>
Fri, 27 Oct 2017 08:58:28 +0000 (08:58 +0000)
committerPeter Smith <peter.smith@linaro.org>
Fri, 27 Oct 2017 08:58:28 +0000 (08:58 +0000)
commitf0c70f8d3449dd672a33133aba4ef0f781c5044c
tree7d3610847bf3e8c22e2be5c85a8e9fcf56f38fb8
parent4a8e11595c9283354cac92876376c32e1a202cd3
[ELF] Pre-create ThunkSections at Target specific intervals

When an OutputSection is larger than the branch range for a Target we
need to place thunks such that they are always in range of their caller,
and sufficiently spaced to maximise the number of callers that can use
the thunk. We use the simple heuristic of placing the
ThunkSection at intervals corresponding to a target specific branch range.
If the OutputSection is small we put the thunks at the end of the executable
sections.

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

llvm-svn: 316751
lld/ELF/Arch/ARM.cpp
lld/ELF/Relocations.cpp
lld/ELF/Relocations.h
lld/ELF/SyntheticSections.cpp
lld/ELF/Target.h
lld/test/ELF/arm-thumb-thunk-symbols.s