summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Driver.cpp
diff options
context:
space:
mode:
authorDenis Protivensky <dprotivensky@accesssoftek.com>2015-10-05 09:43:57 +0000
committerDenis Protivensky <dprotivensky@accesssoftek.com>2015-10-05 09:43:57 +0000
commit22220d5d5f97c1e3192a42a81dfae76a593bc70b (patch)
tree790dd013e93b22d2113ed0f2f8877d97664a74ee /lld/ELF/Driver.cpp
parent6967527441a6daa56027822ab9419dfb882e9780 (diff)
downloadbcm5719-llvm-22220d5d5f97c1e3192a42a81dfae76a593bc70b.tar.gz
bcm5719-llvm-22220d5d5f97c1e3192a42a81dfae76a593bc70b.zip
[ELF2] Add --undefined option
Add symbol specified with -u as undefined which may cause additional object files from archives to be linked into the resulting binary. Differential Revision: http://reviews.llvm.org/D13345 llvm-svn: 249295
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r--lld/ELF/Driver.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 7375b74565a..078382c0c4b 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -157,6 +157,9 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
if (Symtab.getObjectFiles().empty())
error("no input files.");
+ for (auto *Arg : Args.filtered(OPT_undefined))
+ Symtab.addUndefinedSym(Arg->getValue());
+
// Write the result.
const ELFFileBase *FirstObj = Symtab.getFirstELF();
switch (FirstObj->getELFKind()) {
OpenPOWER on IntegriCloud