[U-Boot] armv8 relocation questions

Jeroen Hofstee dasuboot at myspectrum.nl
Tue May 20 19:42:58 CEST 2014


Hello Wolfgang,

On ma, 2014-05-19 at 23:05 +0200, Wolfgang Denk wrote:
> Dear Jeroen,
> 
> In message <1400532143.1985.57.camel at yellow> you wrote:
> > 
> > > 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.
> 
> OK, now I know where it's coming from; did you look into this?
> 

peeked, but didn't see anything special about it.

> > > 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.
> 
> Probably with the same / similar compiler options?
> 
> > I wondered about that. I could not find such a flag, nor did David think
> > it exists.. [1]
> 
> You mean this statement:
> 
> 	We can not make gcc-aarch64 do not use adrp instruction when
> 	constructing address of label.
> 
> ?

Yes, I _think_ the architecture _could_ use the full pc, it is just
bigger and slower, and I seems like the compiler folks just did not
implemented it at all.

> > 
> > Perhaps eventually. But for now it seems that also U-boot is forced to
> > keep the relocation offset a multiple of 4k.
> 
> For aarch64, you mean?  Because the tool chain and/or our current
> understanding how it generates code requires it, right?
> 

Right, only for aarch64 and current tools (but my guess it that it will
stay around). ARM32 does not have such a requirement, since it uses the
complete pc. Don't know about other architectures.

That said, _if_ placing start at a not 4k align / page aligned is
acceptable for u-boot it might be smarter to always align the relocation
offset instead of aligning the destination address itself, since
alignment is always preserved in that case as long as it is smaller then
4k (and down, instead of up as in the original patch).

Regards,
Jeroen










More information about the U-Boot mailing list