Skip to content
  • Zejun Wu's avatar
    Allocate bss section within proper range of other sections · 740534d4
    Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
    Summary:
    This re-applies {D5195} and {D5235}, they were reverted as part of diff
    stack to unbreak i386. The proper fix is done in {D5289}.
    
    Allocate bss section within proper range of other sections:
    
    * when `+RTS -xp` is passed, allocate it contiguously as we did for
      jump islands
    * when we mmap the code to lower 2Gb, we should allocate bss section
      there too
    
    Test Plan:
    1. `./validate`
    
    2.
    
    with
    
    ```
    DYNAMIC_GHC_PROGRAMS = NO
    DYNAMIC_BY_DEFAULT = NO
    ```
    
    `TEST="T15729" make test` passed in both linux (both i386 and x86_64) and macos.
    
    3.
    
    Also test in a use case where we used to encouter error like:
    
    ```
    ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) =
    b90282ba
    ```
    
    and now, everything works fine.
    
    Reviewers: simonmar, bgamari, angerman, erikd
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #15729
    
    Differential Revision: https://phabricator.haskell.org/D5290
    740534d4