diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h index 8a90febcea3cc..4872ccc0f5d7b 100644 --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -1113,7 +1113,7 @@ class BinaryContext { return FragmentClasses.isEquivalent(LHS, RHS); } - /// Add interprocedural reference for \p Function to \p Address + /// Add interprocedural branch reference from \p Function to \p Address. void addInterproceduralReference(BinaryFunction *Function, uint64_t Address) { InterproceduralReferences.push_back({Function, Address}); } @@ -1128,7 +1128,8 @@ class BinaryContext { /// argument is false. bool handleAArch64Veneer(uint64_t Address, bool MatchOnly = false); - /// Resolve inter-procedural dependencies from + /// Resolve inter-procedural branch dependencies discovered during + /// disassembly. void processInterproceduralReferences(); /// Skip functions with all parent and child fragments transitively. diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp index 6a285f5538dbd..992663b86bdfe 100644 --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -1438,8 +1438,6 @@ void BinaryContext::processInterproceduralReferences() { continue; } - // Check if address falls in function padding space - this could be - // unmarked data in code. In this case adjust the padding space size. ErrorOr Section = getSectionForAddress(Address); assert(Section && "cannot get section for referenced address"); @@ -1451,7 +1449,7 @@ void BinaryContext::processInterproceduralReferences() { if (SectionName == ".plt" || SectionName == ".plt.got") continue; - // Check if it is aarch64 veneer written at Address + // Check if it is aarch64 veneer written at Address. if (isAArch64() && handleAArch64Veneer(Address)) continue; @@ -1463,6 +1461,8 @@ void BinaryContext::processInterproceduralReferences() { exit(1); } + // Check if the address falls into the function padding space - this could + // be an unmarked data in code. In this case, adjust the padding space size. TargetFunction = getBinaryFunctionContainingAddress(Address, /*CheckPastEnd=*/false, /*UseMaxSize=*/true);