<div>+ david.feuer@, ietf-dane@</div><div> </div><div><div><div>@David</div><div>Good to know this. I should look more into compiler options then.</div><div> </div><div>@Viktor</div><div>Thx. This is working as mentioned. I somehow expected that the shrinking of functions would have the same effect on the data types. Do you have any idea how this can be achieved? Is it even possible?</div><div> </div><div>For something like</div><div>```</div><div>data SecretName = AnotherSecret String Int</div><div>```</div><div>the secret names are not shrinked with -optl-s .</div><div>As David mentioned, obfuscation was not a GHC priority, and I am not sure at what level the types defined in Haskell can be shrinked.</div></div></div><div> </div><div> </div><div>18.09.2021, 22:17, "Viktor Dukhovni" <ietf-dane@dukhovni.org>:</div><blockquote><p>On Sat, Sep 18, 2021 at 09:29:27PM +0300, Caeeh wrote:<br /> </p><blockquote> <div><div>How can the names of functions from the generated executable<br /> be hidden/shrinked/erased?</div><div>I tried with -O2 option in GHC,<br /> but it does not work. In the binary I found names that are present in<br /> the source code. I want to remove them.</div></div></blockquote><p><br />Did you "strip" the executable? Are the functions in question exported<br />by their module? If you compile the program below, the executable will<br />have the "unstripped" executable with have the string "secretName", but<br />it disappears if you "strip" it (GHC option: -optl-s):<br /><br />    module Main (main) where<br />    import Data.Maybe<br />    import System.Environment<br /><br />    secretName :: [String] -> Maybe Int<br />    secretName = fmap ((+ 42) . read) . listToMaybe<br />    {-# NOINLINE secretName #-}<br /><br />    main :: IO ()<br />    main = secretName <$> getArgs >>= mapM_ print<br /><br />Demo:<br /><br />    $ rm foo.o foo.hi; ghc -O2 foo.hs; strings -a foo | grep secretName<br />    [1 of 1] Compiling Main ( foo.hs, foo.o )<br />    Linking foo ...<br />    Main_secretName_closure<br />    Main_secretName_info<br /><br />    $ rm foo.o foo.hi; ghc -optl-s -O2 foo.hs; strings -a foo | grep secretName<br />    [1 of 1] Compiling Main ( foo.hs, foo.o )<br />    Linking foo ...<br /> </p>--<br />    Viktor.<br />_______________________________________________<br />Haskell-Cafe mailing list<br />To (un)subscribe, modify options or view archives go to:<br /><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noopener noreferrer">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br />Only members subscribed via the mailman list are allowed to post.</blockquote>