diff options
-rw-r--r-- | compiler/GHC/CmmToAsm/PIC.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/GHC/CmmToAsm/PIC.hs b/compiler/GHC/CmmToAsm/PIC.hs index 81ce9d34a9..10ddaa1f5f 100644 --- a/compiler/GHC/CmmToAsm/PIC.hs +++ b/compiler/GHC/CmmToAsm/PIC.hs @@ -285,14 +285,11 @@ howToAccessLabel config arch OSDarwin DataReference lbl -- when generating PIC code, all cross-module data references must -- must go via a symbol pointer, too, because the assembler -- cannot generate code for a label difference where one - -- label is undefined. Doesn't apply t x86_64. - -- Unfortunately, we don't know whether it's cross-module, - -- so we do it for all externally visible labels. - -- This is a slight waste of time and space, but otherwise - -- we'd need to pass the current Module all the way in to - -- this function. + -- label is undefined. Doesn't apply to x86_64 (why?). | arch /= ArchX86_64 - , ncgPIC config && externallyVisibleCLabel lbl + , not (isLocalCLabel (ncgThisModule config) lbl) + , ncgPIC config + , externallyVisibleCLabel lbl = AccessViaSymbolPtr | otherwise |