From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Mon, 19 May 2014 22:42:23 +0200 Subject: [U-Boot] armv8 relocation questions In-Reply-To: <20140519183033.95208385554@gemini.denx.de> 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> <20140518195128.ACDA238554D@gemini.denx.de> <1400485047.1998.17.camel@yellow> <20140519123342.763BC385554@gemini.denx.de> <1400523005.1985.33.camel@yellow> <20140519183033.95208385554@gemini.denx.de> Message-ID: <1400532143.1985.57.camel@yellow> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Wolfgang, On ma, 2014-05-19 at 20:30 +0200, Wolfgang Denk wrote: > Dear Jeroen Hofstee, > > In message <1400523005.1985.33.camel@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