summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/GnuLdDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/Driver/GnuLdDriver.cpp')
-rw-r--r--lld/lib/Driver/GnuLdDriver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp
index 48ec24a9a90..c20e1081c7a 100644
--- a/lld/lib/Driver/GnuLdDriver.cpp
+++ b/lld/lib/Driver/GnuLdDriver.cpp
@@ -308,6 +308,11 @@ std::error_code GnuLdDriver::evalLinkerScript(ELFLinkingContext &ctx,
ctx.setEntrySymbolName(entry->getEntryName());
if (auto *output = dyn_cast<script::Output>(c))
ctx.setOutputPath(output->getOutputFileName());
+ if (auto *externs = dyn_cast<script::Extern>(c)) {
+ for (auto symbol : *externs) {
+ ctx.addInitialUndefinedSymbol(symbol);
+ }
+ }
}
// Transfer ownership of the script to the linking context
ctx.addLinkerScript(std::move(parser));
OpenPOWER on IntegriCloud