[llvm] f753703 - [X86] Print 'l' section flag for SHF_X86_64_LARGE (#70380)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 09:24:22 PDT 2023


Author: Arthur Eubanks
Date: 2023-10-30T09:24:18-07:00
New Revision: f75370310c097cde2fce5d980398ecef8f48b633

URL: https://github.com/llvm/llvm-project/commit/f75370310c097cde2fce5d980398ecef8f48b633
DIFF: https://github.com/llvm/llvm-project/commit/f75370310c097cde2fce5d980398ecef8f48b633.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/MC/MCSectionELF.cpp
    llvm/test/MC/ELF/section.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp
index 666252ffcb74eb3..95fdf33522076e4 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 3a6d046821f4ae5..8c625256a2761d8 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


        


More information about the llvm-commits mailing list