mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-01 01:31:26 +00: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:
parent
fed958c6cc
commit
4c14519ecb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user