summaryrefslogtreecommitdiff
path: root/utils/deriveConstants/DeriveConstants.hs
diff options
context:
space:
mode:
Diffstat (limited to 'utils/deriveConstants/DeriveConstants.hs')
-rw-r--r--utils/deriveConstants/DeriveConstants.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/deriveConstants/DeriveConstants.hs b/utils/deriveConstants/DeriveConstants.hs
index 9bf21609f1..72605d755e 100644
--- a/utils/deriveConstants/DeriveConstants.hs
+++ b/utils/deriveConstants/DeriveConstants.hs
@@ -643,7 +643,10 @@ getWanted verbose tmpdir gccProgram gccFlags nmProgram
oFile = tmpdir </> "tmp.o"
writeFile cFile cStuff
execute verbose gccProgram (gccFlags ++ ["-c", cFile, "-o", oFile])
- xs <- readProcess nmProgram ["-P", oFile] ""
+ xs <- case os of
+ "openbsd" -> readProcess "/usr/bin/objdump" ["--syms", oFile] ""
+ _ -> readProcess nmProgram ["-P", oFile] ""
+
let ls = lines xs
ms = map parseNmLine ls
m = Map.fromList $ catMaybes ms
@@ -723,6 +726,7 @@ getWanted verbose tmpdir gccProgram gccFlags nmProgram
('_' : n) : "C" : s : _ -> mkP n s
n : "C" : s : _ -> mkP n s
[n, "D", _, s] -> mkP n s
+ [s, "O", "*COM*", _, n] -> mkP n s
_ -> Nothing
where mkP r s = case (stripPrefix prefix r, readHex s) of
(Just name, [(size, "")]) -> Just (name, size)