Add comments.

llvm-svn: 285235
This commit is contained in:
Rui Ueyama 2016-10-26 20:26:29 +00:00
parent be65b24a55
commit 5f7e6e6cfb
2 changed files with 6 additions and 4 deletions

View File

@ -550,12 +550,14 @@ static std::string getLocation(SymbolBody &Sym, InputSectionBase<ELFT> &S,
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();
}

View File

@ -323,7 +323,7 @@ template <class ELFT> void Writer<ELFT>::run() {
if (Config->ExitEarly) {
// Flush the output streams and exit immediately. A full shutdown is a good
// test that we are keeping track of all allocated memory, but actually
// freeing it is a wast of time in a regular linker run.
// freeing it is a waste of time in a regular linker run.
outs().flush();
errs().flush();
_exit(0);