rts: Make addDLL a wrapper around loadNativeObj
Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too.
Showing
- libraries/ghci/GHCi/ObjLink.hs 4 additions, 6 deletionslibraries/ghci/GHCi/ObjLink.hs
- rts/Linker.c 85 additions, 204 deletionsrts/Linker.c
- rts/LinkerInternals.h 1 addition, 5 deletionsrts/LinkerInternals.h
- rts/RtsSymbols.c 2 additions, 1 deletionrts/RtsSymbols.c
- rts/include/rts/Linker.h 3 additions, 3 deletionsrts/include/rts/Linker.h
- rts/linker/Elf.c 80 additions, 153 deletionsrts/linker/Elf.c
- rts/linker/Elf.h 1 addition, 2 deletionsrts/linker/Elf.h
- rts/linker/LoadNativeObjPosix.c 214 additions, 0 deletionsrts/linker/LoadNativeObjPosix.c
- rts/linker/LoadNativeObjPosix.h 11 additions, 0 deletionsrts/linker/LoadNativeObjPosix.h
- rts/linker/PEi386.c 49 additions, 35 deletionsrts/linker/PEi386.c
- rts/linker/PEi386.h 1 addition, 0 deletionsrts/linker/PEi386.h
- rts/rts.cabal 1 addition, 0 deletionsrts/rts.cabal
- testsuite/tests/ghci/linking/dyn/T3372.hs 3 additions, 0 deletionstestsuite/tests/ghci/linking/dyn/T3372.hs
Loading
Please register or sign in to comment