[llvm] [MC,ELF] .section: unconditionally print section flag 'G' after 'o' (PR #77422)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 00:12:38 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-loongarch
@llvm/pr-subscribers-debuginfo

@llvm/pr-subscribers-llvm-binary-utilities

Author: Fangrui Song (MaskRay)

<details>
<summary>Changes</summary>

- [MC] Parse SHF_LINK_ORDER argument before section group name
- [MC,ELF] .section: unconditionally print section flag 'G' after 'o'


---

Patch is 26.35 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/77422.diff


30 Files Affected:

- (modified) llvm/lib/MC/MCParser/ELFAsmParser.cpp (+3-3) 
- (modified) llvm/lib/MC/MCSectionELF.cpp (+9-9) 
- (modified) llvm/test/CodeGen/AArch64/patchable-function-entry.ll (+2-2) 
- (modified) llvm/test/CodeGen/LoongArch/patchable-function-entry.ll (+1-1) 
- (modified) llvm/test/CodeGen/Mips/ehframe-indirect.ll (+1-1) 
- (modified) llvm/test/CodeGen/Mips/xray-section-group.ll (+1-1) 
- (modified) llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/patchable-function-entry.ll (+1-1) 
- (modified) llvm/test/CodeGen/SPARC/constructor.ll (+2-2) 
- (modified) llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll (+1-1) 
- (modified) llvm/test/CodeGen/X86/constructor.ll (+6-6) 
- (modified) llvm/test/CodeGen/X86/elf-comdat.ll (+1-1) 
- (modified) llvm/test/CodeGen/X86/elf-comdat2.ll (+1-1) 
- (modified) llvm/test/CodeGen/X86/elf-group.ll (+1-1) 
- (modified) llvm/test/CodeGen/X86/explicit-section-mergeable.ll (+9-9) 
- (modified) llvm/test/CodeGen/X86/gcc_except_table-multi.ll (+2-2) 
- (modified) llvm/test/CodeGen/X86/global-sections-comdat.ll (+3-3) 
- (modified) llvm/test/CodeGen/X86/patchable-function-entry.ll (+2-2) 
- (modified) llvm/test/CodeGen/X86/stack-size-section-function-sections.ll (+2-2) 
- (modified) llvm/test/CodeGen/X86/stack-size-section.ll (+1-1) 
- (modified) llvm/test/CodeGen/X86/xray-section-group.ll (+1-1) 
- (modified) llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll (+1-1) 
- (modified) llvm/test/DebugInfo/SystemZ/eh_frame_personality.s (+1-1) 
- (modified) llvm/test/ExecutionEngine/JITLink/x86-64/ELF_ehframe_basic.s (+1-1) 
- (modified) llvm/test/ExecutionEngine/JITLink/x86-64/ELF_ehframe_large_static_personality_encodings.s (+1-1) 
- (modified) llvm/test/MC/ELF/alias-to-local.s (+1-1) 
- (modified) llvm/test/MC/ELF/relocation.s (+1-1) 
- (modified) llvm/test/MC/ELF/section-combine.s (+3-3) 
- (modified) llvm/test/MC/ELF/section.s (+16) 
- (modified) llvm/test/tools/llvm-symbolizer/frame.s (+1-1) 


``````````diff
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 93e1d2f44b8c56..d4c4bcb8564889 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -616,12 +616,12 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
     if (Mergeable)
       if (parseMergeSize(Size))
         return true;
-    if (Group)
-      if (parseGroup(GroupName, IsComdat))
-        return true;
     if (Flags & ELF::SHF_LINK_ORDER)
       if (parseLinkedToSym(LinkedToSym))
         return true;
+    if (Group)
+      if (parseGroup(GroupName, IsComdat))
+        return true;
     if (maybeParseUniqueID(UniqueID))
       return true;
   }
diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp
index 95fdf33522076e..b1efb839ba75f6 100644
--- a/llvm/lib/MC/MCSectionELF.cpp
+++ b/llvm/lib/MC/MCSectionELF.cpp
@@ -90,8 +90,6 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
     OS << 'e';
   if (Flags & ELF::SHF_EXECINSTR)
     OS << 'x';
-  if (Flags & ELF::SHF_GROUP)
-    OS << 'G';
   if (Flags & ELF::SHF_WRITE)
     OS << 'w';
   if (Flags & ELF::SHF_MERGE)
@@ -102,6 +100,8 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
     OS << 'T';
   if (Flags & ELF::SHF_LINK_ORDER)
     OS << 'o';
+  if (Flags & ELF::SHF_GROUP)
+    OS << 'G';
   if (Flags & ELF::SHF_GNU_RETAIN)
     OS << 'R';
 
@@ -183,13 +183,6 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
     OS << "," << EntrySize;
   }
 
-  if (Flags & ELF::SHF_GROUP) {
-    OS << ",";
-    printName(OS, Group.getPointer()->getName());
-    if (isComdat())
-      OS << ",comdat";
-  }
-
   if (Flags & ELF::SHF_LINK_ORDER) {
     OS << ",";
     if (LinkedToSym)
@@ -198,6 +191,13 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
       OS << '0';
   }
 
+  if (Flags & ELF::SHF_GROUP) {
+    OS << ",";
+    printName(OS, Group.getPointer()->getName());
+    if (isComdat())
+      OS << ",comdat";
+  }
+
   if (isUnique())
     OS << ",unique," << UniqueID;
 
