summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Borleis <jbe@pengutronix.de>2016-05-27 11:32:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-30 07:07:48 +0200
commita23eb47bf2fe0b4f9ad480d61f1b0635b6f189f3 (patch)
tree18145688295a920bd1764ad38158f005754e14b9
parent0974830c3ec721cc3c5a8f1966e9ea32da13fcf9 (diff)
downloadbarebox-a23eb47bf2fe0b4f9ad480d61f1b0635b6f189f3.tar.gz
barebox-a23eb47bf2fe0b4f9ad480d61f1b0635b6f189f3.tar.xz
PPC: fix size optimisation
Since patch e92abad36307d the linker discards sections which seems not used to make the image smaller. But this change will discard the whole init and exception code from start.S which renders the final image useless. From 'barebox.map' without this patch: Discarded input sections .text 0x0000000000000000 0x358c arch/ppc/mach-mpc5xxx/start.o .data 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o .bss 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o .got2 0x0000000000000000 0x24 arch/ppc/mach-mpc5xxx/start.o [...] So, define the entry point to mark the init and exception used. From 'barebox.map' with this patch applied: Discarded input sections .data 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o .bss 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o [...] Note: tested on MPC5200 at run time, for MPC85XX compile time only Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/ppc/boards/pcm030/barebox.lds.S1
-rw-r--r--arch/ppc/mach-mpc85xx/barebox.lds.S1
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S
index 0e08e053f7..0e34f0a41b 100644
--- a/arch/ppc/boards/pcm030/barebox.lds.S
+++ b/arch/ppc/boards/pcm030/barebox.lds.S
@@ -20,6 +20,7 @@
#include <asm-generic/barebox.lds.h>
OUTPUT_ARCH("powerpc")
+ENTRY(_start)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
diff --git a/arch/ppc/mach-mpc85xx/barebox.lds.S b/arch/ppc/mach-mpc85xx/barebox.lds.S
index 1f7f52c39c..beebab39d6 100644
--- a/arch/ppc/mach-mpc85xx/barebox.lds.S
+++ b/arch/ppc/mach-mpc85xx/barebox.lds.S
@@ -22,6 +22,7 @@
#endif
OUTPUT_ARCH("powerpc")
+ENTRY(_start_e500)
PHDRS
{