Some minor linker cleanups.
authorTamar Christina <tamar@zhox.com>
Sun, 6 Nov 2016 19:08:40 +0000 (19:08 +0000)
committerTamar Christina <tamar@zhox.com>
Sun, 6 Nov 2016 19:08:40 +0000 (19:08 +0000)
commit1964d8690aa41313de31f4ae0113a498d6943d44
tree2d49c5070e5766c798eef5425ad8df279d443b55
parentead83db8a7db772a9f248af9767a4283218a5c9f
Some minor linker cleanups.

Summary:
Just some cleanups to some oddities I've noticed
while investigating a linker issue.

Particularly the dll name returned by `findSysDll`
was decorated. So foo.dll is returned. We make it
`foo.dll.dll` and later drop one `.dll` when passed to
`addDll` which expects it without extension, but still
tries the name *as is* which is why it worked.

This should be slightly faster, since we don't try 4 loads
before we succeed.

Test Plan: ./validate

Reviewers: austin, hvr, erikd, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2680
compiler/ghci/Linker.hs
compiler/main/HscTypes.hs
rts/linker/PEi386.c