
#13624: loadObj() does not respect alignment -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.4.1 Component: Runtime System | Version: 8.0.1 (Linker) | Resolution: | Keywords: linker 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 angerman): For what it's worth the macho/aarch64 does this already, and elf/armv7, elf/aarch64 linker will do it. They essentially requests memory via mmap, and memcpy the data per section; this makes sections being page aligned, which I believe satisfies most alignment requirements. An additional check wouldn't hurt though. However we can't use segments, as segments can contain multiple sections that are not bound to the same type. A segment can contain data and text section; which in turn need to live in different pages for them to be properly mprotected. This then means we can't mmap segments. However what we could try to reduce memory footprint is to aggregate text and data sections across object files. Of course mmap + memcpy is slower than directly mmapping. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13624#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler