PCR Relocation Errors

Jon Kirwan
  • Jon Kirwan

    Jon Kirwan - 2010-03-21

    I'm receiving errors from the linker that I cannot seem to understand how to fix.  The linker is complaining about a PC relative error, showing the following message:

    ?ASlink-Warning-Byte PCR relocation error
             file              module            area              offset
      Refby  C:\Projects\an    curve             CSEG              01F3
      Defin  C:\Projects\an    curve             CSEG              00AD
    + c:\PROGRA~1\SDCC\BIN\sdld.exe -nf "C:\Projects\anh\SDCC\FOT_01\FOT_DEMO.lnk"
    + c:\PROGRA~1\SDCC\BIN\sdld.exe -nf "C:\Projects\anh\SDCC\FOT_01\FOT_DEMO.lnk" returned errorcode 2

    I'd probably have preferred it if the linker did a better job showing the file names, but I think I know that it must be coming from my curve.c file.  However, there are no code changes there.  The error occurs when I insert one line more of code into my main.c file and then recompile and link.  Take the line out, the error goes away.  Add it, it returns.  Move the line down in main.c, anywhere is fine, and the error returns.  Replace that line with something else that generates code, doesn't matter much what it is, and the error returns.

    This is a SiLabs 8051 type device.

    When I look at the map file, I can see that the address offset of 01F3 occurs in main.  Which makes some sense, as that is what I'm modifying to get the error.  So I'm guessing that some of the later code in main that attempts to access a function in curve.c can't get "patched up" correctly at link time.  But I have no clue how to remedy the problem or how to nail down exactly what is happening here.

    Could someone provide a suggestion or a useful discussion about the linker that might help me?


  • Jon Kirwan

    Jon Kirwan - 2010-03-21

    Moved to Help.  I apologize for placing this here.


Log in to post a comment.