mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Borleis <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] PPC: fix size optimisation
Date: Fri, 27 May 2016 11:32:48 +0200	[thread overview]
Message-ID: <1464341571-22552-2-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1464341571-22552-1-git-send-email-jbe@pengutronix.de>

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>
---
 arch/ppc/boards/pcm030/barebox.lds.S | 1 +
 arch/ppc/mach-mpc85xx/barebox.lds.S  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S
index 0e08e05..0e34f0a 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 1f7f52c..beebab3 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
 {
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-05-27  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27  9:32 Some fixes for MPC5200 platforms Juergen Borleis
2016-05-27  9:32 ` Juergen Borleis [this message]
2016-05-27  9:32 ` [PATCH 2/4] PPC: clean compiler warning Juergen Borleis
2016-05-27  9:32 ` [PATCH 3/4] PPC/MPC5XXX/reginfo: fix a bunch of compiler warnings Juergen Borleis
2016-05-27  9:32 ` [PATCH 4/4] PPC/MPC5200: enable a useful command by default Juergen Borleis
2016-05-30  5:08 ` Some fixes for MPC5200 platforms Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464341571-22552-2-git-send-email-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox