forked from OSchip/llvm-project
[BOLT] Force non-relocation mode for heatmap generation
Summary: BOLT operates in relocation mode by default when .reloc is in the binary. This changes disables relocation mode for heatmap generation so we can use that for more cases. There's a small separate change that ignores zero-sized symbol in zero-sized code section during function discovery. (cherry picked from FBD16009610)
This commit is contained in:
parent
0d23cbaa52
commit
459add2827
|
@ -1486,6 +1486,11 @@ void RewriteInstance::discoverFileObjects() {
|
|||
BF->addAlternativeName(UniqueName);
|
||||
} else {
|
||||
auto Section = BC->getSectionForAddress(Address);
|
||||
|
||||
// Skip zero-size symbol in zero-size section
|
||||
if (!Section && !SymbolSize)
|
||||
continue;
|
||||
|
||||
assert(Section && "section for functions must be registered.");
|
||||
BF = BC->createBinaryFunction(UniqueName, *Section, Address,
|
||||
SymbolSize, IsSimple);
|
||||
|
@ -1868,6 +1873,12 @@ void RewriteInstance::readSpecialSections() {
|
|||
|
||||
BC->HasRelocations = HasTextRelocations &&
|
||||
(opts::RelocationMode != cl::BOU_FALSE);
|
||||
|
||||
// Force non-relocation mode for heatmap generation
|
||||
if (opts::HeatmapMode) {
|
||||
BC->HasRelocations = false;
|
||||
}
|
||||
|
||||
if (BC->HasRelocations) {
|
||||
outs() << "BOLT-INFO: enabling relocation mode\n";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue