[llvm] [BOLT] Retain certain local symbols (PR #184074)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 20:02:44 PST 2026


================
@@ -5352,20 +5352,40 @@ void RewriteInstance::updateELFSymbolTable(
     } else {
       // Check if the function symbol matches address inside a function, i.e.
       // it marks a secondary entry point.
+      // Also look up local NOTYPE symbols inside functions so we can
+      // update their addresses to reflect the output layout.
+      // Skip AArch64 marker symbols ($d, $x) inside functions —
+      // BOLT generates its own via addExtraSymbols.
+      auto IsAArch64MarkerSymbol = [&]() {
+        return BC->isAArch64() &&
+               (SymbolName->starts_with("$d") || SymbolName->starts_with("$x"));
+      };
----------------
lenary wrote:

RISC-V and (iirc) Arm also have mapping symbols, which are similar. I don't know if BOLT is capable of regenerating them for these other targets.



https://github.com/llvm/llvm-project/pull/184074


More information about the llvm-commits mailing list