U-Boot-V2: ARM: enable function cleanup by gcc
Subsystems (2)
Menon
PATCH 2/2 U-Boot-V2: ARM: enable function cleanup by gcc
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 <[email protected]>
arch/arm/Makefile +4 -0
@@ -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
include/asm-generic/u-boot.lds.h +10 -10
@@ -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))
Sascha Hauer
AppliedPATCH 2/2 U-Boot-V2: ARM: enable function cleanup by gcc
Quoted 5 lines · Nishanth
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 <[email protected]>
applied, thanks
Sascha
Signature · 4 lines
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/ <-