Commits on Source (3)
-
Rodrigo Mesquita authored
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.
Unverifiedc5858977 -
Rodrigo Mesquita authoredUnverified206adda7
-
Rodrigo Mesquita authored
This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too.
Unverified2befe7f0
Showing
- compiler/GHC.hs 5 additions, 3 deletionscompiler/GHC.hs
- compiler/GHC/Driver/Main.hs 1 addition, 1 deletioncompiler/GHC/Driver/Main.hs
- compiler/GHC/Runtime/Interpreter.hs 58 additions, 41 deletionscompiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Interpreter/JS.hs 0 additions, 3 deletionscompiler/GHC/Runtime/Interpreter/JS.hs
- compiler/GHC/Runtime/Interpreter/Types.hs 3 additions, 3 deletionscompiler/GHC/Runtime/Interpreter/Types.hs
- libraries/ghci/GHCi/ObjLink.hs 4 additions, 4 deletionslibraries/ghci/GHCi/ObjLink.hs
- rts/Linker.c 77 additions, 203 deletionsrts/Linker.c
- rts/LinkerInternals.h 1 addition, 5 deletionsrts/LinkerInternals.h
- rts/RtsSymbols.c 1 addition, 1 deletionrts/RtsSymbols.c
- rts/include/rts/Linker.h 3 additions, 3 deletionsrts/include/rts/Linker.h
- rts/linker/Elf.c 71 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 42 additions, 34 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
rts/linker/LoadNativeObjPosix.c
0 → 100644
rts/linker/LoadNativeObjPosix.h
0 → 100644