[all-commits] [llvm/llvm-project] 024bb6: [Driver] Pass --target2= to linker from baremetal ...
Mikhail Maltsev via All-commits
all-commits at lists.llvm.org
Fri Apr 28 10:31:25 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 024bb62ffd072e9a90343e88c92e40b5849c2632
https://github.com/llvm/llvm-project/commit/024bb62ffd072e9a90343e88c92e40b5849c2632
Author: Mikhail Maltsev <mikhail.maltsev at arm.com>
Date: 2023-04-28 (Fri, 28 Apr 2023)
Changed paths:
M clang/lib/Driver/ToolChains/BareMetal.cpp
M clang/test/Driver/baremetal.cpp
Log Message:
-----------
[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
More information about the All-commits
mailing list