aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorMikhail Maltsev <mikhail.maltsev@arm.com>2023-04-28 18:30:49 +0100
committerMikhail Maltsev <mikhail.maltsev@arm.com>2023-04-28 18:30:49 +0100
commit024bb62ffd072e9a90343e88c92e40b5849c2632 (patch)
treec468c7de5918c692b389aa193c363907c58b1137 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent15f0491d3963d91202aef659acc20f59aa83fae7 (diff)
downloadllvm-024bb62ffd072e9a90343e88c92e40b5849c2632.zip
llvm-024bb62ffd072e9a90343e88c92e40b5849c2632.tar.gz
llvm-024bb62ffd072e9a90343e88c92e40b5849c2632.tar.bz2
[Driver] Pass --target2= to linker from baremetal toolchain
According to the GNU ld manual https://sourceware.org/binutils/docs/ld/ARM.html#ARM the R_ARM_TARGET2 relocation (used in exception handling tables) is treated differently depending on the target. By default, LLD treats R_ARM_TARGET2 as R_ARM_GOT_PREL (--target2=got-rel), which is correct for Linux but not for embedded targets. This patch adds --target2=rel to linker options in the baremetal toolchain driver so that on baremetal targets, R_ARM_TARGET2 is treated as R_ARM_REL32. Such behavior is compatible with GNU ld and unwinding libraries (e.g., libuwind). Reviewed By: peter.smith, phosek Differential Revision: https://reviews.llvm.org/D149458
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions