public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [Patch 2/2] U-Boot-V2: ARM: enable function cleanup by gcc
@ 2008-05-12 12:23 Menon, Nishanth
  2008-05-12 13:56 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Menon, Nishanth @ 2008-05-12 12:23 UTC (permalink / raw)
  To: u-boot

Does the following:
* Add cleanup flags which will allow gcc to delete function sections which are unused.
* mark the initcall sections and uboot cmds, symbols as being retained (else gcc will kill those too).

Signed-off-by: Nishanth Menon <x0nishan@ti.com>

Index: u-boot-v2.git/arch/arm/Makefile
===================================================================
--- u-boot-v2.git.orig/arch/arm/Makefile	2008-05-12 07:21:57.000000000 -0500
+++ u-boot-v2.git/arch/arm/Makefile	2008-05-12 07:22:19.000000000 -0500
@@ -23,6 +23,10 @@
 CFLAGS += -msoft-float -Os
 AFLAGS += -msoft-float -Os
 
+# Add cleanup flags
+CPPFLAGS += -fdata-sections -ffunction-sections
+LDFLAGS_uboot += -static --gc-sections
+
 ifeq ($(incdir-y),)
 incdir-y := $(machine-y)
 endif
Index: u-boot-v2.git/include/asm-generic/u-boot.lds.h
===================================================================
--- u-boot-v2.git.orig/include/asm-generic/u-boot.lds.h	2008-05-12 07:21:41.000000000 -0500
+++ u-boot-v2.git/include/asm-generic/u-boot.lds.h	2008-05-12 07:22:02.000000000 -0500
@@ -1,14 +1,14 @@
 
 #define INITCALLS			\
-  	*(.initcall.0)			\
-  	*(.initcall.1)			\
-  	*(.initcall.2)			\
-  	*(.initcall.3)			\
-  	*(.initcall.4)			\
-  	*(.initcall.5)			\
-  	*(.initcall.6)			\
-  	*(.initcall.7)
+  	KEEP(*(.initcall.0))			\
+  	KEEP(*(.initcall.1))			\
+  	KEEP(*(.initcall.2))			\
+  	KEEP(*(.initcall.3))			\
+  	KEEP(*(.initcall.4))			\
+  	KEEP(*(.initcall.5))			\
+  	KEEP(*(.initcall.6))			\
+  	KEEP(*(.initcall.7))
 
-#define U_BOOT_CMDS	*(SORT_BY_NAME(.u_boot_cmd*))
+#define U_BOOT_CMDS	KEEP(*(SORT_BY_NAME(.u_boot_cmd*)))
 
-#define U_BOOT_SYMS	*(__usymtab)
+#define U_BOOT_SYMS	KEEP(*(__usymtab))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] [Patch 2/2] U-Boot-V2: ARM: enable function cleanup by gcc
  2008-05-12 12:23 [U-Boot-Users] [Patch 2/2] U-Boot-V2: ARM: enable function cleanup by gcc Menon, Nishanth
@ 2008-05-12 13:56 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2008-05-12 13:56 UTC (permalink / raw)
  To: u-boot

On Mon, May 12, 2008 at 07:23:48AM -0500, Menon, Nishanth wrote:
> Does the following:
> * Add cleanup flags which will allow gcc to delete function sections which are unused.
> * mark the initcall sections and uboot cmds, symbols as being retained (else gcc will kill those too).
> 
> Signed-off-by: Nishanth Menon <x0nishan@ti.com>

applied, thanks

Sascha

-- 
Pengutronix e.K. - Linux Solutions for Science and Industry
-----------------------------------------------------------
Kontakt-Informationen finden Sie im Header dieser Mail oder
auf der Webseite -> http://www.pengutronix.de/impressum/ <-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-12 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12 12:23 [U-Boot-Users] [Patch 2/2] U-Boot-V2: ARM: enable function cleanup by gcc Menon, Nishanth
2008-05-12 13:56 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox