[GHC] #11388: Bad Windows PE handling in GHC runtime linker

GHC ghc-devs at haskell.org
Thu Jan 14 20:34:54 UTC 2016


#11388: Bad Windows PE handling in GHC runtime linker
-------------------------------------+-------------------------------------
        Reporter:  awson             |                Owner:
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Runtime System    |              Version:
  (Linker)                           |
      Resolution:                    |             Keywords:
Operating System:  Windows           |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1773
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Tamar Christina <tamar@…>):

 In [changeset:"49e414a736efe6a5aa221907d9eab9019978e225/ghc" 49e414a/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="49e414a736efe6a5aa221907d9eab9019978e225"
 Remove lookup of sections by name instead use the index numbers as offsets

 Summary:
 This patch comes from @awson

 {{{
 Playing with `-fsplit-sections` on Windows I've found a pile of ancient
 (it was borrowed from Hugs interpreter code and I don't even know when
 was it created), absolutely redundant and plain wrong code in RTS linker.

 Technically it is a bug, but it doesn't break things when used with
 current Windows binutils with no special linker scripts involved.

 OTOH, it slows down runtime linker on Windows noticeably and thus can
 be considered as a performance bug.

 The nice side-effect for existing users is that GHCi now loads compiled
 object code much faster on Windows.
 }}}

 More specifically, sections were being looked up by name by doing a loop
 over all sections until the section with the given name is found.

 The new approach uses the section index and finds the section in O(1) time
 based on information gathered when we originally processed the section

 Test Plan: ./validate (was run on GHC x86)

 Reviewers: austin, awson, erikd, thomie, bgamari

 Reviewed By: thomie, bgamari

 Subscribers: awson, #ghc_windows_task_force

 Differential Revision: https://phabricator.haskell.org/D1773

 GHC Trac Issues: #11388
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11388#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list