* [U-Boot] [PATCH] nios2: use gc sections to reduce image size
@ 2010-05-28 4:08 Thomas Chou
2010-05-28 9:27 ` [U-Boot] [Nios2-dev] " Ian Abbott
2010-06-16 1:17 ` [U-Boot] " Scott McNutt
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Chou @ 2010-05-28 4:08 UTC (permalink / raw)
To: u-boot
Follow the discussion of Charles Manning and Mike Frysinger.
Using gc_sections helps reduce image size.
Configuring for nios2-generic board...
Before,
text data bss dec hex filename
123979 3724 22892 150595 24c43 /tmp/u-boot/u-boot
After,
text data bss dec hex filename
115983 3800 22732 142515 22cb3 /tmp/u-boot/u-boot
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
arch/nios2/config.mk | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
index 793cc43..aba96b3 100644
--- a/arch/nios2/config.mk
+++ b/arch/nios2/config.mk
@@ -31,2 +31,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
+
+LDFLAGS += --gc-sections
+PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
--
1.7.1.86.g0e460
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [Nios2-dev] [PATCH] nios2: use gc sections to reduce image size
2010-05-28 4:08 [U-Boot] [PATCH] nios2: use gc sections to reduce image size Thomas Chou
@ 2010-05-28 9:27 ` Ian Abbott
2010-05-28 22:27 ` Thomas Chou
2010-06-16 1:17 ` [U-Boot] " Scott McNutt
1 sibling, 1 reply; 6+ messages in thread
From: Ian Abbott @ 2010-05-28 9:27 UTC (permalink / raw)
To: u-boot
On 28/05/2010 05:08, Thomas Chou wrote:
> Follow the discussion of Charles Manning and Mike Frysinger.
> Using gc_sections helps reduce image size.
>
> Configuring for nios2-generic board...
> Before,
> text data bss dec hex filename
> 123979 3724 22892 150595 24c43 /tmp/u-boot/u-boot
> After,
> text data bss dec hex filename
> 115983 3800 22732 142515 22cb3 /tmp/u-boot/u-boot
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> arch/nios2/config.mk | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
> index 793cc43..aba96b3 100644
> --- a/arch/nios2/config.mk
> +++ b/arch/nios2/config.mk
> @@ -31,2 +31,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
>
> LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
> +
> +LDFLAGS += --gc-sections
> +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
Hi Thomas,
Will that stop it working with the gcc3-based nios2 nommu toolchain?
The version of 'ld' in that toolchain doesn't support the --gc-sections
option.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [Nios2-dev] [PATCH] nios2: use gc sections to reduce image size
2010-05-28 9:27 ` [U-Boot] [Nios2-dev] " Ian Abbott
@ 2010-05-28 22:27 ` Thomas Chou
2010-05-28 22:58 ` Scott McNutt
2010-06-01 9:12 ` Ian Abbott
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Chou @ 2010-05-28 22:27 UTC (permalink / raw)
To: u-boot
Ian Abbott wrote:
> On 28/05/2010 05:08, Thomas Chou wrote:
>> Follow the discussion of Charles Manning and Mike Frysinger.
>> Using gc_sections helps reduce image size.
> Hi Thomas,
>
> Will that stop it working with the gcc3-based nios2 nommu toolchain?
> The version of 'ld' in that toolchain doesn't support the --gc-sections
> option.
>
Hi Ian,
I have tested with the gcc3-based nios2 nommu toolchain and gc-sections
works.
The error that we met when building busybox might be caused by the
elf2flt process. There is no such problem generating elf.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [Nios2-dev] [PATCH] nios2: use gc sections to reduce image size
2010-05-28 22:27 ` Thomas Chou
@ 2010-05-28 22:58 ` Scott McNutt
2010-06-01 9:12 ` Ian Abbott
1 sibling, 0 replies; 6+ messages in thread
From: Scott McNutt @ 2010-05-28 22:58 UTC (permalink / raw)
To: u-boot
> Ian Abbott wrote:
>> On 28/05/2010 05:08, Thomas Chou wrote:
>>> Follow the discussion of Charles Manning and Mike Frysinger.
>>> Using gc_sections helps reduce image size.
>> Hi Thomas,
>>
>> Will that stop it working with the gcc3-based nios2 nommu toolchain?
>> The version of 'ld' in that toolchain doesn't support the --gc-sections
>> option.
>>
> I have tested with the gcc3-based nios2 nommu toolchain and gc-sections
> works.
Same here -- no problems.
--Scott
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [Nios2-dev] [PATCH] nios2: use gc sections to reduce image size
2010-05-28 22:27 ` Thomas Chou
2010-05-28 22:58 ` Scott McNutt
@ 2010-06-01 9:12 ` Ian Abbott
1 sibling, 0 replies; 6+ messages in thread
From: Ian Abbott @ 2010-06-01 9:12 UTC (permalink / raw)
To: u-boot
On 28/05/10 23:27, Thomas Chou wrote:
> Ian Abbott wrote:
>> On 28/05/2010 05:08, Thomas Chou wrote:
>>> Follow the discussion of Charles Manning and Mike Frysinger.
>>> Using gc_sections helps reduce image size.
>> Hi Thomas,
>>
>> Will that stop it working with the gcc3-based nios2 nommu toolchain?
>> The version of 'ld' in that toolchain doesn't support the --gc-sections
>> option.
>>
>
> Hi Ian,
>
> I have tested with the gcc3-based nios2 nommu toolchain and gc-sections
> works.
>
> The error that we met when building busybox might be caused by the
> elf2flt process. There is no such problem generating elf.
Hi Thomas,
That was probably it then. I *knew* we had some problem building
BusyBox with --gc-sections!
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] nios2: use gc sections to reduce image size
2010-05-28 4:08 [U-Boot] [PATCH] nios2: use gc sections to reduce image size Thomas Chou
2010-05-28 9:27 ` [U-Boot] [Nios2-dev] " Ian Abbott
@ 2010-06-16 1:17 ` Scott McNutt
1 sibling, 0 replies; 6+ messages in thread
From: Scott McNutt @ 2010-06-16 1:17 UTC (permalink / raw)
To: u-boot
Applied to: git://git.denx.de/u-boot-nios.git next
Thanks,
--Scott
Thomas Chou wrote:
> Follow the discussion of Charles Manning and Mike Frysinger.
> Using gc_sections helps reduce image size.
>
> Configuring for nios2-generic board...
> Before,
> text data bss dec hex filename
> 123979 3724 22892 150595 24c43 /tmp/u-boot/u-boot
> After,
> text data bss dec hex filename
> 115983 3800 22732 142515 22cb3 /tmp/u-boot/u-boot
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> arch/nios2/config.mk | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
> index 793cc43..aba96b3 100644
> --- a/arch/nios2/config.mk
> +++ b/arch/nios2/config.mk
> @@ -31,2 +31,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
>
> LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
> +
> +LDFLAGS += --gc-sections
> +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-06-16 1:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28 4:08 [U-Boot] [PATCH] nios2: use gc sections to reduce image size Thomas Chou
2010-05-28 9:27 ` [U-Boot] [Nios2-dev] " Ian Abbott
2010-05-28 22:27 ` Thomas Chou
2010-05-28 22:58 ` Scott McNutt
2010-06-01 9:12 ` Ian Abbott
2010-06-16 1:17 ` [U-Boot] " Scott McNutt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox