From: Kim Phillips Date: Mon, 16 Feb 2009 20:05:02 -0600 Subject: [U-Boot] [PATCH] Fix Freescale link scripts for newer GCCs In-Reply-To: References: <5ee96a840901071529q6eb7d7fblfeb8e3097305b2e0@mail.gmail.com> <20090121191124.92ec314a.kim.phillips@freescale.com> <20090131202328.0BD4083644C3@gemini.denx.de> Message-ID: <20090216200502.1e25c494.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 2 Feb 2009 20:11:56 -0800 (PST) Trent Piepho wrote: > On Sat, 31 Jan 2009, Wolfgang Denk wrote: > > In message you wrote: > > > > so, what's the status of this patch? I've seen this fail on 83xx. > > > > Most of these types of patches that fix the newer gcc's behaviour have > > > > been dropped, one of which even did sorting on name and alignment: > > > > > > > > http://www.mail-archive.com/u-boot at lists.denx.de/msg03193.html > > > > > > > > Do I need to make one for 83xx and apply it myself? > > > > > > Wolfgang rejected mine because he wanted a patch that fixed every single > > > board in one shot. I didn't feel like patching a hundred other linker > > > scripts I knew nothing about. > > > > Why not? If you know what you are doing (and I have strong resons to > > believe that you do) then I think your fix should be applied to all > > systems that are affected by the problem. > > 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: