]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mpc83xx: Add support for -msingle-pic-base
authorJoakim Tjernlund <joakim.tjernlund@infinera.com>
Wed, 28 Nov 2018 09:59:55 +0000 (10:59 +0100)
committerMario Six <mario.six@gdsys.cc>
Mon, 21 Jan 2019 07:33:42 +0000 (08:33 +0100)
-msingle-pic-base is a new gcc(from 4.6) option for ppc and
it reduces the size of my u-boot with about 4 KB.
While at it, add -fno-jump-tables too to save a
few more bytes.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
Tested-by: Mario Six <mario.six@gdsys.cc> (on MPC8308)
arch/powerpc/cpu/mpc83xx/config.mk
arch/powerpc/cpu/mpc83xx/start.S

index 14870eec4dd574f6f0eeceae6f0a1cf206f196ab..a07df4d3896a7691c54b9e7b57d280cf0abd2179 100644 (file)
@@ -3,3 +3,4 @@
 # Copyright 2004 Freescale Semiconductor, Inc.
 
 PLATFORM_CPPFLAGS += -DCONFIG_E300 -msoft-float
+PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables
index a3bacf138c2b9c889d0bbcd05335023542d69285..c00bb3136374c95d5d29168693ffe9f39ffb9528 100644 (file)
@@ -288,6 +288,9 @@ in_flash:
        /*------------------------------------------------------*/
 
        GET_GOT                 /* initialize GOT access        */
+       /* Needed for -msingle-pic-base */
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r30
 
        /* r3: IMMR */
        lis     r3, CONFIG_SYS_IMMR@h