[llvm] r299479 - Change section flag character for SHF_LINK_ORDER to "o".

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 15:35:09 PDT 2017


Author: eugenis
Date: Tue Apr  4 17:35:08 2017
New Revision: 299479

URL: http://llvm.org/viewvc/llvm-project?rev=299479&view=rev
Log:
Change section flag character for SHF_LINK_ORDER to "o".

GAS uses "m" as a compatibility alias for "M" (SHF_MERGE).

"o" is free, except on ia64, where it already means SHF_LINK_ORDER.

Modified:
    llvm/trunk/docs/Extensions.rst
    llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
    llvm/trunk/lib/MC/MCSectionELF.cpp
    llvm/trunk/test/CodeGen/X86/elf-associated.ll
    llvm/trunk/test/MC/ELF/section-metadata-err1.s
    llvm/trunk/test/MC/ELF/section-metadata-err2.s
    llvm/trunk/test/MC/ELF/section-metadata-err3.s
    llvm/trunk/test/MC/ELF/section-metadata-err4.s
    llvm/trunk/test/MC/ELF/section.s

Modified: llvm/trunk/docs/Extensions.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Extensions.rst?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/docs/Extensions.rst (original)
+++ llvm/trunk/docs/Extensions.rst Tue Apr  4 17:35:08 2017
@@ -204,7 +204,7 @@ For example, the following code creates
 The unique number is not present in the resulting object at all. It is just used
 in the assembler to differentiate the sections.
 
-The 'm' flag is mapped to SHF_LINK_ORDER. If it is present, a symbol
+The 'o' flag is mapped to SHF_LINK_ORDER. If it is present, a symbol
 must be given that identifies the section to be placed is the
 .sh_link.
 
@@ -212,14 +212,14 @@ must be given that identifies the sectio
 
         .section .foo,"a", at progbits
         .Ltmp:
-        .section .bar,"am", at progbits,.Ltmp
+        .section .bar,"ao", at progbits,.Ltmp
 
 which is equivalent to just
 
 .. code-block:: gas
 
         .section .foo,"a", at progbits
-        .section .bar,"am", at progbits,.foo
+        .section .bar,"ao", at progbits,.foo
 
 
 Target Specific Behaviour

