forked from OSchip/llvm-project
[ELF] Fix spell corrector: don't call elf::InputFile::getSymbols() on shared objects
Exposed by pr34872.s llvm-svn: 370875
This commit is contained in:
parent
2c9f83cfab
commit
520bdf79b5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue