summaryrefslogtreecommitdiffstats
path: root/lld/include
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-10-24 08:20:51 +0000
committerLang Hames <lhames@gmail.com>2015-10-24 08:20:51 +0000
commitb1b67f4daf3e981800ae978068efc94b78087a40 (patch)
treed3da58a4224410a172d3cd1488b1c89cebefc606 /lld/include
parent25ca34c727640ad2fc0ff79733f942b3e7f9808f (diff)
downloadbcm5719-llvm-b1b67f4daf3e981800ae978068efc94b78087a40.tar.gz
bcm5719-llvm-b1b67f4daf3e981800ae978068efc94b78087a40.zip
[lld][Darwin] Add support for the -sectcreate option.
llvm-svn: 251183
Diffstat (limited to 'lld/include')
-rw-r--r--lld/include/lld/Core/DefinedAtom.h1
-rw-r--r--lld/include/lld/ReaderWriter/MachOLinkingContext.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/lld/include/lld/Core/DefinedAtom.h b/lld/include/lld/Core/DefinedAtom.h
index 6c6d1f9ef9b..e4d4488ccdc 100644
--- a/lld/include/lld/Core/DefinedAtom.h
+++ b/lld/include/lld/Core/DefinedAtom.h
@@ -151,6 +151,7 @@ public:
typeNoAlloc, // Identifies non allocatable sections [ELF]
typeGroupComdat, // Identifies a section group [ELF, COFF]
typeGnuLinkOnce, // Identifies a gnu.linkonce section [ELF]
+ typeSectCreate, // Created via the -sectcreate option [Darwin]
};
// Permission bits for atoms and segments. The order of these values are
diff --git a/lld/include/lld/ReaderWriter/MachOLinkingContext.h b/lld/include/lld/ReaderWriter/MachOLinkingContext.h
index a3459693c7d..dc44d3f303f 100644
--- a/lld/include/lld/ReaderWriter/MachOLinkingContext.h
+++ b/lld/include/lld/ReaderWriter/MachOLinkingContext.h
@@ -27,6 +27,7 @@ namespace mach_o {
class ArchHandler;
class MachODylibFile;
class MachOFile;
+class SectCreateFile;
}
class MachOLinkingContext : public LinkingContext {
@@ -272,6 +273,10 @@ public:
/// Add section alignment constraint on final layout.
void addSectionAlignment(StringRef seg, StringRef sect, uint16_t align);
+ /// \brief Add a section based on a command-line sectcreate option.
+ void addSectCreateSection(StringRef seg, StringRef sect,
+ std::unique_ptr<MemoryBuffer> content);
+
/// Returns true if specified section had alignment constraints.
bool sectionAligned(StringRef seg, StringRef sect, uint16_t &align) const;
@@ -416,6 +421,7 @@ private:
llvm::StringMap<std::vector<OrderFileNode>> _orderFiles;
unsigned _orderFileEntries;
File *_flatNamespaceFile;
+ mach_o::SectCreateFile *_sectCreateFile = nullptr;
};
} // end namespace lld
OpenPOWER on IntegriCloud