[commit: ghc] ghc-8.0: Add linker notes (05aab19)
git at git.haskell.org
git at git.haskell.org
Fri Apr 15 09:57:43 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/05aab1954b619a7bb0bcf7be401d621d200aa004/ghc
>---------------------------------------------------------------
commit 05aab1954b619a7bb0bcf7be401d621d200aa004
Author: Tamar Christina <tamar at zhox.com>
Date: Mon Apr 11 06:51:44 2016 +0200
Add linker notes
Summary: Add linker notes following #11223 and D1805
Reviewers: austin, bgamari, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2102
GHC Trac Issues: #11223
(cherry picked from commit c6e579bc3820afe71e51b711ee579a4d658ffbf9)
>---------------------------------------------------------------
05aab1954b619a7bb0bcf7be401d621d200aa004
rts/Linker.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/rts/Linker.c b/rts/Linker.c
index a296afe..782444a 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -208,6 +208,16 @@ typedef struct _RtsSymbolInfo {
When a new declaration or statement is performed ultimately lookupSymbol is called
without doing a re-link.
+ The goal of these different phases is to allow the linker to be able to perform
+ "lazy loading" of ObjectCode. The reason for this is that we want to only link
+ in symbols that are actually required for the link. This reduces:
+
+ 1) Dependency chains, if A.o required a .o in libB but A.o isn't required to link
+ then we don't need to load libB. This means the dependency chain for libraries
+ such as mingw32 and mingwex can be broken down.
+
+ 2) The number of duplicate symbols, since now only symbols that are
+ true duplicates will display the error.
*/
static /*Str*/HashTable *symhash;
@@ -2711,6 +2721,9 @@ int ocTryLoad (ObjectCode* oc) {
This call is intended to have no side-effects when a non-duplicate
symbol is re-inserted.
+
+ TODO: SymbolInfo can be moved into ObjectCode in order to be more
+ memory efficient. See Trac #11816
*/
int x;
SymbolInfo symbol;
More information about the ghc-commits
mailing list