diff options
author | Nick Kledzik <kledzik@apple.com> | 2014-05-15 23:03:50 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2014-05-15 23:03:50 +0000 |
commit | e09cfc5f8a961269a98164281f1270c4ccc31e38 (patch) | |
tree | 713f1fc5ee92a2c55c5c22259d16b5942bd0ccb9 /lld/lib/ReaderWriter/MachO/File.h | |
parent | 966abe7614cd04330afb26f3851347759f73d2c1 (diff) | |
download | bcm5719-llvm-e09cfc5f8a961269a98164281f1270c4ccc31e38.tar.gz bcm5719-llvm-e09cfc5f8a961269a98164281f1270c4ccc31e38.zip |
[mach-o] Add support for zero-fill sections.
llvm-svn: 208928
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index 767d5230cf6..755dedf0a3e 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -21,15 +21,27 @@ class MachOFile : public SimpleFile { public: MachOFile(StringRef path) : SimpleFile(path) {} - void addDefinedAtom(StringRef name, ArrayRef<uint8_t> content, - Atom::Scope scope, bool copyRefs) { + void addDefinedAtom(StringRef name, Atom::Scope scope, + DefinedAtom::ContentType type, + ArrayRef<uint8_t> content, bool copyRefs) { if (copyRefs) { // Make a copy of the atom's name and content that is owned by this file. name = name.copy(_allocator); content = content.copy(_allocator); } MachODefinedAtom *atom = - new (_allocator) MachODefinedAtom(*this, name, content, scope); + new (_allocator) MachODefinedAtom(*this, name, scope, type, content); + addAtom(*atom); + } + + void addZeroFillDefinedAtom(StringRef name, Atom::Scope scope, uint64_t size, + bool copyRefs) { + if (copyRefs) { + // Make a copy of the atom's name and content that is owned by this file. + name = name.copy(_allocator); + } + MachODefinedAtom *atom = + new (_allocator) MachODefinedAtom(*this, name, scope, size); addAtom(*atom); } |