mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
[BOLT] LongJmp: Check for shouldEmit
Check that the function will be emitted in the final binary. Preserving old function address is needed in case it is PLT trampiline, that is currently not moved by the BOLT. Differential Revision: https://reviews.llvm.org/D122098
This commit is contained in:
@@ -1534,6 +1534,9 @@ void BinaryContext::preprocessDebugInfo() {
|
||||
}
|
||||
|
||||
bool BinaryContext::shouldEmit(const BinaryFunction &Function) const {
|
||||
if (Function.isPseudo())
|
||||
return false;
|
||||
|
||||
if (opts::processAllFunctions())
|
||||
return true;
|
||||
|
||||
|
||||
@@ -345,6 +345,11 @@ uint64_t LongJmpPass::tentativeLayoutRelocMode(
|
||||
CurrentIndex = 0;
|
||||
bool ColdLayoutDone = false;
|
||||
for (BinaryFunction *Func : SortedFunctions) {
|
||||
if (!BC.shouldEmit(*Func)) {
|
||||
HotAddresses[Func] = Func->getAddress();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ColdLayoutDone && CurrentIndex >= LastHotIndex) {
|
||||
DotAddress =
|
||||
tentativeLayoutRelocColdPart(BC, SortedFunctions, DotAddress);
|
||||
|
||||
Reference in New Issue
Block a user