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

Ben Gamari gitlab at gitlab.haskell.org
Sat Oct 31 16:24:11 UTC 2020



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


Commits:
a7d73051 by Ömer Sinan Ağacan at 2020-10-31T12:22:44-04:00
Fix and enable object unloading in GHCi

Fixes #16525 by tracking dependencies between object file symbols and
marking symbol liveness during garbage collection

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

- - - - -
3f1db003 by Ray Shih at 2020-10-31T12:23:34-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.

- - - - -
933e7428 by GHC GitLab CI at 2020-10-31T12:23:34-04:00
rts: Introduce highMemDynamic

- - - - -
d99dc5bc by GHC GitLab CI at 2020-10-31T12:23:34-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/708ea4cf8be9803fb100f20d44531f9be5f7a13f...d99dc5bc1715e581fb552f4248b61f5793cd5bda

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/708ea4cf8be9803fb100f20d44531f9be5f7a13f...d99dc5bc1715e581fb552f4248b61f5793cd5bda
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/20201031/b9b6144c/attachment.html>


More information about the ghc-commits mailing list