ULP - Error: relocation out of range

sslama
Posts: 5
Joined: Tue Feb 06, 2018 10:28 am

ULP - Error: relocation out of range

Postby sslama » Fri Apr 12, 2019 2:18 pm

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!

sslama
Posts: 5
Joined: Tue Feb 06, 2018 10:28 am

Re: ULP - Error: relocation out of range

Postby sslama » Mon Apr 15, 2019 12:27 pm

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ULP - Error: relocation out of range

Postby WiFive » Tue Apr 16, 2019 8:50 am

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.

jadeja13
Posts: 1
Joined: Fri Apr 17, 2020 9:43 am

Re: ULP - Error: relocation out of range

Postby jadeja13 » Fri Apr 17, 2020 9:46 am

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.

Who is online

Users browsing this forum: No registered users and 168 guests