X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FPIC.hs;fp=compiler%2FnativeGen%2FPIC.hs;h=a573b6b5db866ae1d552846d2f7b3ca1e7c36aa3;hb=7854ec4b11e117f8514553890851d14a66690fbb;hp=eb233e0459d1fbc9ba74a270e1417df701c5686f;hpb=e5fba2f55f560b41e27047bf59958729d51aca84;p=ghc-hetmet.git diff --git a/compiler/nativeGen/PIC.hs b/compiler/nativeGen/PIC.hs index eb233e0..a573b6b 100644 --- a/compiler/nativeGen/PIC.hs +++ b/compiler/nativeGen/PIC.hs @@ -64,12 +64,12 @@ import NCGMonad import Cmm -import CLabel ( CLabel, pprCLabel, +import CLabel ( CLabel, ForeignLabelSource(..), pprCLabel, mkDynamicLinkerLabel, DynamicLinkerLabelInfo(..), dynamicLinkerLabelInfo, mkPicBaseLabel, labelDynamic, externallyVisibleCLabel ) -import CLabel ( mkForeignLabel ) +import CLabel ( mkForeignLabel, pprDebugCLabel ) import StaticFlags ( opt_PIC, opt_Static ) @@ -83,6 +83,7 @@ import DynFlags import FastString + -------------------------------------------------------------------------------- -- It gets called by the cmmToCmm pass for every CmmLabel in the Cmm -- code. It does The Right Thing(tm) to convert the CmmLabel into a @@ -110,8 +111,12 @@ cmmMakeDynamicReference -> ReferenceKind -- whether this is the target of a jump -> CLabel -- the label -> m CmmExpr - + cmmMakeDynamicReference dflags addImport referenceKind lbl + = cmmMakeDynamicReference' dflags addImport referenceKind lbl + + +cmmMakeDynamicReference' dflags addImport referenceKind lbl | Just _ <- dynamicLinkerLabelInfo lbl = return $ CmmLit $ CmmLabel lbl -- already processed it, pass through @@ -450,8 +455,10 @@ needImportedSymbols arch os -- position-independent code. gotLabel :: CLabel gotLabel - = mkForeignLabel -- HACK: it's not really foreign - (fsLit ".LCTOC1") Nothing False IsData + -- HACK: this label isn't really foreign + = mkForeignLabel + (fsLit ".LCTOC1") + Nothing ForeignLabelInThisPackage IsData