Skip to content

Commit f597ce0

Browse files
authored
[ORC][Runtime] Enhancing ELF Platform with Push-Request Model for Initializers (#102846)
With the help of @lhames, this PR introduces a push-request model to manage initializers in the runtime state for each `JITDylib`, similar to how `MachO` and `COFF` handle it. Previously, the ELF runtime lacked the ability to register, deregister, or retain initializers, causing issues when re-running `dlopen`. Initializers were erased after `rt_getInitializers` was used. To address this, we introduce `__orc_rt_elfnix_register_init_sections` and `__orc_rt_elfnix_register_jitdylib` (and corresponding deregister functions). This model allows the runtime to request the push of initializers for the `JITDylib`, with the platform handling this via a record method. Additionally, we leverage `MachO`'s `RecordSectionsTracker` to store initializers, ensuring only newly updated initializers are executed using `processNewSections`, improving the runtime's efficiency and reliability.
1 parent a94060c commit f597ce0

File tree

6 files changed

+945
-601
lines changed

6 files changed

+945
-601
lines changed

0 commit comments

Comments
 (0)