[commit: ghc] master: Allocate bss section within proper range of other sections (8306141)

git at git.haskell.org git at git.haskell.org
Tue Oct 16 00:00:34 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8306141397d6e47a169dbe4b7ff1b3319a502aa7/ghc

>---------------------------------------------------------------

commit 8306141397d6e47a169dbe4b7ff1b3319a502aa7
Author: Zejun Wu <watashi at fb.com>
Date:   Mon Oct 15 13:52:53 2018 -0400

    Allocate bss section within proper range of other sections
    
    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
    
    This depends on {D5195}
    
    Test Plan:
    1. `./validate`
    
    2.
    
    with
    
    ```
    DYNAMIC_GHC_PROGRAMS = NO
    DYNAMIC_BY_DEFAULT = NO
    ```
    
    `TEST="T15729" make test` passed in both linux 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/D5219


>---------------------------------------------------------------

8306141397d6e47a169dbe4b7ff1b3319a502aa7
 rts/Linker.c                               | 22 +++++----
 rts/LinkerInternals.h                      |  4 ++
 rts/linker/Elf.c                           | 73 ++++++++++++++++++------------
 rts/linker/Elf.h                           |  2 +-
 rts/linker/MachO.c                         | 27 ++++++-----
 rts/linker/MachO.h                         |  2 +-
 rts/linker/PEi386.c                        |  2 +-
 rts/linker/PEi386.h                        |  2 +-
 rts/linker/SymbolExtras.c                  | 31 ++++++-------
 rts/linker/SymbolExtras.h                  |  2 +-
 rts/sm/OSMem.h                             | 10 +++-
 testsuite/tests/ghci/linking/Makefile      |  5 ++
 testsuite/tests/ghci/linking/T15729.c      |  4 ++
 testsuite/tests/ghci/linking/T15729.hs     | 14 ++++++
 testsuite/tests/ghci/linking/T15729.stdout |  2 +
 testsuite/tests/ghci/linking/all.T         |  6 +++
 16 files changed, 132 insertions(+), 76 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8306141397d6e47a169dbe4b7ff1b3319a502aa7


More information about the ghc-commits mailing list