[U-Boot] [TESTING PATCH] ppc: Relocation test patch

Peter Tyser ptyser at xes-inc.com
Thu Sep 17 01:20:05 CEST 2009


On Mon, 2009-09-14 at 23:26 +0200, Wolfgang Denk wrote:
> Dear Peter Tyser,
> 
> In message <1252709159-22326-1-git-send-email-ptyser at xes-inc.com> you wrote:
> > ** This patch is only meant to allow others to test relocation, it
> > should not be applied!! **
> > 
> > This patch is a quick hack to enable proper relocation on powerpc
> > boards.  I tested on some mpc85xx-based boards.
> > 
> > I updated the common ppc config.mk and u-boot.lds in cpu/ as needed, but
> > didn't bother to update board-specific ones.  CONFIG_RELOC_FIXUP_WORKS
> > has also been hacked into common.h unconditionally.
> > 
> > So if you want to try out this patch, make sure that you
> > 1. Remove the *(.fixup) entry from the text section in your board's
> > linker script.
> > 
> > 2. Make sure your board's config.mk file includes:
> > PLATFORM_RELFLAGS += -mrelocatable
> > 
> > I'm hoping that relocation will work for all powerpc boards assuming you
> > use a semi-recent version.  I think at least gcc >= 3.4.6 (or maybe even
> > 3.4.5) should work.
> > 
> > It'd be great if people could give feedback if this patch works for
> > them, and if not, how their board breaks.
> 
> I have tested this patch on the following boards / tool chains:
> 
> 
> Tool Chain:	ELDK 3.1.1	ELDK 4.0	ELDK 4.2
> 		gcc-3.3.3	gcc-4.0.0	gcc-4.2.2
> Board:		binutils-2.14	binutils-2.16.1	binutils-2.17.50.0
> TQM834x		OK		OK		OK
> Canyonlands	NOK1		OK		OK
> MPC5121ADS	OK		OK		OK
> Haleakala	OK		OK		OK
> Ocotea		NOK1		OK		OK
> 
> NOK1: build error because old compiler does not accept "-m440" option

When preparing the ppc relocation patches I noticed that the gcc
-mrelocatable compiler flag increases the .reloc section by 3 or 4
Kbytes.  I did a compile test, and this increase pushes the ALPR board
back over 256K (it recently had the same size issue, see "ppc4xx: Remove
some features from ALPR to fit into 256k again").  No other boards
appear to break size-wise.

So I guess I had 2 questions:
1. Is enabling proper relocation worth the 3/4KB that will be added to
every ppc binary?  I personally think so as the manual relocation fixups
that currently litter the code can be removed and true relocation is
much less hokey in the long run.  X-ES's U-Boot binaries also are
generally much smaller than their allocated 512KB, so this increase
doesn't affect me much:)

2. Assuming we do want proper relocation, what should be done to
decrease the size of the ALPR binary?  Pieter had mentioned getting rid
of CONFIG_CMD_PCI was OK in a previous email thread.  Making this change
puts the ALPR binary at around 253KB.  I can roll this change in the
relocation fixup changeset if he is OK with it.

Thanks,
Peter



More information about the U-Boot mailing list