X32 uses 32-bit ELF object files with 32-bit alignment, so the
.note.gnu.property section needs to be emitted as it is for X86.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D101689
OutStreamer->SwitchSection(Nt);
// Emitting note header.
- int WordSize = TT.isArch64Bit() ? 8 : 4;
+ const int WordSize =
+ TT.isArch64Bit() && TT.getEnvironment() != Triple::GNUX32 ? 8 : 4;
emitAlignment(WordSize == 4 ? Align(4) : Align(8));
OutStreamer->emitIntValue(4, 4 /*size*/); // data size for "GNU\0"
OutStreamer->emitIntValue(8 + WordSize, 4 /*size*/); // Elf_Prop size
; RUN: llc -mtriple i686-pc-linux < %s | FileCheck %s --check-prefix=X86
; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck %s --check-prefix=X86_64
+; RUN: llc -mtriple x86_64-pc-linux-gnux32 < %s | FileCheck %s --check-prefix=X86
; This test checks that the compiler emits a .note.gnu.property section for
; modules with "cf-protection" module flags.