summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/File.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
-rw-r--r--lld/lib/ReaderWriter/MachO/File.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h
index b52f47036b3..c466231e400 100644
--- a/lld/lib/ReaderWriter/MachO/File.h
+++ b/lld/lib/ReaderWriter/MachO/File.h
@@ -35,6 +35,22 @@ public:
addAtom(*atom);
}
+ void addDefinedAtomInCustomSection(StringRef name, Atom::Scope scope,
+ DefinedAtom::ContentType type, DefinedAtom::Merge merge,
+ ArrayRef<uint8_t> content, StringRef sectionName,
+ 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);
+ sectionName = sectionName.copy(_allocator);
+ }
+ MachODefinedCustomSectionAtom *atom =
+ new (_allocator) MachODefinedCustomSectionAtom(*this, name, scope, type,
+ merge, content, sectionName);
+ addAtom(*atom);
+ }
+
void addZeroFillDefinedAtom(StringRef name, Atom::Scope scope, uint64_t size,
bool copyRefs) {
if (copyRefs) {
OpenPOWER on IntegriCloud