summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SymbolTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SymbolTable.cpp')
-rw-r--r--lld/ELF/SymbolTable.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index a0ebb0257c5..f01bc94c703 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -186,6 +186,16 @@ static uint16_t getVersionId(Symbol *Sym, StringRef Name) {
return Default ? I : (I | VERSYM_HIDDEN);
++I;
}
+
+ // If we are not building shared and version script
+ // is not specified, then it is not a error, it is
+ // in common not to use script for linking executables.
+ // In this case we just create new version.
+ if (!Config->Shared && !Config->HasVersionScript) {
+ Config->SymbolVersions.push_back(elf::Version(Version));
+ return Default ? I : (I | VERSYM_HIDDEN);
+ }
+
error("symbol " + Name + " has undefined version " + Version);
return 0;
}
OpenPOWER on IntegriCloud