From: Joakim Tjernlund Date: Wed, 28 Nov 2018 09:59:55 +0000 (+0100) Subject: mpc83xx: Add support for -msingle-pic-base X-Git-Url: http://git.dujemihanovic.xyz/img/static/gitweb.css?a=commitdiff_plain;h=64d68dcdd7de3f8a20753a73a988835fafc3ce7c;p=u-boot.git mpc83xx: Add support for -msingle-pic-base -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 Reviewed-by: Mario Six Tested-by: Mario Six (on MPC8308) --- diff --git a/arch/powerpc/cpu/mpc83xx/config.mk b/arch/powerpc/cpu/mpc83xx/config.mk index 14870eec4d..a07df4d389 100644 --- a/arch/powerpc/cpu/mpc83xx/config.mk +++ b/arch/powerpc/cpu/mpc83xx/config.mk @@ -3,3 +3,4 @@ # Copyright 2004 Freescale Semiconductor, Inc. PLATFORM_CPPFLAGS += -DCONFIG_E300 -msoft-float +PLATFORM_RELFLAGS += -msingle-pic-base -fno-jump-tables diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index a3bacf138c..c00bb31363 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -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