From f75370310c097cde2fce5d980398ecef8f48b633 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Mon, 30 Oct 2023 09:24:18 -0700 Subject: [PATCH] [X86] Print 'l' section flag for SHF_X86_64_LARGE (#70380) When directly compiling to an object file we properly set the section flag, but not when emitting assembly. --- llvm/lib/MC/MCSectionELF.cpp | 3 +++ llvm/test/MC/ELF/section.s | 2 ++ 2 files changed, 5 insertions(+) diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp index 666252ffcb74..95fdf3352207 100644 --- a/llvm/lib/MC/MCSectionELF.cpp +++ b/llvm/lib/MC/MCSectionELF.cpp @@ -123,6 +123,9 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T, } else if (Arch == Triple::hexagon) { if (Flags & ELF::SHF_HEX_GPREL) OS << 's'; + } else if (Arch == Triple::x86_64) { + if (Flags & ELF::SHF_X86_64_LARGE) + OS << 'l'; } OS << '"'; diff --git a/llvm/test/MC/ELF/section.s b/llvm/test/MC/ELF/section.s index 3a6d046821f4..8c625256a276 100644 --- a/llvm/test/MC/ELF/section.s +++ b/llvm/test/MC/ELF/section.s @@ -269,6 +269,8 @@ bar: // CHECK-NEXT: ] .section .large,"l" +// ASM: .section .large,"l" + // CHECK: Section { // CHECK: Name: .large // CHECK-NEXT: Type: SHT_PROGBITS