forked from OSchip/llvm-project
[BOLT] Do no map sections with zero address
Summary: Sections that do not originate from the input binary will have an input address set to zero and thus do not have to be mapped. Mapping such sections caused a build time regression in non-relocation mode. (cherry picked from FBD23670334)
This commit is contained in:
parent
8c4ba8f165
commit
62469b5036
|
@ -1632,7 +1632,7 @@ BinarySection &BinaryContext::registerSection(BinarySection *Section) {
|
|||
assert(Res.second && "can't register the same section twice.");
|
||||
|
||||
// Only register allocatable sections in the AddressToSection map.
|
||||
if (Section->isAllocatable())
|
||||
if (Section->isAllocatable() && Section->getAddress())
|
||||
AddressToSection.insert(std::make_pair(Section->getAddress(), Section));
|
||||
NameToSection.insert(std::make_pair(Section->getName(), Section));
|
||||
DEBUG(dbgs() << "BOLT-DEBUG: registering " << *Section << "\n");
|
||||
|
|
Loading…
Reference in New Issue