[commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Allocate bss section within proper range of other sections (740534d)

git at git.haskell.org git at git.haskell.org
Fri Feb 1 05:55:09 UTC 2019


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

On branches: wip/T16212-fixed,wip/sgraf-no-exnstr
Link       : http://ghc.haskell.org/trac/ghc/changeset/740534d43cf9f1635c60f6311b7e0d89af962617/ghc

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

commit 740534d43cf9f1635c60f6311b7e0d89af962617
Author: Zejun Wu <watashi at fb.com>
Date:   Fri Dec 28 20:47:33 2018 -0800

    Allocate bss section within proper range of other sections
    
    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


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

740534d43cf9f1635c60f6311b7e0d89af962617
 rts/Linker.c                               | 22 +++++----
 rts/LinkerInternals.h                      |  4 ++
 rts/linker/Elf.c                           | 73 ++++++++++++++++++------------
 rts/linker/Elf.h                           |  2 +-
 rts/linker/MachO.c                         | 19 ++++----
 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         |  5 ++
 16 files changed, 127 insertions(+), 72 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 740534d43cf9f1635c60f6311b7e0d89af962617


More information about the ghc-commits mailing list