View Single Post
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#160
Good news

I found a way how to get address where was u-boot loaded by NOLO and where u-boot expect start address in any C or ASM code (not only in start.S). So relocation of u-boot binary to correct address is possible in any source file.

It is very tricky. In one section will be stored address of that section generated by compiler (this address will correct after reloacation). And also it is possible to get address where is really that section stored.

assembler code:
Code:
relocaddr:
.word .
and in same file will be calculating offset (saved in r0):
Code:
adr	r0, relocaddr @real address of section
ldr	r1, relocaddr @correct address of section after relocation
sub	r0, r0, r1 @calculate offset
after that it is possible to move relocation code from armv7/start.S to rx51 board code and maybe this solution can be accepted in upstream.
 

The Following 6 Users Say Thank You to pali For This Useful Post: