From: Wolfgang Denk Date: Wed, 18 Feb 2009 01:04:48 +0100 Subject: [U-Boot] [PATCH] Fix Freescale link scripts for newer GCCs In-Reply-To: <20090216200502.1e25c494.kim.phillips@freescale.com> References: <5ee96a840901071529q6eb7d7fblfeb8e3097305b2e0@mail.gmail.com> <20090121191124.92ec314a.kim.phillips@freescale.com> <20090131202328.0BD4083644C3@gemini.denx.de> <20090216200502.1e25c494.kim.phillips@freescale.com> Message-ID: <20090218000448.9F5D0832E893@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 Kim, In message <20090216200502.1e25c494.kim.phillips@freescale.com> you wrote: > > Trent Piepho wrote: ... > > But what systems are affected by the problem? For instance ms7750se only > > has ".rodata", not even ".rodata.str1.4". So should it get changed too? > > > > There are CPUs that have a special segment for byte aligned data. Does > > u-boot support any of these CPUs? I don't know. But changing ".rodata" to > > ".rodata*" could break a system if ".rodata1" was supposed to be picked up > > by a ".*data*1" somewhere else in the linker script. It seems like people > > who know the platform would be less likely to get caught by this. > > > > Or take something like mpc8220, which has this for a text segment: > > *(.text) > > *(.fixup) > > *(.got1) > > . = ALIGN(16); > > *(.rodata) > > *(.rodata1) > > *(.rodata.str1.4) > > *(.eh_frame) > > > > Why is the start of rodata aligned to 16 bytes? I'd guess some sort of I/D > > cache issue. Though aren't fixup and got1 data, not code? I can't > > find any docs on what the differences between fixup, got, got1, and got2 > > are. It seems like current gcc only uses got2. The mpc8220 ld script also > > lists fixup a second time, in the reloc section, a mistake that probably > > doesn't break anything since I think gcc hasn't used fixup in some time. > > > > Anyway, not knowing if it's ok to delete fixup and got1, I would change > > this to: > > *(.text) > > *(.fixup) > > *(.got1) > > . = ALIGN(16); > > *(.eh_frame) > > *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) > > > > eh_frame should go before rodata* since it has has a larger alignment, but > > now rodata isn't 16 byte aligned like it was before. Does that matter? I > > doubt it, but I don't know for sure. > > > > WD, do you have a response to the above? Otherwise, I'll put this > in my queue: Please don't. I really want to see this fixed for ALL affected boards, not only for a small subset so everbody forgets it again and we run into it later again and again. Trent - you have obviously already spend a lot of effort into analyzing this code - most probably more time than any other of us. Based on your experience and the effort you already spent I think it would be best if you could provided a patch to fix all boards. Thanks in advance. 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 "'Tis true, 'tis pity, and pity 'tis 'tis true." - Poloniouius, in Willie the Shake's _Hamlet, Prince of Darkness_