summaryrefslogtreecommitdiff
path: root/compiler/GHC/Runtime/Linker.hs
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2020-02-16 18:48:25 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-25 22:41:39 -0400
commit262e42aa34c4d5705c8d011907c351497dd4e862 (patch)
tree271e2c1c4beb563dc996049967066d7d7bfda9ae /compiler/GHC/Runtime/Linker.hs
parent3e27205a66b06a4501d87eb31e285eadbc693eb7 (diff)
downloadhaskell-262e42aa34c4d5705c8d011907c351497dd4e862.tar.gz
Do not panic on linker errors
Diffstat (limited to 'compiler/GHC/Runtime/Linker.hs')
-rw-r--r--compiler/GHC/Runtime/Linker.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Runtime/Linker.hs b/compiler/GHC/Runtime/Linker.hs
index 331b460c06..c8b4b63a78 100644
--- a/compiler/GHC/Runtime/Linker.hs
+++ b/compiler/GHC/Runtime/Linker.hs
@@ -187,7 +187,7 @@ getHValue hsc_env name = do
m <- lookupClosure hsc_env (unpackFS sym_to_find)
case m of
Just hvref -> mkFinalizedHValue hsc_env hvref
- Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE"
+ Nothing -> linkFail "GHC.Runtime.Linker.getHValue"
(unpackFS sym_to_find)
linkDependencies :: HscEnv -> PersistentLinkerState
@@ -472,7 +472,7 @@ preloadLib hsc_env lib_paths framework_paths pls lib_spec = do
Nothing -> maybePutStrLn dflags "done"
Just mm -> preloadFailed mm framework_paths lib_spec
return pls
- else panic "preloadLib Framework"
+ else throwGhcExceptionIO (ProgramError "preloadLib Framework")
where
dflags = hsc_dflags hsc_env
@@ -964,7 +964,9 @@ dynLoadObjs hsc_env pls@PersistentLinkerState{..} objs = do
m <- loadDLL hsc_env soFile
case m of
Nothing -> return $! pls { temp_sos = (libPath, libName) : temp_sos }
- Just err -> panic ("Loading temp shared object failed: " ++ err)
+ Just err -> linkFail msg err
+ where
+ msg = "GHC.Runtime.Linker.dynLoadObjs: Loading temp shared object failed"
rmDupLinkables :: [Linkable] -- Already loaded
-> [Linkable] -- New linkables