diff --git a/llvm/test/CodeGen/AArch64/patchable-function-entry.ll b/llvm/test/CodeGen/AArch64/patchable-function-entry.ll
index 5750c1f601bdef..89a2e2bf4abbcf 100644
--- a/llvm/test/CodeGen/AArch64/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/AArch64/patchable-function-entry.ll
@@ -48,7 +48,7 @@ define void @f3() "patchable-function-entry"="3" comdat {
 ; CHECK-NEXT: .Lfunc_begin3:
 ; CHECK-COUNT-3: nop
 ; CHECK-NEXT:  ret
-; CHECK:       .section __patchable_function_entries,"aGwo", at progbits,f3,comdat,f3{{$}}
+; CHECK:       .section __patchable_function_entries,"awoG", at progbits,f3,f3,comdat{{$}}
 ; CHECK-NEXT:  .p2align 3
 ; CHECK-NEXT:  .xword .Lfunc_begin3
   ret void
@@ -60,7 +60,7 @@ define void @f5() "patchable-function-entry"="5" comdat {
 ; CHECK-NEXT: .Lfunc_begin4:
 ; CHECK-COUNT-5: nop
 ; CHECK-NEXT:  sub sp, sp, #16
-; CHECK:       .section __patchable_function_entries,"aGwo", at progbits,f5,comdat,f5{{$}}
+; CHECK:       .section __patchable_function_entries,"awoG", at progbits,f5,f5,comdat{{$}}
 ; CHECK:       .p2align 3
 ; CHECK-NEXT:  .xword .Lfunc_begin4
   %frame = alloca i8, i32 16
diff --git a/llvm/test/CodeGen/LoongArch/patchable-function-entry.ll b/llvm/test/CodeGen/LoongArch/patchable-function-entry.ll
index aaa3fda1ae7769..2e390d1e2c33af 100644
--- a/llvm/test/CodeGen/LoongArch/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/LoongArch/patchable-function-entry.ll
@@ -31,7 +31,7 @@ define void @f5() "patchable-function-entry"="5" comdat {
 ; CHECK-NEXT:    .Lfunc_begin2:
 ; CHECK-COUNT-5:   nop
 ; CHECK-NEXT:      ret
-; CHECK:         .section __patchable_function_entries,"aGwo", at progbits,f5,comdat,f5{{$}}
+; CHECK:         .section __patchable_function_entries,"awoG", at progbits,f5,f5,comdat{{$}}
 ; LA32:          .p2align 2
 ; LA32-NEXT:     .word .Lfunc_begin2
 ; LA64:          .p2align 3
diff --git a/llvm/test/CodeGen/Mips/ehframe-indirect.ll b/llvm/test/CodeGen/Mips/ehframe-indirect.ll
index b3f4b48329d7bc..e36fa2f9ce423d 100644
--- a/llvm/test/CodeGen/Mips/ehframe-indirect.ll
+++ b/llvm/test/CodeGen/Mips/ehframe-indirect.ll
@@ -62,7 +62,7 @@ declare void @foo()
 ; N64: .8byte _ZTISt9exception
 ; ALL: .hidden DW.ref.__gxx_personality_v0
 ; ALL: .weak DW.ref.__gxx_personality_v0
-; ALL: .section .data.DW.ref.__gxx_personality_v0,"aGw", at progbits,DW.ref.__gxx_personality_v0,comdat
+; ALL: .section .data.DW.ref.__gxx_personality_v0,"awG", at progbits,DW.ref.__gxx_personality_v0,comdat
 ; O32: .p2align 2
 ; N32: .p2align 2
 ; N64: .p2align 3
diff --git a/llvm/test/CodeGen/Mips/xray-section-group.ll b/llvm/test/CodeGen/Mips/xray-section-group.ll
index 5a208217092dd7..e9cd045d4411e1 100644
--- a/llvm/test/CodeGen/Mips/xray-section-group.ll
+++ b/llvm/test/CodeGen/Mips/xray-section-group.ll
@@ -24,7 +24,7 @@ $bar = comdat any
 define i32 @bar() nounwind noinline uwtable "function-instrument"="xray-always" comdat($bar) {
 ; CHECK: .section .text.bar,"axG", at progbits,bar,comdat
   ret i32 1
-; CHECK: .section xray_instr_map,"aGo", at progbits,bar,comdat,bar{{$}}
+; CHECK: .section xray_instr_map,"aoG", at progbits,bar,bar,comdat{{$}}
 }
 
 ; CHECK-OBJ: Section {
diff --git a/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll b/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
index 45aeb73b1a6ba9..025a5ad787fbe0 100644
--- a/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
@@ -49,9 +49,9 @@ entry:
 ; LARGE-SECUREPLT:   addi 30, 30, .LTOC-.L0$pb at l
 ; LARGE-SECUREPLT:   bl call_foo at PLT+32768
 
-; LARGE:      .section .bss.bar1,"aGw", at nobits,bar1,comdat
+; LARGE:      .section .bss.bar1,"awG", at nobits,bar1,comdat
 ; LARGE:      bar1:
-; LARGE:      .section .bss.bar2,"aGw", at nobits,bar1,comdat
+; LARGE:      .section .bss.bar2,"awG", at nobits,bar1,comdat
 ; LARGE:      bar2:
 ; LARGE:      .section .got2,"aw", at progbits
 ; LARGE-NEXT: .p2align 2
diff --git a/llvm/test/CodeGen/RISCV/patchable-function-entry.ll b/llvm/test/CodeGen/RISCV/patchable-function-entry.ll
index 2804fdfc1ac9c5..4eeb1bf3138580 100644
--- a/llvm/test/CodeGen/RISCV/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/RISCV/patchable-function-entry.ll
@@ -37,7 +37,7 @@ define void @f5() "patchable-function-entry"="5" comdat {
 ; NORVC-NEXT:    jalr zero, 0(ra)
 ; RVC-COUNT-5:   c.nop
 ; RVC-NEXT:      c.jr ra
-; CHECK:       .section __patchable_function_entries,"aGwo", at progbits,f5,comdat,f5{{$}}
+; CHECK:       .section __patchable_function_entries,"awoG", at progbits,f5,f5,comdat{{$}}
 ; RV32:        .p2align 2
 ; RV32-NEXT:   .word .Lfunc_begin2
 ; RV64:        .p2align 3
diff --git a/llvm/test/CodeGen/SPARC/constructor.ll b/llvm/test/CodeGen/SPARC/constructor.ll
index e69ad26d09279a..dea152dd0f0892 100644
--- a/llvm/test/CodeGen/SPARC/constructor.ll
+++ b/llvm/test/CodeGen/SPARC/constructor.ll
@@ -17,11 +17,11 @@ entry:
 ; CTOR:      .section      .ctors,"aw"
 ; CTOR-NEXT: .p2align      2
 ; CTOR-NEXT: .word  f
-; CTOR-NEXT: .section      .ctors.65520,"aGw"
+; CTOR-NEXT: .section      .ctors.65520,"awG", at progbits,v,comdat{{$}}
 ; CTOR-NEXT: .p2align      2
 ; CTOR-NEXT: .word  g
 
-; INIT-ARRAY:    .section  .init_array.15,"aGw"
+; INIT-ARRAY:    .section  .init_array.15,"awG", at init_array,v,comdat{{$}}
 ; INIT-ARRAY-NEXT: .p2align  2
 ; INIT-ARRAY-NEXT: .word g
 ; INIT-ARRAY-NEXT: .section  .init_array,"aw"
diff --git a/llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll b/llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
index b8217bbc00760f..3be3ab70f8a693 100644
--- a/llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
+++ b/llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
@@ -35,7 +35,7 @@ define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
 ; CHECK:		.section .text._Z4fooTIiET_v,"axG", at progbits,_Z4fooTIiET_v,comdat
 ; CHECK-LABEL:	_Z4fooTIiET_v:
 ; CHECK-NEXT:	[[FOOCOMDAT_BEGIN:.Lfunc_begin[0-9]+]]:
-; CHECK:		.section .llvm_bb_addr_map,"Go", at llvm_bb_addr_map,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
+; CHECK:		.section .llvm_bb_addr_map,"oG", at llvm_bb_addr_map,.text._Z4fooTIiET_v,_Z4fooTIiET_v,comdat{{$}}
 ; CHECK-NEXT:		.byte 2				# version
 ; CHECK-NEXT:		.byte 0				# feature
 ; CHECK-NEXT:		.quad [[FOOCOMDAT_BEGIN]]	# function address
diff --git a/llvm/test/CodeGen/X86/constructor.ll b/llvm/test/CodeGen/X86/constructor.ll
index 0fea69b5a7bcb5..3133979b32f837 100644
--- a/llvm/test/CodeGen/X86/constructor.ll
+++ b/llvm/test/CodeGen/X86/constructor.ll
@@ -43,17 +43,17 @@ entry:
 ; CTOR-NEXT:	.quad	j
 ; CTOR-NEXT:	.quad	i
 ; CTOR-NEXT:	.quad	f
-; CTOR-NEXT:	.section	.ctors.09980,"aGw", at progbits,v,comdat
+; CTOR-NEXT:	.section	.ctors.09980,"awG", at progbits,v,comdat
 ; CTOR-NEXT:	.p2align	3
 ; CTOR-NEXT:	.quad	h
-; CTOR-NEXT:	.section	.ctors.65520,"aGw", at progbits,v,comdat
+; CTOR-NEXT:	.section	.ctors.65520,"awG", at progbits,v,comdat
 ; CTOR-NEXT:	.p2align	3
 ; CTOR-NEXT:	.quad	g
 
-; INIT-ARRAY:		.section	.init_array.15,"aGw", at init_array,v,comdat
+; INIT-ARRAY:		.section	.init_array.15,"awG", at init_array,v,comdat
 ; INIT-ARRAY-NEXT:	.p2align	3
 ; INIT-ARRAY-NEXT:	.quad	g
-; INIT-ARRAY-NEXT:	.section	.init_array.55555,"aGw", at init_array,v,comdat
+; INIT-ARRAY-NEXT:	.section	.init_array.55555,"awG", at init_array,v,comdat
 ; INIT-ARRAY-NEXT:	.p2align	3
 ; INIT-ARRAY-NEXT:	.quad	h
 ; INIT-ARRAY-NEXT:	.section	.init_array,"aw", at init_array
@@ -62,10 +62,10 @@ entry:
 ; INIT-ARRAY-NEXT:	.quad	i
 ; INIT-ARRAY-NEXT:	.quad	j
 
-; NACL:		.section	.init_array.15,"aGw", at init_array,v,comdat
+; NACL:		.section	.init_array.15,"awG", at init_array,v,comdat
 ; NACL-NEXT:	.p2align	2
 ; NACL-NEXT:	.long	g
-; NACL-NEXT:	.section	.init_array.55555,"aGw", at init_array,v,comdat
+; NACL-NEXT:	.section	.init_array.55555,"awG", at init_array,v,comdat
 ; NACL-NEXT:	.p2align	2
 ; NACL-NEXT:	.long	h
 ; NACL-NEXT:	.section	.init_array,"aw", at init_array
diff --git a/llvm/test/CodeGen/X86/elf-comdat.ll b/llvm/test/CodeGen/X86/elf-comdat.ll
index 35d8d6f2d2af9b..10770dd07409d0 100644
--- a/llvm/test/CodeGen/X86/elf-comdat.ll
+++ b/llvm/test/CodeGen/X86/elf-comdat.ll
@@ -7,5 +7,5 @@ define void @f() comdat($f) {
 }
 ; CHECK: .section        .text.f,"axG", at progbits,f,comdat
 ; CHECK: .globl  f
-; CHECK: .section        .bss.v,"aGw", at nobits,f,comdat
+; CHECK: .section        .bss.v,"awG", at nobits,f,comdat
 ; CHECK: .globl  v
diff --git a/llvm/test/CodeGen/X86/elf-comdat2.ll b/llvm/test/CodeGen/X86/elf-comdat2.ll
index 786cec78cc30f7..3e43c43b7d7419 100644
--- a/llvm/test/CodeGen/X86/elf-comdat2.ll
+++ b/llvm/test/CodeGen/X86/elf-comdat2.ll
@@ -5,7 +5,7 @@ $foo = comdat any
 @foo = global i32 42
 
 ; CHECK:      .type   bar, at object
-; CHECK-NEXT: .section        .data.bar,"aGw", at progbits,foo,comdat
+; CHECK-NEXT: .section        .data.bar,"awG", at progbits,foo,comdat
 ; CHECK-NEXT: .globl  bar
 ; CHECK:      .type   foo, at object
 ; CHECK-NEXT: .data
diff --git a/llvm/test/CodeGen/X86/elf-group.ll b/llvm/test/CodeGen/X86/elf-group.ll
index 3aaef0fa49da13..a69ba491be0ffb 100644
--- a/llvm/test/CodeGen/X86/elf-group.ll
+++ b/llvm/test/CodeGen/X86/elf-group.ll
@@ -4,7 +4,7 @@
 
 ; CHECK: .section .text.f1,"axG", at progbits,f1{{$}}
 ; CHECK: .section .text.f2,"axG", at progbits,f1{{$}}
-; CHECK: .section .bss.g1,"aGw", at nobits,f1{{$}}
+; CHECK: .section .bss.g1,"awG", at nobits,f1{{$}}
 
 $f1 = comdat nodeduplicate
 
diff --git a/llvm/test/CodeGen/X86/explicit-section-mergeable.ll b/llvm/test/CodeGen/X86/explicit-section-mergeable.ll
index 0a3a60474e1ed9..09995919d95594 100644
--- a/llvm/test/CodeGen/X86/explicit-section-mergeable.ll
+++ b/llvm/test/CodeGen/X86/explicit-section-mergeable.ll
@@ -139,9 +139,9 @@
 !4 = !{ptr @implicit_rodata_cst4}
 
 ;; Test implicit section assignment for globals in distinct comdat groups.
-; CHECK: .section .rodata.cst4,"aGM", at progbits,4,f,comdat,unique,[[#U+7]]
+; CHECK: .section .rodata.cst4,"aMG", at progbits,4,f,comdat,unique,[[#U+7]]
 ; CHECK: implicit_rodata_cst4_comdat:
-; CHECK: .section .rodata.cst8,"aGM", at progbits,8,g,comdat,unique,[[#U+8]]
+; CHECK: .section .rodata.cst8,"aMG", at progbits,8,g,comdat,unique,[[#U+8]]
 ; CHECK: implicit_rodata_cst8_comdat:
 
 ;; Check that globals in distinct comdat groups that are explicitly assigned
@@ -153,11 +153,11 @@
 ;; are incorrect.
 ; CHECK: .section .explicit_comdat_distinct,"aM", at progbits,4,unique,[[#U+9]]
 ; CHECK: explicit_comdat_distinct_supply_uid:
-; CHECK: .section .explicit_comdat_distinct,"aGM", at progbits,4,f,comdat,unique,[[#U+10]]
+; CHECK: .section .explicit_comdat_distinct,"aMG", at progbits,4,f,comdat,unique,[[#U+10]]
 ; CHECK: explicit_comdat_distinct1:
-; CHECK: .section .explicit_comdat_distinct,"aGM", at progbits,4,g,comdat,unique,[[#U+10]]
+; CHECK: .section .explicit_comdat_distinct,"aMG", at progbits,4,g,comdat,unique,[[#U+10]]
 ; CHECK: explicit_comdat_distinct2:
-; CHECK: .section .explicit_comdat_distinct,"aGM", at progbits,8,h,comdat,unique,[[#U+11]]
+; CHECK: .section .explicit_comdat_distinct,"aMG", at progbits,8,h,comdat,unique,[[#U+11]]
 ; CHECK: explicit_comdat_distinct3:
 
 $f = comdat any
@@ -173,9 +173,9 @@ $h = comdat any
 @explicit_comdat_distinct3 = unnamed_addr constant [2 x i32] [i32 1, i32 1], section ".explicit_comdat_distinct", comdat($h)
 
 ;; Test implicit section assignment for globals in the same comdat group.
-; CHECK: .section .rodata.cst4,"aGM", at progbits,4,i,comdat,unique,[[#U+12]]
+; CHECK: .section .rodata.cst4,"aMG", at progbits,4,i,comdat,unique,[[#U+12]]
 ; CHECK: implicit_rodata_cst4_same_comdat:
-; CHECK: .section .rodata.cst8,"aGM", at progbits,8,i,comdat,unique,[[#U+13]]
+; CHECK: .section .rodata.cst8,"aMG", at progbits,8,i,comdat,unique,[[#U+13]]
 ; CHECK: implicit_rodata_cst8_same_comdat:
 
 ;; Check that globals in the same comdat group that are explicitly assigned
@@ -187,10 +187,10 @@ $h = comdat any
 ;; are incorrect.
 ; CHECK: .section .explicit_comdat_same,"aM", at progbits,4,unique,[[#U+14]]
 ; CHECK: explicit_comdat_same_supply_uid:
-; CHECK: .section .explicit_comdat_same,"aGM", at progbits,4,i,comdat,unique,[[#U+15]]
+; CHECK: .section .explicit_comdat_same,"aMG", at progbits,4,i,comdat,unique,[[#U+15]]
 ; CHECK: explicit_comdat_same1:
 ; CHECK: explicit_comdat_same2:
-; CHECK: .section .explicit_comdat_same,"aGM", at progbits,8,i,comdat,unique,[[#U+16]]
+; CHECK: .section .explicit_comdat_same,"aMG", at progbits,8,i,comdat,unique,[[#U+16]]
 ; CHECK: explicit_comdat_same3:
 
 $i = comdat any
diff --git a/llvm/test/CodeGen/X86/gcc_except_table-multi.ll b/llvm/test/CodeGen/X86/gcc_except_table-multi.ll
index 8da3ebfed2bdd7..1eb902ae90795d 100644
--- a/llvm/test/CodeGen/X86/gcc_except_table-multi.ll
+++ b/llvm/test/CodeGen/X86/gcc_except_table-multi.ll
@@ -17,7 +17,7 @@ define i32 @group() uwtable comdat personality ptr @__gxx_personality_v0 {
 ; CHECK:             .cfi_endproc
 ; NORMAL-NEXT:       .section .gcc_except_table.group,"aG", at progbits,group,comdat{{$}}
 ; SEP_BFD-NEXT:      .section .gcc_except_table.group,"aG", at progbits,group,comdat{{$}}
-; SEP-NEXT:          .section .gcc_except_table.group,"aGo", at progbits,group,comdat,group{{$}}
+; SEP-NEXT:          .section .gcc_except_table.group,"aoG", at progbits,group,group,comdat{{$}}
 ; SEP_NOUNIQUE-NEXT: .section .gcc_except_table,"aG", at progbits,group,comdat{{$}}
 ; NOUNIQUE-NEXT:     .section .gcc_except_table,"aG", at progbits,group,comdat{{$}}
 entry:
@@ -61,7 +61,7 @@ define i32 @zero() uwtable comdat personality ptr @__gxx_personality_v0 {
 ; CHECK:             .cfi_endproc
 ; NORMAL-NEXT:       .section .gcc_except_table.zero,"aG", at progbits,zero{{$}}
 ; SEP_BFD-NEXT:      .section .gcc_except_table.zero,"aG", at progbits,zero{{$}}
-; SEP-NEXT:          .section .gcc_except_table.zero,"aGo", at progbits,zero,zero{{$}}
+; SEP-NEXT:          .section .gcc_except_table.zero,"aoG", at progbits,zero,zero{{$}}
 ; SEP_NOUNIQUE-NEXT: .section .gcc_except_table,"aG", at progbits,zero{{$}}
 ; NOUNIQUE-NEXT:     .section .gcc_except_table,"aG", at progbits,zero{{$}}
 entry:
diff --git a/llvm/test/CodeGen/X86/global-sections-comdat.ll b/llvm/test/CodeGen/X86/global-sections-comdat.ll
index 730050dda5f30e..7b793815f238db 100644
--- a/llvm/test/CodeGen/X86/global-sections-comdat.ll
+++ b/llvm/test/CodeGen/X86/global-sections-comdat.ll
@@ -41,6 +41,6 @@ bb5:
 $G16 = comdat any
 @G16 = unnamed_addr constant i32 42, comdat
 
-; LINUX: .section	.rodata.cst4.G16,"aGM", at progbits,4,G16,comdat
-; LINUX-SECTIONS: .section	.rodata.cst4.G16,"aGM", at progbits,4,G16,comdat
-; LINUX-SECTIONS-SHORT: .section	.rodata.cst4,"aGM", at progbits,4,G16,comdat
+; LINUX: .section	.rodata.cst4.G16,"aMG", at progbits,4,G16,comdat
+; LINUX-SECTIONS: .section	.rodata.cst4.G16,"aMG", at progbits,4,G16,comdat
+; LINUX-SECTIONS-SHORT: .section	.rodata.cst4,"aMG", at progbits,4,G16,comdat
diff --git a/llvm/test/CodeGen/X86/patchable-function-entry.ll b/llvm/test/CodeGen/X86/patchable-function-entry.ll
index 124f5c57c74b5a..8c37f545108015 100644
--- a/llvm/test/CodeGen/X86/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/X86/patchable-function-entry.ll
@@ -50,7 +50,7 @@ define void @f3() "patchable-function-entry"="3" comdat {
 ; 32-NEXT:     nop
 ; 64:          nopl (%rax)
 ; CHECK:       ret
-; CHECK:       .section __patchable_function_entries,"aGwo", at progbits,f3,comdat,f3{{$}}
+; CHECK:       .section __patchable_function_entries,"awoG", at progbits,f3,f3,comdat{{$}}
 ; 32:          .p2align 2
 ; 32-NEXT:     .long .Lfunc_begin3
 ; 64:          .p2align 3
@@ -66,7 +66,7 @@ define void @f5() "patchable-function-entry"="5" comdat {
 ; 32-NEXT:     nop
 ; 64:          nopl 8(%rax,%rax)
 ; CHECK-NEXT:  ret
-; CHECK:       .section __patchable_function_entries,"aGwo", at progbits,f5,comdat,f5{{$}}
+; CHECK:       .section __patchable_function_entries,"awoG", at progbits,f5,f5,comdat{{$}}
 ; 32:          .p2align 2
 ; 32-NEXT:     .long .Lfunc_begin4
 ; 64:          .p2align 3
diff --git a/llvm/test/CodeGen/X86/stack-size-section-function-sections.ll b/llvm/test/CodeGen/X86/stack-size-section-function-sections.ll
index 92f312bd1185ce..b9606c081a90e0 100644
--- a/llvm/test/CodeGen/X86/stack-size-section-function-sections.ll
+++ b/llvm/test/CodeGen/X86/stack-size-section-function-sections.ll
@@ -15,9 +15,9 @@
 
 ; Check we add .stack_size section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
 ; UNIQ:   .section        .text._Z4fooTIiET_v,"axG", at progbits,_Z4fooTIiET_v,comdat{{$}}
-; UNIQ:   .section        .stack_sizes,"Go", at progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
+; UNIQ:   .section        .stack_sizes,"oG", at progbits,.text._Z4fooTIiET_v,_Z4fooTIiET_v,comdat{{$}}
 ; NOUNIQ: .section        .text,"axG", at progbits,_Z4fooTIiET_v,comdat,unique,3
-; NOUNIQ: .section        .stack_sizes,"Go", at progbits,_Z4fooTIiET_v,comdat,.text,unique,3
+; NOUNIQ: .section        .stack_sizes,"oG", at progbits,.text,_Z4fooTIiET_v,comdat,unique,3
 
 $_Z4fooTIiET_v = comdat any
 
diff --git a/llvm/test/CodeGen/X86/stack-size-section.ll b/llvm/test/CodeGen/X86/stack-size-section.ll
index 3652ee845a7f34..866acbe140147e 100644
--- a/llvm/test/CodeGen/X86/stack-size-section.ll
+++ b/llvm/test/CodeGen/X86/stack-size-section.ll
@@ -29,7 +29,7 @@ define void @func2() #0 {
 
 ; Check that we still put .stack_sizes into the corresponding COMDAT group if any.
 ; CHECK: .section .text._Z4fooTIiET_v,"axG", at progbits,_Z4fooTIiET_v,comdat
-; GROUPS: .section .stack_sizes,"Go", at progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
+; GROUPS: .section .stack_sizes,"oG", at progbits,.text._Z4fooTIiET_v,_Z4fooTIiET_v,comdat{{$}}
 ; NOGROUPS: .section .stack_sizes,"", at progbits
 $_Z4fooTIiET_v = comdat any
 define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
diff --git a/llvm/test/CodeGen/X86/xray-section-group.ll b/llvm/test/CodeGen/X86/xray-section-group.ll
index c05520adf89972..1f2855b089d22e 100644
--- a/llvm/test/CodeGen/X86/xray-section-group.ll
+++ b/llvm/test/CodeGen/X86/xray-section-group.ll
@@ -12,7 +12,7 @@ $bar = comdat any
 define i32 @bar() nounwind noinline uwtable "function-instrument"="xray-always" comdat($bar) {
 ; CHECK: .section .text.bar,"axG", at progbits,bar,comdat
   ret i32 1
-; CHECK: .section xray_instr_map,"aGo", at progbits,bar,comdat,bar{{$}}
+; CHECK: .section xray_instr_map,"aoG", at progbits,bar,bar,comdat{{$}}
 }
 
 ; CHECK-OBJ:      section xray_instr_map:
diff --git a/llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll b/l...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/77422


More information about the llvm-commits mailing list