diff --git a/bolt/src/BinaryContext.cpp b/bolt/src/BinaryContext.cpp index 80c0dca0a4f9..a56ff707427c 100644 --- a/bolt/src/BinaryContext.cpp +++ b/bolt/src/BinaryContext.cpp @@ -158,7 +158,7 @@ void BinaryContext::updateObjectNesting(BinaryDataMapType::iterator GAI) { auto Itr = std::next(GAI); while (Itr != BinaryDataMap.end() && BD->containsRange(Itr->second->getAddress(), - Itr->second->getSize())) { + Itr->second->getSize())) { Itr->second->Parent = BD; ++Itr; } @@ -391,7 +391,7 @@ void BinaryContext::postProcessSymbolTable() { !BD->getSize() && !BD->isAbsolute() && BD->getSection()) { - errs() << "BOLT-WARNING: zero sized top level symbol: " << *BD << "\n"; + errs() << "BOLT-WARNING: zero-sized top level symbol: " << *BD << "\n"; Valid = false; } } diff --git a/bolt/src/BinaryData.cpp b/bolt/src/BinaryData.cpp index e8d806ec9b0f..3374a8c31543 100644 --- a/bolt/src/BinaryData.cpp +++ b/bolt/src/BinaryData.cpp @@ -113,8 +113,10 @@ void BinaryData::printBrief(raw_ostream &OS) const { OS << ")"; } - if (opts::Verbosity > 1 && Parent) { - OS << " (" << Parent->getName() << "/" << Parent->getSize() << ")"; + if (Parent) { + OS << " (parent: "; + Parent->printBrief(OS); + OS << ")"; } OS << ", 0x" << Twine::utohexstr(getAddress()) diff --git a/bolt/src/BinarySection.h b/bolt/src/BinarySection.h index 1aafbd838a7b..ffd0b5dc1371 100644 --- a/bolt/src/BinarySection.h +++ b/bolt/src/BinarySection.h @@ -246,6 +246,9 @@ public: bool isTLS() const { return (ELFFlags & ELF::SHF_TLS); } + bool isTBSS() const { + return isBSS() && isTLS(); + } bool isNote() const { return ELFType == ELF::SHT_NOTE; } bool isStrTab() const { return ELFType == ELF::SHT_STRTAB; } bool isSymTab() const { return ELFType == ELF::SHT_SYMTAB; } @@ -257,7 +260,7 @@ public: ELFType == ELF::SHT_PROGBITS); } bool isAllocatable() const { - return (ELFFlags & ELF::SHF_ALLOC); + return (ELFFlags & ELF::SHF_ALLOC) && !isTBSS(); } bool isLocal() const { return IsLocal; } bool isReordered() const { return IsReordered; }