diff options
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index e9f2eed23a4..c97dfa142b8 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -87,9 +87,22 @@ public: DefinedAtom::Alignment align( inSection->alignment, sectionOffset % inSection->alignment); + + DefinedAtom::ContentType type = DefinedAtom::typeUnknown; + switch (inSection->type) { + case llvm::MachO::S_ZEROFILL: + type = DefinedAtom::typeZeroFill; + break; + case llvm::MachO::S_THREAD_LOCAL_ZEROFILL: + type = DefinedAtom::typeTLVInitialZeroFill; + break; + default: + llvm_unreachable("Unrecognized zero-fill section"); + } + auto *atom = - new (allocator()) MachODefinedAtom(*this, name, scope, size, noDeadStrip, - align); + new (allocator()) MachODefinedAtom(*this, name, scope, type, size, + noDeadStrip, align); addAtomForSection(inSection, atom, sectionOffset); } |