From: Wolfgang Denk Date: Mon, 04 Oct 2010 08:08:13 +0200 Subject: [U-Boot] ARM relocation, question to Heiko In-Reply-To: <1286167382.22760.19.camel@ptyser-laptop> References: <4CA49746.2050301@emk-elektronik.de> <4CA4AEFF.3050101@denx.de> <20100930174308.070ECD2B48C@gemini.denx.de> <4CA570D3.9040406@denx.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@free.fr> <4CA6E8E5.2090605@emk-elektronik.de> <20101003180349.96F3C153A7E@gemini.denx.de> <1286167382.22760.19.camel@ptyser-laptop> Message-ID: <20101004060813.E42F41539A0@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 Peter Tyser, In message <1286167382.22760.19.camel@ptyser-laptop> you wrote: > > > Peter, could you please fill in the details of that old story? > > I haven't been following the ARM relocation thread very closely, but a > summary of the PPC relocation is: > - Prior to commit 858290178f222d998b6425d85cf06822467918f3 PPC supported > basic relocation, but didn't relocate static pointers, eg pointers in a > structure, such as the strings in the cmd_pca953x[] table. So we had to > use the hokey "struct->field += gd->reloc_off" fixups that we still have > for some arches. > > - Adding "-mrelocatable" to the gcc's flags would add additional > relocation info into the ".fixup" section that allowed us to properly > fixup static pointers and get rid of the "+= gd->reloc_off" fixups. The > additional fixup code was relatively small, in the 1-2% ballpark I > think. > > - Unfortunately "-mrelocatable" is PPC specific. I remember dabbling > with other, more general relocation flags like -fPIC, pie, etc, but went > with -mrelocatable mainly because it was a smaller, easier change. We > could share the already-used relocation fixup code in many PPC arch's > start.S, so it wasn't too hard to get working unlike the other > relocation schemes. > > - Graeme Russ was working on relocation for x86 near the same time. He > started this thread which may provide useful info: > http://www.mail-archive.com/u-boot at lists.denx.de/msg23347.html He > discusses the impact of other compile flags, most of which were generic > so could apply to this ARM discussion hopefully. Thanks alot for the summary. 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 Q: How do you spell "onomatopoeia"? A: The way it sounds.