Page 1 of 1

ULP - Error: relocation out of range

Posted: Fri Apr 12, 2019 2:18 pm
by sslama
Hello,

I am writing some assembly code for the Ultra Low Processor. Suddenly at one specific point in the code if I try to load the content of a global variable into a register I get this weird error:
adc.ulp.pS: Assembler messages:
adc.ulp.pS:241: Error: relocation out of range
make[1]: *** [adc.ulp.o] Error 1
make: *** [component-main-build] Error 2
This is the really unfancy code snippet that I have been using all over the place...

Code: Select all

MOVE R0, counter
LD R0, R0, 0
I am loading ind storing data in those variables all the time. But suddenly at this specific position in the code it won't compile...

I could not find this error documented anywhere so help would be appreciated.

Thank you so much!

Re: ULP - Error: relocation out of range

Posted: Mon Apr 15, 2019 12:27 pm
by sslama
I was not able to solve this issue, so if someone stumbles over this problem - i bypassed it by defining a label at another point in the code (that is not reachable in another way). Jumping there - executing the code snippet I wanted to run and Jumping back to where I came from...

So I am still looking for a explanation what this relocation out of range error means and how it is avoided.

Re: ULP - Error: relocation out of range

Posted: Tue Apr 16, 2019 8:50 am
by WiFive
It seems like a bug because move takes a 16bit signed value and the label should be converted to a word address so it should not be possible for it to be out of range.

Re: ULP - Error: relocation out of range

Posted: Fri Apr 17, 2020 9:46 am
by jadeja13
I had the same issue, and i had resolved it following way.

reason 1:
Remember to add instruction "psr" before jump instruction.
caution : Do not put psr before "jumpr" and "jumps" it is not required.

reason2:
find out the instruction which use jumpr
e.g. jumpr func1, 1, ge
........
func1:
..some instruction.
cut and paste the func1 near to the function using the jumpr instuction.
Basically relative jumpr is relative jump so the current jumpr instruction and its label should not be too far.

I have resolve it this way. Hope this will help. Please keep posted if you can resolve with instruction with my suggestions.