[PATCH v2 2/3] arm64: Bail out PIE builds early if load address is not 4K aligned

Tom Rini trini at konsulko.com
Mon Sep 7 14:57:39 CEST 2020


On Mon, Sep 07, 2020 at 11:52:35AM +0200, Edgar E. Iglesias wrote:
> On Fri, Sep 04, 2020 at 12:43:57PM -0600, Stephen Warren wrote:
> > On 9/4/20 3:07 AM, Edgar E. Iglesias wrote:
> > > From: "Edgar E. Iglesias" <edgar.iglesias at xilinx.com>
> > > 
> > > PIE requires a 4K aligned load address. If this is not met, trap
> > > the startup sequence in a WFI loop rather than running into obscure
> > > failures.
> > 
> > > diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
> > >  #if CONFIG_POSITION_INDEPENDENT
> > > +	/* Verify that we're 4K aligned.  */
> > 
> > Similar to the comment on the previous patch: I believe the code that
> > implements this check should be outside the #if check, since it's always
> > needed.
> 
> But a check for non-PIE would have to be stricter, wouldn't it?
> I.e the load address needs to exactly match the link-time address.
> 
> Perhaps we should add the non-PIE check in a separate patch (if at all)?

If we can catch a bad configuration at link time in the non-PIE case (as
said in another part of this thread I believe) then we should, yes,
thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200907/4d09778c/attachment.sig>


More information about the U-Boot mailing list