From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sun, 18 May 2014 21:51:28 +0200 Subject: [U-Boot] armv8 relocation questions In-Reply-To: <1400416665.2394.20.camel@yellow> References: <537290F3.4000905@broadcom.com> <61F81D9C-81BA-4567-9B5F-3F5069473201@phytium.com.cn> <53763B78.6030801@broadcom.com> <20140516202825.240C838554C@gemini.denx.de> <20140516211514.GE7207@bill-the-cat> <1400279219.4133.22.camel@yellow> <20140517165301.E49DE38042B@gemini.denx.de> <1400416665.2394.20.camel@yellow> Message-ID: <20140518195128.ACDA238554D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Jeroen, In message <1400416665.2394.20.camel@yellow> you wrote: > > > > So, I think the 4kb alignment would be a requirement or restriction. > > > Gcc did not declare it explicitly > > > due to in normal world memory are allocated with page aligned. > > > If u-boot for aarch64 want to be compiled at address not 4kb aligned > > > the relocated address > > > should also be shifted with the same offset. > > > > Sorry, I don't understand anything here. At which exact place is > > there any such 4 k alignment restriction? When we relocate U-Boot, we > > just process a list of addresses. Even if the start of the image is > > aligned to a 4 k boundary, there are a zillion of other addresses that > > are not, and these can be relocated just fine. > > > > The following document [1] mentions: > > "ADRP Xd, label ... > And apparently gcc choose to use it as such. Since the instructions in Where exactly does it chose to do so? I cannot understand why that should be a problem for _start, but not for any of the other symbols we're relocating? > question are relative to the most significant bits of the pc it does not > need fixups, so it is not included in the "list of addresses" you > mention. The compiler does create the 4k requirement though by using the > instruction the way it does. Sorry, I cannot follow. where exactly does this happen, and why there, and not anywhere else? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Any excuse will serve a tyrant." - Aesop