[U-Boot] [PATCH 2/2] [NEXT] arm926ejs: reduce code size with -msingle-pic-base

Ben Gardiner bengardiner at nanometrics.ca
Wed Sep 22 20:05:36 CEST 2010


Bonjour Albert,

On Wed, Sep 22, 2010 at 9:57 AM, Albert Aribaud <albert.aribaud at free.fr> wrote:
> Add -msingle-pic-base to the relocation flags, and compute the pic base
> in start.S twice and for all -- once before relocation to run board_init_f,
> and once after relocation to run board_init_r and the rest of u-boot.
> This further reduces code size by 2.5% compared to -fPIE alone.
>
> Signed-off-by: Albert Aribaud <albert.aribaud at free.fr>

I tried tested this on da850evm -- the da850evm.h has "#undef
CONFIG_SYS_ARM_WITHOUT_RELOC /* This board is tested with relocation
support */".

I never got a boot-prompt. I tried mucking with the patch a little and
found that if I did:

diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index aa84706..f8ef90f 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -23,11 +23,6 @@

 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float

-ifndef CONFIG_SYS_ARM_WITHOUT_RELOC
-# needed for optimal relocation
-PLATFORM_RELFLAGS += -msingle-pic-base
-endif
-
 PLATFORM_CPPFLAGS += -march=armv5te
 # =========================================================================
 #

Then I do get a prompt.

The gcc version here is:
$arm-none-linux-gnueabi-gcc --version
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I have a JTAG debugger for this board. Please let me know if there are
register dumps or the like that I can get you.

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca


More information about the U-Boot mailing list