pprDynamicLinkerAsmLabel :: Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel platform dllInfo lbl
 = if platformOS platform == OSDarwin
   then if platformArch platform == ArchX86_64
        then case dllInfo of
             CodeStub        -> char 'L' <> ppr lbl <> text "$stub"
             SymbolPtr       -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
             GotSymbolPtr    -> ppr lbl <> text "@GOTPCREL"
             GotSymbolOffset -> ppr lbl
        else case dllInfo of
             CodeStub  -> char 'L' <> ppr lbl <> text "$stub"
             SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
             _         -> panic "pprDynamicLinkerAsmLabel"

   else if osElfTarget (platformOS platform)
        then if platformArch platform == ArchPPC
             then case dllInfo of
                  CodeStub  -> ppr lbl <> text "@plt"
                  SymbolPtr -> text ".LC_" <> ppr lbl
                  _         -> panic "pprDynamicLinkerAsmLabel"
             else if platformArch platform == ArchX86_64
                  then case dllInfo of
                       CodeStub        -> ppr lbl <> text "@plt"
                       GotSymbolPtr    -> ppr lbl <> text "@gotpcrel"
                       GotSymbolOffset -> ppr lbl
                       SymbolPtr       -> text ".LC_" <> ppr lbl
        else case dllInfo of
             CodeStub        -> ppr lbl <> text "@plt"
             SymbolPtr       -> text ".LC_" <> ppr lbl
             GotSymbolPtr    -> ppr lbl <> text "@got"
             GotSymbolOffset -> ppr lbl <> text "@gotoff"
   else if platformOS platform == OSMinGW32
        then case dllInfo of
             SymbolPtr -> text "__imp_" <> ppr lbl
             _         -> panic "pprDynamicLinkerAsmLabel"
   else panic "pprDynamicLinkerAsmLabel"
pprDynamicLinkerAsmLabel :: Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel platform dllInfo lbl
 = if platformOS platform == OSDarwin
   then if platformArch platform == ArchX86_64
        then case dllInfo of
             CodeStub        -> char 'L' <> ppr lbl <> text "$stub"
             SymbolPtr       -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
             GotSymbolPtr    -> ppr lbl <> text "@GOTPCREL"
             GotSymbolOffset -> ppr lbl
        else case dllInfo of
             CodeStub  -> char 'L' <> ppr lbl <> text "$stub"
             SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
             _         -> panic "pprDynamicLinkerAsmLabel"

   else if osElfTarget (platformOS platform)
        then if platformArch platform == ArchPPC
             then case dllInfo of
                  CodeStub  -> ppr lbl <> text "@plt"
                  SymbolPtr -> text ".LC_" <> ppr lbl
                  _         -> panic "pprDynamicLinkerAsmLabel"
             else if platformArch platform == ArchX86_64
                  then case dllInfo of
                       CodeStub        -> ppr lbl <> text "@plt"
                       GotSymbolPtr    -> ppr lbl <> text "@gotpcrel"
                       GotSymbolOffset -> ppr lbl
                       SymbolPtr       -> text ".LC_" <> ppr lbl
        else case dllInfo of
             CodeStub        -> ppr lbl <> text "@plt"
             SymbolPtr       -> text ".LC_" <> ppr lbl
             GotSymbolPtr    -> ppr lbl <> text "@got"
             GotSymbolOffset -> ppr lbl <> text "@gotoff"
   else if platformOS platform == OSMinGW32
        then case dllInfo of
             SymbolPtr -> text "__imp_" <> ppr lbl
             _         -> panic "pprDynamicLinkerAsmLabel"
   else panic "pprDynamicLinkerAsmLabel"
pprDynamicLinkerAsmLabel platform dllInfo lbl
 = if platformOS platform == OSDarwin
   then if platformArch platform == ArchX86_64
        then case dllInfo of
             CodeStub        -> char 'L' <> ppr lbl <> text "$stub"
             SymbolPtr       -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
             GotSymbolPtr    -> ppr lbl <> text "@GOTPCREL"
             GotSymbolOffset -> ppr lbl
        else case dllInfo of
             CodeStub  -> char 'L' <> ppr lbl <> text "$stub"
             SymbolPtr -> char 'L' <> ppr lbl <> text "$non_lazy_ptr"
             _         -> panic "pprDynamicLinkerAsmLabel"

   else if osElfTarget (platformOS platform)
        then if platformArch platform == ArchPPC
             then case dllInfo of
                  CodeStub  -> ppr lbl <> text "@plt"
                  SymbolPtr -> text ".LC_" <> ppr lbl
                  _         -> panic "pprDynamicLinkerAsmLabel"
             else if platformArch platform == ArchX86_64
                  then case dllInfo of
                       CodeStub        -> ppr lbl <> text "@plt"
                       GotSymbolPtr    -> ppr lbl <> text "@gotpcrel"
                       GotSymbolOffset -> ppr lbl
                       SymbolPtr       -> text ".LC_" <> ppr lbl
        else case dllInfo of
             CodeStub        -> ppr lbl <> text "@plt"
             SymbolPtr       -> text ".LC_" <> ppr lbl
             GotSymbolPtr    -> ppr lbl <> text "@got"
             GotSymbolOffset -> ppr lbl <> text "@gotoff"
   else if platformOS platform == OSMinGW32
        then case dllInfo of
             SymbolPtr -> text "__imp_" <> ppr lbl
             _         -> panic "pprDynamicLinkerAsmLabel"
   else panic "pprDynamicLinkerAsmLabel"