[all-commits] [llvm/llvm-project] ca6596: [AArch64] Unconditionally use DW_EH_PE_indirect|DW...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Sun Feb 5 10:46:55 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ca65969c3ea0ad3db31e8b3646b960c75ef5f6c8
https://github.com/llvm/llvm-project/commit/ca65969c3ea0ad3db31e8b3646b960c75ef5f6c8
Author: Fangrui Song <i at maskray.me>
Date: 2023-02-05 (Sun, 05 Feb 2023)
Changed paths:
M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
M llvm/test/CodeGen/AArch64/arm64-big-endian-eh.ll
M llvm/test/CodeGen/AArch64/pic-eh-stubs.ll
M llvm/test/DebugInfo/AArch64/eh_frame_personality.ll
M llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll
Log Message:
-----------
[AArch64] Unconditionally use DW_EH_PE_indirect|DW_EH_PE_pcrel personality/lsda/ttype encodings
For -fno-pic, without DW_EH_PE_indirect, the personality routine pointer in a
CIE needs an R_AARCH64_ABS64 relocation. In common configurations that
`__gcc_personality_v0` is defined in a shared object, this will lead to a
discouraged canonical PLT entry, or, if `ld.lld -z notext` (betwen D122459 and
D143136), a dynamic R_AARCH64_ABS64 relocation with an incorrect offset:
https://github.com/llvm/llvm-project/issues/60392
Since GCC uses DW_EH_PE_indirect for -fno-pic code (the behavior hasn't changed
since the initial port in 2012), let's follow suit by simplifying the code.
(
For tiny and small code models, we use DW_EH_PE_sdata8 instead of GCC's
DW_EH_PE_sdata4. This is a deliberate choice to support personality-.eh_frame
offset > 2GiB. This is unneeded for small code model since "Max text segment
size < 2GiB" but making `-fno-pic -mcmodel={tiny,small}` different seems
unnecessary: the scenarios that uses both -fno-pic and C++ exceptions have been
increasingly rare now, so there is little advantage optimizing for the little
size saving with code complexity.
)
---
Two clang/test/Interpreter tests would fail without 6747fc07d1aa94e22622e278e5a02ba70675ac9b
([ORC] Use JITLink as the default linker for LLJIT on Linux/arm64.)
Reviewed By: MatzeB
Differential Revision: https://reviews.llvm.org/D143039
More information about the All-commits
mailing list