From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 04 Oct 2010 10:33:05 +0200 Subject: [U-Boot] ARM relocation, question to Heiko In-Reply-To: References: <4CA49746.2050301@emk-elektronik.de> <4CA57468.6090702@free.fr> <4CA57762.3000201@denx.de> <4CA5821E.3070108@emk-elektronik.de> <4CA5873B.6040907@free.fr> <4CA590E6.6070701@emk-elektronik.de> <4CA59B89.6090207@denx.de> <4CA5BB7A.8050304@emk-elektronik.de> <20101001105506.A64D41539A0@gemini.denx.de> <4CA5BFEF.3090208@emk-elektronik.de> <20101001112125.4076E153A7E@gemini.denx.de> <4CA5C7DE.6010300@emk-elektronik.de> <20101001115908.A34411539A0@gemini.denx.de> <4CA5D26D.2090505@emk-elektronik.de> <4CA5D857.5010009@emk-elektronik.de> <20101001125502.D0B4E1539A0@gemini.denx.de> <4CA6DC16.5040409@emk-elektronik.de> <4CA6E517.9040701@fr <1286167382.22760.19.camel@ptyser-laptop> Message-ID: <4CA99141.5020104@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 04/10/2010 10:28, Joakim Tjernlund a ?crit : >> >> Le 04/10/2010 09:36, Joakim Tjernlund a ?crit : >> >>> However, I think we will loose the possibility to add "link once, burn and >> run anywhere" >>> feature I impl. once(but it was at the time deemed to intrusive) if >>> we skip -fPIC and go for the linker -pie relocation. >> >> On ARM at least, I don't think so. From what I see, the -pie ld option >> without the -fPIC/-fPIE compiler option alone builds a .rel.syn table >> that contains all necessary fixes to mve the code anywhere. > > hmm, maybe my memory fails me but doesn't these relocs change the > code to relocate accesses? While in flash you can't do that. > Perhaps this is fixable too with the LINK_OFF method I impl. > but memory fails me as it was quite some time ago. > > Jocke Actually the principle is to link with TEXT_BASE equal to the NOR FLASH location of the image [1] so that relocation is not needed there. Only when you move the code to RAM do you need relocation. [1] which voids my idea of setting TEXT_BASE to 0, btw, but that does not matter much anyway. Amicalement, -- Albert.