From 20685e9a4eb08d3071dc91ebb778e794a4618fed Mon Sep 17 00:00:00 2001 From: YongKang Zhu Date: Tue, 16 Sep 2025 13:30:10 -0700 Subject: [PATCH] [BOLT] Don't check address past end of function during data and code marker annotation We want to annotate function with data and code markers whose addresses fall within the range of the function, so setting `CheckPastEnd` to false. --- bolt/lib/Rewrite/RewriteInstance.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index a6e4dbc9c192f..8b78c53aa99b3 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -1312,7 +1312,9 @@ void RewriteInstance::discoverFileObjects() { // Annotate functions with code/data markers in AArch64 for (auto &[Address, Type] : MarkerSymbols) { - auto *BF = BC->getBinaryFunctionContainingAddress(Address, true, true); + auto *BF = BC->getBinaryFunctionContainingAddress(Address, + /*CheckPastEnd*/ false, + /*UseMaxSize*/ true); if (!BF) { // Stray marker