Skip to content
Snippets Groups Projects
Commit 68337fb5 authored by Peter Tyser's avatar Peter Tyser Committed by Kumar Gala
Browse files

86xx: Use gc-sections to reduce image size


On an XPedite5170 over 11KBytes were saved:
  Before:
     text	   data	    bss	    dec	    hex	filename
   319488	  28700	  33204	 381392	  5d1d0	./u-boot

  After:
     text	   data	    bss	    dec	    hex	filename
   307663	  29144	  33204	 370011	  5a55b	./u-boot

Signed-off-by: default avatarPeter Tyser <ptyser@xes-inc.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent bd9715e3
No related branches found
No related tags found
No related merge requests found
...@@ -26,5 +26,9 @@ PLATFORM_RELFLAGS += -fPIC -meabi ...@@ -26,5 +26,9 @@ PLATFORM_RELFLAGS += -fPIC -meabi
PLATFORM_CPPFLAGS += -ffixed-r2 -mstring PLATFORM_CPPFLAGS += -ffixed-r2 -mstring
PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float
# Enable gc-sections to enable generation of smaller images.
PLATFORM_LDFLAGS += --gc-sections
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
# Use default linker script. Board port can override in board/*/config.mk # Use default linker script. Board port can override in board/*/config.mk
LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/mpc86xx/u-boot.lds LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/mpc86xx/u-boot.lds
...@@ -60,19 +60,14 @@ SECTIONS ...@@ -60,19 +60,14 @@ SECTIONS
lib/crc32.o (.text) lib/crc32.o (.text)
arch/powerpc/lib/extable.o (.text) arch/powerpc/lib/extable.o (.text)
lib/zlib.o (.text) lib/zlib.o (.text)
*(.text) *(.text*)
*(.got1)
} }
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
.rodata : .rodata :
{ {
*(.eh_frame)
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
} }
.fini : { *(.fini) } =0
.ctors : { *(.ctors) }
.dtors : { *(.dtors) }
/* Read-write section, merged into data segment: */ /* Read-write section, merged into data segment: */
. = (. + 0x00FF) & 0xFFFFFF00; . = (. + 0x00FF) & 0xFFFFFF00;
...@@ -80,23 +75,19 @@ SECTIONS ...@@ -80,23 +75,19 @@ SECTIONS
PROVIDE (erotext = .); PROVIDE (erotext = .);
.reloc : .reloc :
{ {
*(.got) KEEP(*(.got))
_GOT2_TABLE_ = .; _GOT2_TABLE_ = .;
*(.got2) KEEP(*(.got2))
_FIXUP_TABLE_ = .; _FIXUP_TABLE_ = .;
*(.fixup) KEEP(*(.fixup))
} }
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2; __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
__fixup_entries = (. - _FIXUP_TABLE_) >> 2; __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
.data : .data :
{ {
*(.data) *(.data*)
*(.data1) *(.sdata*)
*(.sdata)
*(.sdata2)
*(.dynamic)
CONSTRUCTORS
} }
_edata = .; _edata = .;
PROVIDE (edata = .); PROVIDE (edata = .);
...@@ -121,9 +112,8 @@ SECTIONS ...@@ -121,9 +112,8 @@ SECTIONS
__bss_start = .; __bss_start = .;
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
*(.sbss) *(.scommon) *(.sbss*)
*(.dynbss) *(.bss*)
*(.bss)
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment