From: Clemens Fruhwirth Date: Wed, 27 Jun 2007 16:51:50 +0000 (+0000) Subject: Set .type @object for all global symbols in NCG X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b3cb534bf6da5d2e3b0084defd838492684052a9;hp=c111317d3209321e5f2ba43304018b132b174415;p=ghc-hetmet.git Set .type @object for all global symbols in NCG When linking against a dynamic library, the linker will emit a warning if no type information is present within the library. We generate the most trivial type for all externally visible labels, namely @object. --- diff --git a/compiler/nativeGen/PprMach.hs b/compiler/nativeGen/PprMach.hs index 29cd23e..52d7706 100644 --- a/compiler/nativeGen/PprMach.hs +++ b/compiler/nativeGen/PprMach.hs @@ -692,8 +692,14 @@ pprGloblDecl lbl SLIT(".globl ")) <> pprCLabel_asm lbl +pprTypeAndSizeDecl :: CLabel -> Doc +pprTypeAndSizeDecl lbl + | not (externallyVisibleCLabel lbl) = empty + | otherwise = ptext SLIT(".type ") <> + pprCLabel_asm lbl <> ptext SLIT(", @object") + pprLabel :: CLabel -> Doc -pprLabel lbl = pprGloblDecl lbl $$ (pprCLabel_asm lbl <> char ':') +pprLabel lbl = pprGloblDecl lbl $$ pprTypeAndSizeDecl lbl $$ (pprCLabel_asm lbl <> char ':') pprASCII str