Fix producing undefined reference to __progname.

We were not producing them if the library had version info.

llvm-svn: 268060
This commit is contained in:
Rafael Espindola
2016-04-29 16:23:31 +00:00
parent d5b0e54b49
commit 18da0e589a
3 changed files with 10 additions and 5 deletions

View File

@@ -490,6 +490,12 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end());
SymbolBodies.reserve(NumSymbols);
for (const Elf_Sym &Sym : Syms) {
StringRef Name = check(Sym.getName(this->StringTable));
if (Sym.isUndefined()) {
Undefs.push_back(Name);
continue;
}
unsigned VersymIndex = 0;
if (Versym) {
VersymIndex = Versym->vs_index;
@@ -498,11 +504,7 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
if (VersymIndex == 0 || (VersymIndex & VERSYM_HIDDEN))
continue;
}
StringRef Name = check(Sym.getName(this->StringTable));
if (Sym.isUndefined())
Undefs.push_back(Name);
else
SymbolBodies.emplace_back(this, Name, Sym, Verdefs[VersymIndex]);
SymbolBodies.emplace_back(this, Name, Sym, Verdefs[VersymIndex]);
}
}