[PATCH] D128654: [MC] Allow annotating custom sections as zerofill

Egor Zhdan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 07:10:19 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbe4b40d5bc6c: [MC] Allow annotating custom sections as zerofill (authored by egorzhdan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128654/new/

https://reviews.llvm.org/D128654

Files:
  llvm/lib/MC/MCSectionMachO.cpp
  llvm/test/CodeGen/AArch64/clang-section-macho.ll


Index: llvm/test/CodeGen/AArch64/clang-section-macho.ll
===================================================================
--- llvm/test/CodeGen/AArch64/clang-section-macho.ll
+++ llvm/test/CodeGen/AArch64/clang-section-macho.ll
@@ -9,3 +9,14 @@
 
 ; CHECK:      .section	__TEXT,__mytext
 ; CHECK-NEXT: .globl	_foo
+
+
+define dso_local void @bar() #1 {
+entry:
+  ret void
+}
+
+attributes #1 = { "implicit-section-name"="__EDATA,zerofill" }
+
+; CHECK:      .section	__EDATA,zerofill
+; CHECK-NEXT: .globl	_bar
Index: llvm/lib/MC/MCSectionMachO.cpp
===================================================================
--- llvm/lib/MC/MCSectionMachO.cpp
+++ llvm/lib/MC/MCSectionMachO.cpp
@@ -26,7 +26,7 @@
   StringLiteral AssemblerName, EnumName;
 } SectionTypeDescriptors[MachO::LAST_KNOWN_SECTION_TYPE + 1] = {
     {StringLiteral("regular"), StringLiteral("S_REGULAR")}, // 0x00
-    {StringLiteral(""), StringLiteral("S_ZEROFILL")},       // 0x01
+    {StringLiteral("zerofill"), StringLiteral("S_ZEROFILL")}, // 0x01
     {StringLiteral("cstring_literals"),
      StringLiteral("S_CSTRING_LITERALS")}, // 0x02
     {StringLiteral("4byte_literals"),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128654.440611.patch
Type: text/x-patch
Size: 1157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220628/aea4ad15/attachment.bin>


More information about the llvm-commits mailing list