aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authormyxoid <64892339+myxoid@users.noreply.github.com>2023-11-05 23:33:20 +0000
committerGitHub <noreply@github.com>2023-11-05 15:33:20 -0800
commitc5ecf5a130f087f493802800f3565c7bb75c238a (patch)
tree9dd0ccadbe5bbea8f5e5a49b7ecde2079aa652b6 /llvm/lib/MC/ELFObjectWriter.cpp
parent25a2d51842dc03a2b4cb9039aed5457495a2d29a (diff)
downloadllvm-c5ecf5a130f087f493802800f3565c7bb75c238a.zip
llvm-c5ecf5a130f087f493802800f3565c7bb75c238a.tar.gz
llvm-c5ecf5a130f087f493802800f3565c7bb75c238a.tar.bz2
Fix compression header size check in ELF writer (#66888)
The test had 32-bit and 64-bit header sizes the wrong way around.
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 8490fef..e4d18d8 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -843,7 +843,7 @@ bool ELFWriter::maybeWriteCompression(
uint32_t ChType, uint64_t Size,
SmallVectorImpl<uint8_t> &CompressedContents, Align Alignment) {
uint64_t HdrSize =
- is64Bit() ? sizeof(ELF::Elf32_Chdr) : sizeof(ELF::Elf64_Chdr);
+ is64Bit() ? sizeof(ELF::Elf64_Chdr) : sizeof(ELF::Elf32_Chdr);
if (Size <= HdrSize + CompressedContents.size())
return false;
// Platform specific header is followed by compressed data.