Add comments.
llvm-svn: 285235
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 0369804..1d15b60 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -550,12 +550,14 @@
if (SrcFile.empty())
SrcFile = Sym.File ? getFilename(Sym.File) : getFilename(File);
- DefinedRegular<ELFT> *Encl = getSymbolAt(&S, Offset);
- if (Encl && Encl->Type == STT_FUNC) {
- StringRef Func = getSymbolName(*File, *Encl);
+ // Find a symbol at a given location.
+ DefinedRegular<ELFT> *Sym = getSymbolAt(&S, Offset);
+ if (Sym && Sym->Type == STT_FUNC) {
+ StringRef Func = getSymbolName(*File, *Sym);
return SrcFile + " (function " + maybeDemangle(Func) + ")";
}
+ // If there's no symbol, print out the offset instead of a symbol name.
return (SrcFile + " (" + S.Name + "+0x" + Twine::utohexstr(Offset) + ")")
.str();
}