[llvm] [BOLT][runtime] Add start & fini symbols (PR #68505)

Job Noorman via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 02:47:37 PDT 2023


================
@@ -4568,6 +4568,26 @@ void RewriteInstance::updateELFSymbolTable(
     }
   }
 
+  // Add runtime library start and fini address symbols
+  if (RuntimeLibrary *RtLibrary = BC->getRuntimeLibrary()) {
+    auto AddSymbol = [&](StringRef Name, uint64_t Address) {
+      if (!Address)
+        return;
+
+      ELFSymTy NewSymbol;
+      NewSymbol.st_shndx = ELF::SHN_ABS;
----------------
mtvec wrote:

Is there a reason you make this an `ABS` symbols instead of linking it to the correct section?

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


More information about the llvm-commits mailing list