Modified: llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp Tue Apr  4 17:35:08 2017
@@ -298,7 +298,7 @@ static unsigned parseSectionFlags(String
     case 'w':
       flags |= ELF::SHF_WRITE;
       break;
-    case 'm':
+    case 'o':
       flags |= ELF::SHF_LINK_ORDER;
       break;
     case 'M':

Modified: llvm/trunk/lib/MC/MCSectionELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionELF.cpp?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCSectionELF.cpp (original)
+++ llvm/trunk/lib/MC/MCSectionELF.cpp Tue Apr  4 17:35:08 2017
@@ -104,7 +104,7 @@ void MCSectionELF::PrintSwitchToSection(
   if (Flags & ELF::SHF_TLS)
     OS << 'T';
   if (Flags & ELF::SHF_LINK_ORDER)
-    OS << 'm';
+    OS << 'o';
 
   // If there are target-specific flags, print them.
   Triple::ArchType Arch = T.getArch();

Modified: llvm/trunk/test/CodeGen/X86/elf-associated.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/elf-associated.ll?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/elf-associated.ll (original)
+++ llvm/trunk/test/CodeGen/X86/elf-associated.ll Tue Apr  4 17:35:08 2017
@@ -4,23 +4,23 @@
 @a = global i32 1
 @b = global i32 2, !associated !0
 !0 = !{i32* @a}
-; CHECK-DAG: .section .data.b,"awm", at progbits,a
+; CHECK-DAG: .section .data.b,"awo", at progbits,a
 
 ; Loop is OK. Also, normally -data-sections=0 would place @c and @d in the same section. !associated prevents that.
 @c = global i32 2, !associated !2
 @d = global i32 2, !associated !1
 !1 = !{i32* @c}
 !2 = !{i32* @d}
-; CHECK-DAG: .section .data.c,"awm", at progbits,d
-; CHECK-DAG: .section .data.d,"awm", at progbits,c
+; CHECK-DAG: .section .data.c,"awo", at progbits,d
+; CHECK-DAG: .section .data.d,"awo", at progbits,c
 
 ; BSS is OK.
 @e = global i32 0
 @f = global i32 0, !associated !3
 @g = global i32 1, !associated !3
 !3 = !{i32* @e}
-; CHECK-DAG: .section .bss.f,"awm", at nobits,e
-; CHECK-DAG: .section .data.g,"awm", at progbits,e
+; CHECK-DAG: .section .bss.f,"awo", at nobits,e
+; CHECK-DAG: .section .data.g,"awo", at progbits,e
 
 ; Explicit sections.
 @h = global i32 1, section "aaa"
@@ -29,9 +29,9 @@
 @k = global i32 1, !associated !4
 !4 = !{i32* @h}
 ; CHECK-DAG: .section	aaa,"aw", at progbits
-; CHECK-DAG: .section	bbb,"awm", at progbits,h,unique,1
-; CHECK-DAG: .section	bbb,"awm", at progbits,h,unique,2
-; CHECK-DAG: .section	.data.k,"awm", at progbits,h
+; CHECK-DAG: .section	bbb,"awo", at progbits,h,unique,1
+; CHECK-DAG: .section	bbb,"awo", at progbits,h,unique,2
+; CHECK-DAG: .section	.data.k,"awo", at progbits,h
 
 ; Non-GlobalObject metadata.
 @l = global i32 1, section "ccc", !associated !5

Modified: llvm/trunk/test/MC/ELF/section-metadata-err1.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section-metadata-err1.s?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/section-metadata-err1.s (original)
+++ llvm/trunk/test/MC/ELF/section-metadata-err1.s Tue Apr  4 17:35:08 2017
@@ -2,4 +2,4 @@
 
 // CHECK: error: symbol is not in a section: foo
 
-        .section .shf_metadata,"am", at progbits,foo
+        .section .shf_metadata,"ao", at progbits,foo

Modified: llvm/trunk/test/MC/ELF/section-metadata-err2.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section-metadata-err2.s?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/section-metadata-err2.s (original)
+++ llvm/trunk/test/MC/ELF/section-metadata-err2.s Tue Apr  4 17:35:08 2017
@@ -3,4 +3,4 @@
 // CHECK: error: symbol is not in a section: foo
 
         .quad foo
-        .section .shf_metadata,"am", at progbits,foo
+        .section .shf_metadata,"ao", at progbits,foo

Modified: llvm/trunk/test/MC/ELF/section-metadata-err3.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section-metadata-err3.s?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/section-metadata-err3.s (original)
+++ llvm/trunk/test/MC/ELF/section-metadata-err3.s Tue Apr  4 17:35:08 2017
@@ -3,4 +3,4 @@
 // CHECK: error: symbol is not in a section: foo
 
         foo = 42
-        .section .shf_metadata,"am", at progbits,foo
+        .section .shf_metadata,"ao", at progbits,foo

Modified: llvm/trunk/test/MC/ELF/section-metadata-err4.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section-metadata-err4.s?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/section-metadata-err4.s (original)
+++ llvm/trunk/test/MC/ELF/section-metadata-err4.s Tue Apr  4 17:35:08 2017
@@ -2,4 +2,4 @@
 
 // CHECK: error: expected metadata symbol
 
-        .section .shf_metadata,"am", at progbits
+        .section .shf_metadata,"ao", at progbits

Modified: llvm/trunk/test/MC/ELF/section.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section.s?rev=299479&r1=299478&r2=299479&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/section.s (original)
+++ llvm/trunk/test/MC/ELF/section.s Tue Apr  4 17:35:08 2017
@@ -163,12 +163,12 @@ bar:
 .Lshf_metadata_target2_2:
         .quad 0
 
-.section .shf_metadata1,"am", at progbits,.Lshf_metadata_target2_1
-.section .shf_metadata2,"am", at progbits,.Lshf_metadata_target2_2
-.section .shf_metadata3,"am", at progbits,.shf_metadata_target1
-// ASM: .section .shf_metadata1,"am", at progbits,.Lshf_metadata_target2_1
-// ASM: .section .shf_metadata2,"am", at progbits,.Lshf_metadata_target2_2
-// ASM: .section .shf_metadata3,"am", at progbits,.shf_metadata_target1
+.section .shf_metadata1,"ao", at progbits,.Lshf_metadata_target2_1
+.section .shf_metadata2,"ao", at progbits,.Lshf_metadata_target2_2
+.section .shf_metadata3,"ao", at progbits,.shf_metadata_target1
+// ASM: .section .shf_metadata1,"ao", at progbits,.Lshf_metadata_target2_1
+// ASM: .section .shf_metadata2,"ao", at progbits,.Lshf_metadata_target2_2
+// ASM: .section .shf_metadata3,"ao", at progbits,.shf_metadata_target1
 
 // CHECK:      Section {
 // CHECK:        Index: 22




More information about the llvm-commits mailing list