X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FnativeGen%2FPositionIndependentCode.hs;h=2571b5ca06fe7a492e6c663edfb4965f9b61e9dc;hp=6a94de22b2251ad597b6c21b44aa8973caa00964;hb=851ad01c2415c44dd52441f65668de82adb5da66;hpb=6494b3cb78498363a2578a62d6cbbf3f55793e2a diff --git a/compiler/nativeGen/PositionIndependentCode.hs b/compiler/nativeGen/PositionIndependentCode.hs index 6a94de2..2571b5c 100644 --- a/compiler/nativeGen/PositionIndependentCode.hs +++ b/compiler/nativeGen/PositionIndependentCode.hs @@ -48,7 +48,7 @@ module PositionIndependentCode ( #include "nativeGen/NCG.h" import Cmm -import MachOp ( MachOp(MO_Add), wordRep ) +import MachOp ( MachOp(MO_Add), wordRep, MachRep(..) ) import CLabel ( CLabel, pprCLabel, mkDynamicLinkerLabel, DynamicLinkerLabelInfo(..), dynamicLinkerLabelInfo, mkPicBaseLabel, @@ -530,7 +530,7 @@ pprGotDeclaration ptext SLIT(".LCTOC1 = .+32768") ] --- We generate one .long literal for every symbol we import; +-- We generate one .long/.quad literal for every symbol we import; -- the dynamic linker will relocate those addresses. pprImportedSymbol importedLbl @@ -538,11 +538,16 @@ pprImportedSymbol importedLbl = vcat [ ptext SLIT(".section \".got2\", \"aw\""), ptext SLIT(".LC_") <> pprCLabel_asm lbl <> char ':', - ptext SLIT("\t.long") <+> pprCLabel_asm lbl + ptext symbolSize <+> pprCLabel_asm lbl ] -- PLT code stubs are generated automatically be the dynamic linker. | otherwise = empty + where + symbolSize = case wordRep of + I32 -> SLIT("\t.long") + I64 -> SLIT("\t.quad") + _ -> panic "Unknown wordRep in pprImportedSymbol" #else