[llvm] [ORC] Resolve EHFrame registration symbols via lookupAndApply (PR #223304)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 21:52:07 PDT 2026


https://github.com/lhames created https://github.com/llvm/llvm-project/pull/223304

EHFrameRegistrationPlugin::Create resolved its register/deregister alloc-action addresses with EPC.getBootstrapSymbols. For consistency, switch to lookupAndApply/recordAddr on the bootstrap JITDylib instead.

>From dc8c6bc0b41e29ff79a2bebc6917be1709db1914 Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Mon, 14 Sep 2026 13:37:23 +1000
Subject: [PATCH] [ORC] Resolve EHFrame registration symbols via lookupAndApply

EHFrameRegistrationPlugin::Create resolved its register/deregister
alloc-action addresses with EPC.getBootstrapSymbols. For consistency,
switch to lookupAndApply/recordAddr on the bootstrap JITDylib instead.
---
 .../Orc/EHFrameRegistrationPlugin.cpp                | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/ExecutionEngine/Orc/EHFrameRegistrationPlugin.cpp b/llvm/lib/ExecutionEngine/Orc/EHFrameRegistrationPlugin.cpp
index b34c3434b256c..e4d05694e1683 100644
--- a/llvm/lib/ExecutionEngine/Orc/EHFrameRegistrationPlugin.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/EHFrameRegistrationPlugin.cpp
@@ -9,6 +9,7 @@
 #include "llvm/ExecutionEngine/Orc/EHFrameRegistrationPlugin.h"
 
 #include "llvm/ExecutionEngine/JITLink/EHFrameSupport.h"
+#include "llvm/ExecutionEngine/Orc/LookupAndApply.h"
 #include "llvm/ExecutionEngine/Orc/Shared/MachOObjectFormat.h"
 #include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
 
@@ -24,11 +25,12 @@ EHFrameRegistrationPlugin::Create(ExecutionSession &ES) {
   // bootstrap map.
   ExecutorAddr RegisterEHFrameSectionAllocAction;
   ExecutorAddr DeregisterEHFrameSectionAllocAction;
-  if (auto Err = ES.getExecutorProcessControl().getBootstrapSymbols(
-          {{RegisterEHFrameSectionAllocAction,
-            rt::RegisterEHFrameSectionAllocActionName},
-           {DeregisterEHFrameSectionAllocAction,
-            rt::DeregisterEHFrameSectionAllocActionName}}))
+  if (auto Err = lookupAndApply(
+          ES.getBootstrapJITDylib(),
+          {recordAddr(rt::RegisterEHFrameSectionAllocActionName,
+                      &RegisterEHFrameSectionAllocAction),
+           recordAddr(rt::DeregisterEHFrameSectionAllocActionName,
+                      &DeregisterEHFrameSectionAllocAction)}))
     return std::move(Err);
 
   return std::make_unique<EHFrameRegistrationPlugin>(



More information about the llvm-commits mailing list