Hannes Siebenhandl pushed to branch wip/fendor/hpc-bc-support at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Driver/CodeOutput.hs
    ... ... @@ -346,15 +346,15 @@ outputForeignStubs logger tmpfs dflags unit_state mod location stubs
    346 346
     
    
    347 347
     pprCStubInitFiniDecls :: Platform -> CStub -> SDoc
    
    348 348
     pprCStubInitFiniDecls platform cstub =
    
    349
    -  vcat (zipWith (pprInitOrFiniDecl ".init_array") [0 :: Int ..] (getInitializers cstub))
    
    350
    -  $$ vcat (zipWith (pprInitOrFiniDecl ".fini_array") [0 :: Int ..] (getFinalizers cstub))
    
    349
    +  vcat (zipWith (pprInitOrFiniDecl "ini" ".init_array") [0 :: Int ..] (getInitializers cstub))
    
    350
    +  $$ vcat (zipWith (pprInitOrFiniDecl "fini" ".fini_array") [0 :: Int ..] (getFinalizers cstub))
    
    351 351
       where
    
    352
    -    pprInitOrFiniDecl :: String -> Int -> CLabel -> SDoc
    
    353
    -    pprInitOrFiniDecl section_name n lbl =
    
    352
    +    pprInitOrFiniDecl :: String -> String -> Int -> CLabel -> SDoc
    
    353
    +    pprInitOrFiniDecl suf section_name n lbl =
    
    354 354
           vcat
    
    355 355
             [ hsep [text "extern void", pprCLabel platform lbl, text "(void);"]
    
    356 356
             , hsep [ text "static void (*"
    
    357
    -               <> text "__ghc_init_fini_"
    
    357
    +               <> text "__ghc_" <> text suf <> text "_"
    
    358 358
                    <> int n
    
    359 359
                    <> text ")(void)"
    
    360 360
                    , text "__attribute__((used, section("