summaryrefslogtreecommitdiff
path: root/compiler/main/SysTools.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/SysTools.hs')
-rw-r--r--compiler/main/SysTools.hs29
1 files changed, 1 insertions, 28 deletions
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 5e9646d510..879b035d03 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -25,7 +25,6 @@ module SysTools (
runLlvmLlc,
runClang,
figureLlvmVersion,
- readElfSection,
getLinkerInfo,
getCompilerInfo,
@@ -78,8 +77,6 @@ import System.Directory
import Data.Char
import Data.List
import qualified Data.Map as Map
-import Text.ParserCombinators.ReadP hiding (char)
-import qualified Text.ParserCombinators.ReadP as R
#ifndef mingw32_HOST_OS
import qualified System.Posix.Internals
@@ -1043,31 +1040,7 @@ copyWithHeader dflags purpose maybe_header from to = do
hPutStr h str
hSetBinaryMode h True
--- | read the contents of the named section in an ELF object as a
--- String.
-readElfSection :: DynFlags -> String -> FilePath -> IO (Maybe String)
-readElfSection _dflags section exe = do
- let
- prog = "readelf"
- args = [Option "-p", Option section, FileOption "" exe]
- --
- r <- readProcessEnvWithExitCode prog (filter notNull (map showOpt args))
- en_locale_env
- case r of
- (ExitSuccess, out, _err) -> return (doFilter (lines out))
- _ -> return Nothing
- where
- doFilter [] = Nothing
- doFilter (s:r) = case readP_to_S parse s of
- [(p,"")] -> Just p
- _r -> doFilter r
- where parse = do
- skipSpaces
- _ <- R.char '['
- skipSpaces
- _ <- string "0]"
- skipSpaces
- munch (const True)
+
{-
************************************************************************