summaryrefslogtreecommitdiffstats
path: root/lld/ELF
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF')
-rw-r--r--lld/ELF/Config.h1
-rw-r--r--lld/ELF/Driver.cpp1
-rw-r--r--lld/ELF/Writer.cpp2
3 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index ade684c1c17..120df312a80 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -89,6 +89,7 @@ struct Configuration {
bool VersionScript = false;
bool WarnCommon;
bool ZCombreloc;
+ bool ZDefs;
bool ZExecStack;
bool ZNodelete;
bool ZNow;
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index f23db3d5fcc..4b11472a688 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -353,6 +353,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
error("number of threads must be > 0");
Config->ZCombreloc = !hasZOption(Args, "nocombreloc");
+ Config->ZDefs = hasZOption(Args, "defs");
Config->ZExecStack = hasZOption(Args, "execstack");
Config->ZNodelete = hasZOption(Args, "nodelete");
Config->ZNow = hasZOption(Args, "now");
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 4c9be04e42a..e40a5ce8224 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -793,7 +793,7 @@ static void reportUndefined(SymbolTable<ELFT> &Symtab, SymbolBody *Sym) {
if (!Config->NoUndefined) {
if (Config->Relocatable)
return;
- if (Config->Shared)
+ if (Config->Shared && !Config->ZDefs)
if (Sym->symbol()->Visibility == STV_DEFAULT)
return;
}
OpenPOWER on IntegriCloud