[commit: ghc] master: Add linker notes (c6e579b)

git at git.haskell.org git at git.haskell.org
Mon Apr 11 05:29:16 UTC 2016


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

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

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

commit c6e579bc3820afe71e51b711ee579a4d658ffbf9
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


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

c6e579bc3820afe71e51b711ee579a4d658ffbf9
 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