[commit: ghc] master: ELF/x86_64: map object file sections separately into the low 2GB (04e8366)

git at git.haskell.org git at git.haskell.org
Thu Oct 15 15:17:37 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/04e8366608fee4f5e3358acc855bc6f556c3f508/ghc

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

commit 04e8366608fee4f5e3358acc855bc6f556c3f508
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Oct 15 16:17:06 2015 +0100

    ELF/x86_64: map object file sections separately into the low 2GB
    
    On 64-bit ELF we need to link object files into the low 2GB due to the
    small memory model.  Previously we would map the entire object file
    using MAP_32BIT, but the object file can consist of 75% or more
    symbols, which only need to be present during linking, so this is
    wasteful.  In our particular application, we're already running out of
    space here.
    
    This patch changes the way we load object files on ELF platforms so
    that the object is first mapped above the 2GB boundary, parsed, and
    then the important sections are re-mapped into the low 2GB area.
    
    Test Plan:
    validate
    (also needs testing on OS X & Windows, preferably 32 & 64 bit)
    
    Reviewers: Phyx, trommler, bgamari, austin
    
    Subscribers: hsyl20, thomie, bgamari
    
    Differential Revision: https://phabricator.haskell.org/D975


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

04e8366608fee4f5e3358acc855bc6f556c3f508
 rts/CheckUnload.c                  |  14 +-
 rts/Linker.c                       | 893 +++++++++++++++++++++++++++----------
 rts/LinkerInternals.h              |  34 +-
 testsuite/tests/ghci/linking/all.T |   2 +-
 testsuite/tests/rts/linker_error.c |   4 +-
 5 files changed, 686 insertions(+), 261 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 04e8366608fee4f5e3358acc855bc6f556c3f508


More information about the ghc-commits mailing list