Skip to content

Conversation

yozhu
Copy link
Contributor

@yozhu yozhu commented Sep 16, 2025

We want to annotate function with data and code markers whose addresses fall within the range of the function, so setting CheckPastEnd to false.

…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.
@llvmbot
Copy link
Member

llvmbot commented Sep 16, 2025

@llvm/pr-subscribers-bolt

Author: YongKang Zhu (yozhu)

Changes

We want to annotate function with data and code markers whose addresses fall within the range of the function, so setting CheckPastEnd to false.


Full diff: https://github.com/llvm/llvm-project/pull/159210.diff

1 Files Affected:

  • (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+3-1)
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

Copy link
Contributor

@maksfb maksfb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yozhu
Copy link
Contributor Author

yozhu commented Sep 25, 2025

Thanks for the review, Maksim!

@yozhu yozhu merged commit 5923004 into llvm:main Sep 25, 2025
11 checks passed
@yozhu yozhu deleted the bolt_check_past_end branch September 25, 2025 22:49
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
…annotation (llvm#159210)

We want to annotate function with data and code markers
whose addresses fall within the range of the function, so
setting `CheckPastEnd` to false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants