[U-Boot] [PATCH V2 1/2] [NEXT] arm: change relocation flag from -fPIC to -fPIE

2010-09-24 Thread Albert Aribaud
Replace GOT indirect addressing with more efficient pic-base
relative addressing for initialized data (uninitialized data
still use GOTi indirect addressing).  This also reduces code
size by 0.4% compared to -fPIC.

Signed-off-by: Albert Aribaud 
---
SUMMARY

This patch aims at optimizing relocatable code both in size and
speed. The first patch switches from '-fPIC' to '-fPIE', which makes
initialized data accesses pc-relative rather than GOT-indirect, and
the second adds '-msingle-pic-base' which factors out GOT addressing
by computing it once and for all.

PATCHSET HISTORY

V1  Initial submission
V2  Compute RAM pic base only if actually relocating
Fixed RAM pic base computation and copy loop

 arch/arm/config.mk |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 6923f6d..138c43a 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -35,7 +35,7 @@ endif
 
 ifndef CONFIG_SYS_ARM_WITHOUT_RELOC
 # needed for relocation
-PLATFORM_RELFLAGS += -fPIC
+PLATFORM_RELFLAGS += -fPIE
 endif
 
 ifdef CONFIG_SYS_ARM_WITHOUT_RELOC
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] [NEXT] arm: change relocation flag from -fPIC to -fPIE

2010-09-24 Thread Ben Gardiner
On Fri, Sep 24, 2010 at 12:59 PM, Albert Aribaud  wrote:
> Replace GOT indirect addressing with more efficient pic-base
> relative addressing for initialized data (uninitialized data
> still use GOTi indirect addressing).  This also reduces code
> size by 0.4% compared to -fPIC.
>
> Signed-off-by: Albert Aribaud 

Applies cleanly to 6aa3d3bfaa986f1aff5e21a9b9f68d087715b1a9 of u-boot/next.

Tested on da850evm.

Tested-by: Ben Gardiner 

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot