From ee8028b7f108bd049eb389f01b590be0b75adaf6 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 21 Nov 2010 20:55:42 +0100 Subject: ppc4xx: Cleanup for partial linking and --gc-sections This commit adapts 4xx boards for partial linking with --gc-sections. Signed-off-by: Stefan Roese Signed-off-by: Wolfgang Denk Cc: Stefan Roese Cc: Tirumala Marri Cc: David Updegraff Cc: Matthias Fuchs Cc: Dirk Eibach Cc: Larry Johnson Cc: Peter De Schrijver Cc: Niklaus Giger Cc: Daniel Poirot Acked-by: Stefan Roese --- board/amcc/canyonlands/Makefile | 6 +++-- board/amcc/canyonlands/u-boot-nand.lds | 48 +++++++--------------------------- 2 files changed, 13 insertions(+), 41 deletions(-) (limited to 'board/amcc/canyonlands') diff --git a/board/amcc/canyonlands/Makefile b/board/amcc/canyonlands/Makefile index c8ecaf9ff..4d87ea9a7 100644 --- a/board/amcc/canyonlands/Makefile +++ b/board/amcc/canyonlands/Makefile @@ -34,8 +34,10 @@ SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) SOBJS := $(addprefix $(obj),$(SOBJS)) -$(LIB): $(OBJS) $(SOBJS) - $(call cmd_link_o_target, $(OBJS) $(SOBJS)) +all: $(LIB) $(SOBJS) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $^) clean: rm -f $(SOBJS) $(OBJS) diff --git a/board/amcc/canyonlands/u-boot-nand.lds b/board/amcc/canyonlands/u-boot-nand.lds index c71f0b7c0..534d6ddf4 100644 --- a/board/amcc/canyonlands/u-boot-nand.lds +++ b/board/amcc/canyonlands/u-boot-nand.lds @@ -26,34 +26,13 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; - .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 : { /* WARNING - the following is hand-optimized to fit within */ /* the sector layout of our flash chips! XXX FIXME XXX */ arch/powerpc/cpu/ppc4xx/start.o (.text) + board/amcc/canyonlands/init.o (.text*) /* Align to next NAND block */ . = ALIGN(0x20000); @@ -61,8 +40,7 @@ SECTIONS /* Keep some space here for redundant env and potential bad env blocks */ . = ALIGN(0x80000); - *(.text) - *(.got1) + *(.text*) } _etext = .; PROVIDE (etext = .); @@ -70,9 +48,6 @@ SECTIONS { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } /* Read-write section, merged into data segment: */ . = (. + 0x00FF) & 0xFFFFFF00; @@ -80,23 +55,19 @@ SECTIONS PROVIDE (erotext = .); .reloc : { - *(.got) + KEEP(*(.got)) _GOT2_TABLE_ = .; - *(.got2) + KEEP(*(.got2)) _FIXUP_TABLE_ = .; - *(.fixup) + KEEP(*(.fixup)) } __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2; __fixup_entries = (. - _FIXUP_TABLE_)>>2; .data : { - *(.data) - *(.data1) - *(.sdata) - *(.sdata2) - *(.dynamic) - CONSTRUCTORS + *(.data*) + *(.sdata*) } _edata = .; PROVIDE (edata = .); @@ -122,9 +93,8 @@ SECTIONS __bss_start = .; .bss (NOLOAD) : { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) + *(.bss*) + *(.sbss*) *(COMMON) . = ALIGN(4); } -- cgit v1.2.3