Strip dead code on omap3 devices
Subsystems (2)
PATCH 1/1 Strip dead code on omap3 devices
Garbage collect code that isn't used.
Saves a good few kbytes.
Signed-off-by Charles Manning <[email protected]>
--- Makefile | 2 +- arch/arm/config.mk | 6 ++++++ arch/arm/cpu/armv7/u-boot.lds | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-)
Makefile +1 -1
@@ -368,7 +368,7 @@ $(obj)u-boot.dis: $(obj)u-boot GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ - cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \ + cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGSFINAL) $(LDFLAGS_$(@F))
$$UNDEF_SYM $(__OBJS) \
--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
-Map u-boot.map -o u-boot
$(obj)u-boot: depend \
arch/arm/config.mk +6 -0
@@ -67,3 +67,9 @@ LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds ifndef CONFIG_NAND_SPL LDFLAGS_u-boot += -pie endif + +# Dead code stripping +CFLAGS += -ffunction-sections +CFLAGS += -fdata-sections +LDFLAGS += --cref +LDFLAGSFINAL += --cref --gc-sections
arch/arm/cpu/armv7/u-boot.lds +3 -3
@@ -34,8 +34,8 @@ SECTIONS . = ALIGN(4); .text : { - arch/arm/cpu/armv7/start.o (.text) - *(.text) + KEEP(arch/arm/cpu/armv7/start.o (.text*)) + *(.text*) } . = ALIGN(4);
@@ -70,7 +70,7 @@ SECTIONS .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; - *(.bss) + *(.bss*) . = ALIGN(4); __bss_end__ = .; }
Signature · 1 line
1.7.1
PATCH 1/1 Strip dead code on omap3 devices
Quoted 3 lines · On Wednesday 20 April 2011 15:51:56 Charles Manning wrote:
Garbage collect code that isn't used.
Saves a good few kbytes.
Sorry folks. THis patch is broken.
I'll submit another.
Charles