Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,344
    • Issues 5,344
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 572
    • Merge requests 572
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8237
Closed
Open
Issue created Sep 06, 2013 by Edward Z. Yang@ezyangDeveloper

checkProddableBlock: invalid fixup in runtime linker (Windows)

I attempted to load a very simple C file into GHC using the linker and got this error. The C file is:

#include <stdio.h> 
static void f(void); // __attribute__((constructor));
static void f(void) 
{
        printf("Hooray!");
}

and the test program:

{-# LANGUAGE ForeignFunctionInterface #-}
import Foreign.C.String

main = do
    initLinker
    withCWString "test.o" $ \s -> loadObj s
    resolveObjs

foreign import ccall "initLinker" initLinker :: IO ()
foreign import ccall "loadObj" loadObj :: CWString -> IO Int
foreign import ccall "resolveObjs" resolveObjs :: IO ()

Test is run as:

bash.exe-3.1$ gcc -c test.c                                                                           
bash.exe-3.1$ ../ghc-init/inplace/bin/ghc-stage2 --make foo.hs -debug -fforce-recomp                  
[1 of 1] Compiling Main             ( foo.hs, foo.o )                                                 
Linking foo.exe ...                                                                                   
bash.exe-3.1$ ./foo                                                                                   
foo.exe: Unknown PEi386 section name `.eh_frame' (while processing: test.o)                           
foo.exe: internal error: checkProddableBlock: invalid fixup in runtime linker: 002c0154               
    (GHC version 7.7.20130905 for i386_unknown_mingw32)                                               
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug                           
                                                                                                      
This application has requested the Runtime to terminate it in an unusual way.                         
Please contact the application's support team for more information. 

More useful info:

bash.exe-3.1$ objdump -s -j .text test.o                                                              
                                                                                                      
test.o:     file format pe-i386                                                                       
                                                                                                      
Contents of section .text:                                                                            
 0000 5589e583 ec18c704 24000000 00e80000  U.......$.......                                           
 0010 0000c9c3                             ....

bash.exe-3.1$ objdump -r -j .text test.o                                                              
                                                                                                      
test.o:     file format pe-i386                                                                       
                                                                                                      
RELOCATION RECORDS FOR [.text]:                                                                       
OFFSET   TYPE              VALUE                                                                      
00000009 dir32             .rdata                                                                     
0000000e DISP32            _printf                                                                    
                                                                                                      
Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking