mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 01:51:33 +00:00
85xx: Use gc-sections to reduce image size
On an XPedite5370 over 11KBytes were saved: Before: text data bss dec hex filename 332456 33364 33476 399296 617c0 ./u-boot After: text data bss dec hex filename 321075 33836 33476 388387 5ed23 ./u-boot Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
parent
68337fb5f6
commit
fbe53f59bd
2 changed files with 14 additions and 42 deletions
|
@ -25,6 +25,10 @@ PLATFORM_RELFLAGS += -fPIC -meabi
|
||||||
|
|
||||||
PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string
|
PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string
|
||||||
|
|
||||||
|
# Enable gc-sections to enable generation of smaller images.
|
||||||
|
PLATFORM_LDFLAGS += --gc-sections
|
||||||
|
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
|
||||||
|
|
||||||
# -mspe=yes is needed to have -mno-spe accepted by a buggy GCC;
|
# -mspe=yes is needed to have -mno-spe accepted by a buggy GCC;
|
||||||
# see "[PATCH,rs6000] make -mno-spe work as expected" on
|
# see "[PATCH,rs6000] make -mno-spe work as expected" on
|
||||||
# http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html
|
# http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OUTPUT_ARCH(powerpc)
|
OUTPUT_ARCH(powerpc)
|
||||||
/* Do we need any of these for elf?
|
|
||||||
__DYNAMIC = 0; */
|
|
||||||
PHDRS
|
PHDRS
|
||||||
{
|
{
|
||||||
text PT_LOAD;
|
text PT_LOAD;
|
||||||
|
@ -38,42 +37,16 @@ SECTIONS
|
||||||
/* Read-only sections, merged into text segment: */
|
/* Read-only sections, merged into text segment: */
|
||||||
. = + SIZEOF_HEADERS;
|
. = + SIZEOF_HEADERS;
|
||||||
.interp : { *(.interp) }
|
.interp : { *(.interp) }
|
||||||
.hash : { *(.hash) }
|
|
||||||
.dynsym : { *(.dynsym) }
|
|
||||||
.dynstr : { *(.dynstr) }
|
|
||||||
.rel.text : { *(.rel.text) }
|
|
||||||
.rela.text : { *(.rela.text) }
|
|
||||||
.rel.data : { *(.rel.data) }
|
|
||||||
.rela.data : { *(.rela.data) }
|
|
||||||
.rel.rodata : { *(.rel.rodata) }
|
|
||||||
.rela.rodata : { *(.rela.rodata) }
|
|
||||||
.rel.got : { *(.rel.got) }
|
|
||||||
.rela.got : { *(.rela.got) }
|
|
||||||
.rel.ctors : { *(.rel.ctors) }
|
|
||||||
.rela.ctors : { *(.rela.ctors) }
|
|
||||||
.rel.dtors : { *(.rel.dtors) }
|
|
||||||
.rela.dtors : { *(.rela.dtors) }
|
|
||||||
.rel.bss : { *(.rel.bss) }
|
|
||||||
.rela.bss : { *(.rela.bss) }
|
|
||||||
.rel.plt : { *(.rel.plt) }
|
|
||||||
.rela.plt : { *(.rela.plt) }
|
|
||||||
.init : { *(.init) }
|
|
||||||
.plt : { *(.plt) }
|
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
*(.text)
|
*(.text*)
|
||||||
*(.got1)
|
|
||||||
} :text
|
} :text
|
||||||
_etext = .;
|
_etext = .;
|
||||||
PROVIDE (etext = .);
|
PROVIDE (etext = .);
|
||||||
.rodata :
|
.rodata :
|
||||||
{
|
{
|
||||||
*(.eh_frame)
|
|
||||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
|
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
|
||||||
} :text
|
} :text
|
||||||
.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;
|
||||||
|
@ -81,23 +54,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 = .);
|
||||||
|
@ -126,7 +95,7 @@ SECTIONS
|
||||||
|
|
||||||
.resetvec RESET_VECTOR_ADDRESS :
|
.resetvec RESET_VECTOR_ADDRESS :
|
||||||
{
|
{
|
||||||
*(.resetvec)
|
KEEP(*(.resetvec))
|
||||||
} :text = 0xffff
|
} :text = 0xffff
|
||||||
|
|
||||||
. = RESET_VECTOR_ADDRESS + 0x4;
|
. = RESET_VECTOR_ADDRESS + 0x4;
|
||||||
|
@ -145,9 +114,8 @@ SECTIONS
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss (NOLOAD) :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
*(.sbss) *(.scommon)
|
*(.sbss*)
|
||||||
*(.dynbss)
|
*(.bss*)
|
||||||
*(.bss)
|
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
} :bss
|
} :bss
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue