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
}
bool BinaryContext::shouldEmit(const BinaryFunction &Function) const {
+ if (Function.isPseudo())
+ return false;
+
if (opts::processAllFunctions())
return true;
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);