[PATCH] D85079: [lld-macho] Ensure .tbss sections are also considered as ZeroFilled
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 11:05:18 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4e43f1804817: [lld-macho] Ensure .tbss sections are also considered as ZeroFilled (authored by int3).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85079/new/
https://reviews.llvm.org/D85079
Files:
lld/MachO/InputSection.h
lld/test/MachO/bss.s
Index: lld/test/MachO/bss.s
===================================================================
--- lld/test/MachO/bss.s
+++ lld/test/MachO/bss.s
@@ -26,7 +26,7 @@
# CHECK-NEXT: Name: __bss
# CHECK-NEXT: Segment: __DATA
# CHECK-NEXT: Address:
-# CHECK-NEXT: Size: 0x4
+# CHECK-NEXT: Size: 0x8
# CHECK-NEXT: Offset: 0
# CHECK-NEXT: Alignment: 0
# CHECK-NEXT: RelocationOffset: 0x0
@@ -38,10 +38,26 @@
# CHECK-NEXT: Reserved2: 0x0
# CHECK-NEXT: Reserved3: 0x0
+# CHECK: Index: 3
+# CHECK-NEXT: Name: __thread_bss
+# CHECK-NEXT: Segment: __DATA
+# CHECK-NEXT: Address: 0x100001010
+# CHECK-NEXT: Size: 0x4
+# CHECK-NEXT: Offset: 0
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: RelocationOffset: 0x0
+# CHECK-NEXT: RelocationCount: 0
+# CHECK-NEXT: Type: ThreadLocalZerofill (0x12)
+# CHECK-NEXT: Attributes [ (0x0)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Reserved1: 0x0
+# CHECK-NEXT: Reserved2: 0x0
+# CHECK-NEXT: Reserved3: 0x0
+
# CHECK: Name: __DATA
# CHECK-NEXT: Size:
# CHECK-NEXT: vmaddr:
-# CHECK-NEXT: vmsize: 0xC
+# CHECK-NEXT: vmsize: 0x14
# CHECK-NEXT: fileoff:
# CHECK-NEXT: filesize: 8
@@ -55,5 +71,8 @@
.bss
.zero 4
+.tbss _foo, 4
+.zero 4
+
.data
.quad 0x1234
Index: lld/MachO/InputSection.h
===================================================================
--- lld/MachO/InputSection.h
+++ lld/MachO/InputSection.h
@@ -36,7 +36,8 @@
};
inline bool isZeroFill(uint8_t flags) {
- return (flags & llvm::MachO::SECTION_TYPE) == llvm::MachO::S_ZEROFILL;
+ return llvm::MachO::isVirtualSection(flags & llvm::MachO::SECTION_TYPE);
+}
}
class InputSection {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85079.283954.patch
Type: text/x-patch
Size: 1648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200807/604200ad/attachment.bin>
More information about the llvm-commits
mailing list