summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-09-04 11:02:58 +0000
committerFangrui Song <maskray@google.com>2019-09-04 11:02:58 +0000
commit520bdf79b55dda09c2d30c49fb7e21c706d842ed (patch)
tree559a852f1ec25e7bb40fd68dc7af5d406ffdadc7
parent2c9f83cfab797330fab4227b77773827b70c91fc (diff)
downloadbcm5719-llvm-520bdf79b55dda09c2d30c49fb7e21c706d842ed.tar.gz
bcm5719-llvm-520bdf79b55dda09c2d30c49fb7e21c706d842ed.zip
[ELF] Fix spell corrector: don't call elf::InputFile::getSymbols() on shared objects
Exposed by pr34872.s llvm-svn: 370875
-rw-r--r--lld/ELF/Relocations.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 32fe2f1275b..42f0a873909 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -697,7 +697,7 @@ static std::vector<UndefinedDiag> undefs;
static const Symbol *getAlternativeSpelling(const Undefined &sym) {
// Build a map of local defined symbols.
DenseMap<StringRef, const Symbol *> map;
- if (sym.file) {
+ if (sym.file && !isa<SharedFile>(sym.file)) {
for (const Symbol *s : sym.file->getSymbols())
if (s->isLocal() && s->isDefined())
map.try_emplace(s->getName(), s);
OpenPOWER on IntegriCloud