[PATCH] D111413: [Orc] Support atexit in Orc(JITLink)

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 08:18:20 PDT 2021


StephenFan created this revision.
StephenFan added a reviewer: lhames.
Herald added a subscriber: hiraditya.
StephenFan requested review of this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

There is a bug reported at https://bugs.llvm.org/show_bug.cgi?id=48938

After looking through the glibc, I found the `atexit(f)` is the same as `__cxa_atexit(f, NULL, NULL)`. In orc runtime, we identify different JITDylib by their dso_handle value, so that a NULL dso_handle is invalid. So in this patch, I added a `PlatformJDDSOHandle` to ELFNixRuntimeState, and functions which are registered by atexit will be registered at PlatformJD.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111413

Files:
  compiler-rt/lib/orc/elfnix_platform.cpp
  compiler-rt/test/orc/TestCases/Linux/x86-64/trivial-atexit.S
  llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111413.378225.patch
Type: text/x-patch
Size: 5087 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211008/9f47c96d/attachment.bin>


More information about the llvm-commits mailing list