Add loadNativeObj and unloadNativeObj
(This change is originally written by niteria) This adds two functions: * `loadNativeObj` * `unloadNativeObj` and implements them for Linux. They are useful if you want to load a shared object with Haskell code using the system linker and have GHC call dlclose() after the code is no longer referenced from the heap. Using the system linker allows you to load the shared object above outside the low-mem region. It also loads the DWARF sections in a way that `perf` understands. `dl_iterate_phdr` is what makes this implementation Linux specific.
Showing
- includes/rts/Linker.h 13 additions, 0 deletionsincludes/rts/Linker.h
- rts/CheckUnload.c 35 additions, 10 deletionsrts/CheckUnload.c
- rts/Linker.c 194 additions, 2 deletionsrts/Linker.c
- rts/LinkerInternals.h 31 additions, 2 deletionsrts/LinkerInternals.h
- rts/linker/LoadArchive.c 1 addition, 1 deletionrts/linker/LoadArchive.c
Loading
Please register or sign in to comment