Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • rts/Linker.c
    ... ... @@ -1444,6 +1444,7 @@ preloadObjectFile (pathchar *path)
    1444 1444
        oc = mkOc(STATIC_OBJECT, path, image, fileSize, true, NULL, misalignment);
    
    1445 1445
     
    
    1446 1446
        if (!verifyAndInitOc(oc)) {
    
    1447
    +       freePreloadObjectFile(oc);
    
    1447 1448
            freeObjectCode(oc);
    
    1448 1449
            debugBelch("loadObj: Failed to verify oc.\n");
    
    1449 1450
            return NULL;
    

  • rts/LinkerInternals.h
    ... ... @@ -385,7 +385,7 @@ extern Elf_Word shndx_table_uninit_label;
    385 385
         )
    
    386 386
     
    
    387 387
     #define ocDebugBelch(oc, s, ...) \
    
    388
    -    debugBelch("%s(%" PATH_FMT ": " s, \
    
    388
    +    errorBelch("%s(%" PATH_FMT ": " s, \
    
    389 389
                    __func__, \
    
    390 390
                    OC_INFORMATIVE_FILENAME(oc), \
    
    391 391
                    ##__VA_ARGS__)
    

  • rts/linker/LoadArchive.c
    ... ... @@ -627,8 +627,9 @@ HsInt loadArchive_ (pathchar *path)
    627 627
     
    
    628 628
                 if(!verifyAndInitOc( oc ))
    
    629 629
                 {
    
    630
    -                freeObjectCode( oc );
    
    631 630
                     IF_DEBUG(linker, ocDebugBelch(oc, "Faild to verify ... skipping."));
    
    631
    +                errorBelch("Faild to verify ... skipping.");
    
    632
    +                freeObjectCode( oc );
    
    632 633
                     continue;
    
    633 634
                 }
    
    634 635