summaryrefslogtreecommitdiff
path: root/lld/MachO/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/MachO/Driver.cpp')
-rw-r--r--lld/MachO/Driver.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index e4c9f4dd6024..f0cddab94f55 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -1484,6 +1484,12 @@ bool macho::link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
inputFiles.insert(make<OpaqueFile>(*buffer, segName, sectName));
}
+ for (const Arg *arg : args.filtered(OPT_add_empty_section)) {
+ StringRef segName = arg->getValue(0);
+ StringRef sectName = arg->getValue(1);
+ inputFiles.insert(make<OpaqueFile>(MemoryBufferRef(), segName, sectName));
+ }
+
gatherInputSections();
if (config->callGraphProfileSort)
extractCallGraphProfile();