[commit: ghc] ghc-8.6: linker: store entire link map and use it. (c64918c)
git at git.haskell.org
git at git.haskell.org
Thu Dec 6 18:31:11 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.6
Link : http://ghc.haskell.org/trac/ghc/changeset/c64918c1fc86d8feb15bf53b9db11ad81095b8b9/ghc
>---------------------------------------------------------------
commit c64918c1fc86d8feb15bf53b9db11ad81095b8b9
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
(cherry picked from commit a8b7cef4d45a5003bf7584e06912f0f632116c71)
>---------------------------------------------------------------
c64918c1fc86d8feb15bf53b9db11ad81095b8b9
rts/Linker.c | 23 +++++++++++++----------
rts/LinkerInternals.h | 10 +++++++++-
rts/linker/Elf.c | 5 +++--
rts/linker/MachO.c | 8 +++++---
rts/linker/PEi386.c | 11 ++++++-----
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(+), 21 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 c64918c1fc86d8feb15bf53b9db11ad81095b8b9
More information about the ghc-commits
mailing list