From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 8 Sep 2020 13:02:39 -0600 Subject: [PATCH v2 2/3] arm64: Bail out PIE builds early if load address is not 4K aligned In-Reply-To: <20200907095235.GA2954729@toto> References: <20200904090749.4067768-1-edgar.iglesias@gmail.com> <20200904090749.4067768-3-edgar.iglesias@gmail.com> <3196e201-a214-ebde-4ae4-35932d551ba0@wwwdotorg.org> <20200907095235.GA2954729@toto> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/7/20 3:52 AM, 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" >>> >>> 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. Oh yes, I guess that is true.