[commit: ghc] ghc-8.0: Skip 64-bit symbol tables (ce66c24)

git at git.haskell.org git at git.haskell.org
Mon Nov 14 23:08:58 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/ce66c24ac91ff7893dc91f31292bcebc60df4924/ghc

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

commit ce66c24ac91ff7893dc91f31292bcebc60df4924
Author: Sylvain HENRY <hsyl20 at gmail.com>
Date:   Mon Nov 14 17:16:27 2016 -0500

    Skip 64-bit symbol tables
    
    This patch makes the RTS linker skip 64-bit symbol table entries.  See
    https://mail.haskell.org/pipermail/ghc-devs/2016-November/013210.html
    
    Test Plan: validate
    
    Reviewers: austin, erikd, simonmar, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: osa1, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2697
    
    GHC Trac Issues: #12827
    
    (cherry picked from commit 1b336d9064514219f370a4a12d7019f23393600e)


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

ce66c24ac91ff7893dc91f31292bcebc60df4924
 rts/Linker.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index 9412e5b..b9237b0 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2323,12 +2323,14 @@ static HsInt loadArchive_ (pathchar *path)
                 memcpy(fileName, gnuFileIndex + n, thisFileNameSize);
                 fileName[thisFileNameSize] = '\0';
             }
-            else if (fileName[1] == ' ') {
+            /* Skip 32-bit symbol table ("/" + 15 blank characters)
+               and  64-bit symbol table ("/SYM64/" + 9 blank characters) */
+            else if (fileName[1] == ' ' || (0 == strncmp(&fileName[1], "SYM64/", 6))) {
                 fileName[0] = '\0';
                 thisFileNameSize = 0;
             }
             else {
-                barf("loadArchive: GNU-variant filename offset not found while reading filename from `%s'", path);
+                barf("loadArchive: invalid GNU-variant filename `%.16s' while reading filename from `%s'", fileName, path);
             }
         }
         /* Finally, the case where the filename field actually contains



More information about the ghc-commits mailing list