[GHC] #12244: Idea: Remove unused symbols in link-time for smaller binaries

#12244: Idea: Remove unused symbols in link-time for smaller binaries -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: feature | Status: new request | Priority: lowest | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This caught my attention recently: https://github.com/ocaml/ocaml/pull/608 I think GHC could also benefit from this. I'm currently looking at an 8.0,1-generated executable, generated with -O2. In the code I defined some unused instances, just as an example, and I see code for those in text section in the binary. There is also lots of other unused stuff (I think mostly typeclass instances) imported from libraries and they're all unused because this is a "hello world" program that imports stuff and defines instances for no reason. There should be another ticket around here that reports some numbers on how big GHC-generated executables (and GHC itself) is (when compared with other compilers)... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12244 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12244: Idea: Remove unused symbols in link-time for smaller binaries -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: feature request | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): `-split-objs` and `-split-sections` already pretty much achieve this I think. Do you have a specific example where code built with `-split- sections` ends up with unused code in the final product? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12244#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC