[U-Boot] armv8 relocation questions

Jeroen Hofstee dasuboot at myspectrum.nl
Mon May 19 22:42:23 CEST 2014


Hello Wolfgang,

On ma, 2014-05-19 at 20:30 +0200, Wolfgang Denk wrote:
> Dear Jeroen Hofstee,
> 
> In message <1400523005.1985.33.camel at yellow> you wrote:
> > 
> > mm, forget about U-Boot for a second and please consider the following,
> > complicated, program:
> 
> I think we should NOT forget U-Boot, which comes with it's own,
> specifically tuned set of compiler options and linker scripts.
> 

well it mentioned for a second...

> > compiled with `aarch64-linux-gnu-gcc -g -Wall hello.c` results in:
> 
> I have no idea how the tool chain was configured here, and what the
> linker script might look like.

for what it is worth:
aarch64-linux-gnu-gcc (Ubuntu/Linaro 4.8.1-10ubuntu7) 4.8.1
with its default linker script.

> 
> Maybe.  This is with some (unknown here) specific set of compiler
> options and linker statements.  This does not mean that the same or
> silimar code will be generated for U-Boot, 

Could be, but the vexpress_aemv8a shows the same pattern. It has around
1688 of adrp instructions.

> or - if it really is - that
> this has to be like that.  Eventually the tool chain needs some
> tweaking flags to tell it that we intend to relocate the image later?
> 

I wondered about that. I could not find such a flag, nor did David think
it exists.. [1]

> > > The question is - where does such code get emitted?  Is it generated
> > > from C code, or manually created assembly?
> > > 
> > It is generated, there are no literal adrp instructions in U-boot.
> > As far as I understand it, it is a compiler feature..
> 
> That depends on specific compiler options / linker settings,
> eventually?
> 

Perhaps eventually. But for now it seems that also U-boot is forced to
keep the relocation offset a multiple of 4k.

Regards,
Jeroen 

[1] http://lists.denx.de/pipermail/u-boot/2014-May/179741.html



More information about the U-Boot mailing list