diff options
author | Harald van Dijk <harald@gigawatt.nl> | 2021-05-10 17:04:33 +0100 |
---|---|---|
committer | Harald van Dijk <harald@gigawatt.nl> | 2021-05-10 17:04:33 +0100 |
commit | b0ef2070bc7da2b458fb15b9413d9e90abc71759 (patch) | |
tree | 96e4b8fd783bff1b8ce6bac1bf97f45580efd61c /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 91a919e8994a2c47b3feaf906f83122776ae2cae (diff) | |
download | llvm-b0ef2070bc7da2b458fb15b9413d9e90abc71759.zip llvm-b0ef2070bc7da2b458fb15b9413d9e90abc71759.tar.gz llvm-b0ef2070bc7da2b458fb15b9413d9e90abc71759.tar.bz2 |
[X86] Fix position-independent TType encoding
The logic for x86_64 position-independent TType encodings was backwards,
using 8 bytes where 4 were wanted and 4 where 8 were wanted. For regular
x86_64, this was mostly harmless, exception tables are allowed to use
8-byte encodings even when it is not needed. For the large code model,
and for X32, however, the generated exception tables were wrong. For the
large code model, we cannot assume that the address will fit in 4 bytes.
For X32, we cannot use 64-bit relocations.
Fixes PR50148.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D102132
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 5315ec9..3227fd7 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -153,7 +153,7 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8); TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | ((CM == CodeModel::Small || CM == CodeModel::Medium) - ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4); + ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8); } else { PersonalityEncoding = (CM == CodeModel::Small || CM == CodeModel::Medium) |