[commit: ghc] master: linker: store entire link map and use it. (a8b7cef)

git at git.haskell.org git at git.haskell.org
Tue Dec 4 07:16:05 UTC 2018


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

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

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

commit a8b7cef4d45a5003bf7584e06912f0f632116c71
Author: Tamar Christina <tamar at zhox.com>
Date:   Tue Dec 4 00:29:08 2018 +0000

    linker: store entire link map and use it.
    
    Summary:
    This fixes a corner case in which we have seen the symbol multiple times in
    different static libraries, but due to a depencency we end up loading the
    symbol from a library other than the first one.
    
    Previously the runtime linker would only track symbols from the first
    library and did not store the full link map.  In this case it was unable
    to find the address for the symbols in the second library during delay
    loading.
    
    This change stores the address of all symbols seen so a full link map
    is generated, such that when we make a different decision later than what
    was expected we're able to still correctly load the library.
    
    Test Plan: ./validate, new testcase T15894
    
    Reviewers: angerman, bgamari, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #15894
    
    Differential Revision: https://phabricator.haskell.org/D5353


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

a8b7cef4d45a5003bf7584e06912f0f632116c71
 rts/Linker.c                             | 23 +++++++++++++----------
 rts/LinkerInternals.h                    | 10 +++++++++-
 rts/linker/Elf.c                         |  5 +++--
 rts/linker/MachO.c                       |  8 +++++---
 rts/linker/PEi386.c                      | 10 ++++++----
 testsuite/tests/rts/T15894/Makefile      |  8 ++++++++
 testsuite/tests/rts/T15894/T15894.stdout |  1 +
 testsuite/tests/rts/T15894/all.T         |  3 +++
 testsuite/tests/rts/T15894/copysign.c    | 11 +++++++++++
 testsuite/tests/rts/T15894/main.hs       |  5 +++++
 10 files changed, 64 insertions(+), 20 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 a8b7cef4d45a5003bf7584e06912f0f632116c71


More information about the ghc-commits mailing list