[Git][ghc/ghc][wip/unloading] 4 commits: Fix and enable object unloading in GHCi

Ben Gamari gitlab at gitlab.haskell.org
Fri Oct 30 16:56:50 UTC 2020



Ben Gamari pushed to branch wip/unloading at Glasgow Haskell Compiler / GHC


Commits:
2883a0d9 by Ömer Sinan Ağacan at 2020-10-30T12:56:34-04:00
Fix and enable object unloading in GHCi

Fixes #16525

See Note [Object unloading] in CheckUnload.c for details.

- - - - -
fb2471ba by Ray Shih at 2020-10-30T12:56:35-04:00
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.

- - - - -
e6baa78c by GHC GitLab CI at 2020-10-30T12:56:35-04:00
rts: Introduce highMemDynamic

- - - - -
e3cff938 by GHC GitLab CI at 2020-10-30T12:56:35-04:00
Introduce test for dynamic library unloading

This uses the highMemDynamic flag introduced earlier to verify that
dynamic objects are properly unloaded.

- - - - -


30 changed files:

- compiler/GHC/Runtime/Linker.hs
- includes/rts/Linker.h
- includes/rts/storage/GC.h
- rts/CheckUnload.c
- rts/CheckUnload.h
- rts/Hash.c
- rts/Hash.h
- rts/Linker.c
- rts/LinkerInternals.h
- rts/RtsStartup.c
- rts/linker/Elf.c
- rts/linker/LoadArchive.c
- rts/linker/MachO.c
- rts/linker/PEi386.c
- rts/linker/elf_got.c
- rts/sm/Evac.c
- rts/sm/GC.c
- rts/sm/GC.h
- rts/sm/Storage.c
- testsuite/tests/ghci/T16525a/T16525a.script
- testsuite/tests/ghci/T16525a/T16525a.stdout
- testsuite/tests/ghci/T16525a/all.T
- + testsuite/tests/ghci/T16525b/A.hs
- + testsuite/tests/ghci/T16525b/B.hs
- + testsuite/tests/ghci/T16525b/T16525b.script
- + testsuite/tests/ghci/T16525b/T16525b.stdout
- + testsuite/tests/ghci/T16525b/all.T
- testsuite/tests/rts/linker/Makefile
- testsuite/tests/rts/linker/all.T
- testsuite/tests/rts/linker/linker_error.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e63e58f6d29bc50bb602fa2797484b4fb9791e4b...e3cff938c3f97f7072a6e1c6d79c0ad644694878

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e63e58f6d29bc50bb602fa2797484b4fb9791e4b...e3cff938c3f97f7072a6e1c6d79c0ad644694878
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201030/65646132/attachment-0001.html>


More information about the ghc-commits mailing list