[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)

Davide Italiano via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun May 19 19:46:14 PDT 2024


================
@@ -4788,13 +4788,22 @@ void RewriteInstance::updateELFSymbolTable(
     if (!IsDynSym && shouldStrip(Symbol))
       continue;
 
+    Expected<StringRef> SymbolName = Symbol.getName(StringSection);
+    assert(SymbolName && "cannot get symbol name");
+
     const BinaryFunction *Function =
         BC->getBinaryFunctionAtAddress(Symbol.st_value);
     // Ignore false function references, e.g. when the section address matches
     // the address of the function.
     if (Function && Symbol.getType() == ELF::STT_SECTION)
       Function = nullptr;
 
+    // Ignore input hot markers as function aliases – markers are handled
+    // separately.
+    if (Function &&
+        (*SymbolName == "__hot_start" || *SymbolName == "__hot_end"))
----------------
dcci wrote:

can you expand this comment -- explaining why we ignore input hot markers?

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


More information about the llvm-branch-commits mailing list