(I apologize for placing this in Open Discussion first. My mistake not noticing where I was posting at the time.)
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:
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 about the whys and wherefores of these errors (a predictable way to produce them?) or a useful discussion about the linker that might help me?
Thanks,
Jon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I may have my own answer. Replacing an AJMP instruction in the curve.c code with an LJMP appears to have repaired it. I believe there was a 2k block boundary issue that cropped up with certain coding in earlier-linked files that pushed curve.c code around. Good that the linker caught it. Bad that it took seven hours for the idea to drift in to mind about why.
Jon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(I apologize for placing this in Open Discussion first. My mistake not noticing where I was posting at the time.)
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:
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 about the whys and wherefores of these errors (a predictable way to produce them?) or a useful discussion about the linker that might help me?
Thanks,
Jon
I may have my own answer. Replacing an AJMP instruction in the curve.c code with an LJMP appears to have repaired it. I believe there was a 2k block boundary issue that cropped up with certain coding in earlier-linked files that pushed curve.c code around. Good that the linker caught it. Bad that it took seven hours for the idea to drift in to mind about why.
Jon