[GHC] #13678: Overhaul the linker

GHC ghc-devs at haskell.org
Wed May 10 00:56:18 UTC 2017


#13678: Overhaul the linker
-------------------------------------+-------------------------------------
           Reporter:  angerman       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  lowest         |         Milestone:  ⊥
          Component:  Compiler       |           Version:  8.3
  (Linking)                          |
           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:
-------------------------------------+-------------------------------------
 The linker has gained support for aarch64/macho, and aarch64/elf, as well
 as improved arm/elf code, this code introduces separate mapping of
 sections into different pages, to allow for `W^X` protection. This is
 essentially a requirement on iOS, and I believe a sane default to have.
 To this extend the symbol extras logic needed to be split up into GOT and
 PLTs, where the PLTs are allocated alongside the sections, as
 the architecture may not allow arbitrary jumps (arm/aarch64). The
 introduction aarch64/elf has also been
 done through a pseudo interface so that the actual relocation logic can be
 contained within it's own files.

 Ideally we'd improve the linker by migrating the existing (heavily
 #ifdef'd) to the new separate section mapping (`W^X`) and pseudo interface
 approach. The separate section mapping logic has an inherent memory
 inefficiency (which might be improved a bit by aggregating similar
 sections into the same page), and might also cause a performance penalty
 due to separate mapping instead of a single file mmap.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13678>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list