5xxx: Cleanup for partial linking and --gc-sections

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
master
Wolfgang Denk 14 years ago
parent 566d49a3f5
commit 085ecde156
  1. 27
      arch/powerpc/cpu/mpc5xxx/Makefile
  2. 61
      arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds
  3. 57
      arch/powerpc/cpu/mpc5xxx/u-boot.lds
  4. 24
      board/manroland/hmi1001/config.mk
  5. 58
      board/matrix_vision/mvsmr/u-boot.lds
  6. 2
      include/configs/TQM5200.h
  7. 2
      include/configs/mcc200.h

@ -25,14 +25,25 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).o LIB = $(obj)lib$(CPU).o
START = start.o SSTART = start.o
SOBJS = io.o firmware_sc_task_bestcomm.impl.o CSTART = traps.o
COBJS = i2c.o traps.o cpu.o cpu_init.o ide.o interrupts.o \ SOBJS += io.o
loadtask.o pci_mpc5200.o serial.o speed.o usb_ohci.o usb.o SOBJS += firmware_sc_task_bestcomm.impl.o
COBJS-y += i2c.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) COBJS-y += cpu.o
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) COBJS-y += cpu_init.o
START := $(addprefix $(obj),$(START)) COBJS-y += ide.o
COBJS-y += interrupts.o
COBJS-y += loadtask.o
COBJS-y += pci_mpc5200.o
COBJS-y += serial.o
COBJS-y += speed.o
COBJS-$(CONFIG_CMD_USB) += usb_ohci.o
COBJS-$(CONFIG_CMD_USB) += usb.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
START := $(addprefix $(obj),$(SSTART) $(CSTART))
all: $(obj).depend $(START) $(LIB) all: $(obj).depend $(START) $(LIB)

@ -22,57 +22,25 @@
*/ */
OUTPUT_ARCH(powerpc) OUTPUT_ARCH(powerpc)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* 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 : .text :
{ {
/* WARNING - the following is hand-optimized to fit within */ /* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */ /* the sector layout of our flash chips! XXX FIXME XXX */
arch/powerpc/cpu/mpc5xxx/start.o (.text) arch/powerpc/cpu/mpc5xxx/start.o (.text*)
arch/powerpc/cpu/mpc5xxx/traps.o (.text) arch/powerpc/cpu/mpc5xxx/traps.o (.text*)
lib/crc32.o (.text)
arch/powerpc/lib/cache.o (.text)
arch/powerpc/lib/time.o (.text)
. = DEFINED(env_offset) ? env_offset : .; . = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o (.ppcenv) common/env_embedded.o (.ppcenv*)
*(.text) *(.text*)
*(.got1)
. = ALIGN(16); . = ALIGN(16);
*(.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: */
. = (. + 0x0FFF) & 0xFFFFF000; . = (. + 0x0FFF) & 0xFFFFF000;
@ -80,23 +48,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 = .);
@ -122,9 +86,8 @@ SECTIONS
__bss_start = .; __bss_start = .;
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
*(.sbss) *(.scommon) *(.bss*)
*(.dynbss) *(.sbss*)
*(.bss)
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
} }

@ -1,5 +1,5 @@
/* /*
* (C) Copyright 2003-2007 * (C) Copyright 2003-2010
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
* *
* See file CREDITS for list of people who contributed to this * See file CREDITS for list of people who contributed to this
@ -22,46 +22,18 @@
*/ */
OUTPUT_ARCH(powerpc) OUTPUT_ARCH(powerpc)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* 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 : .text :
{ {
arch/powerpc/cpu/mpc5xxx/start.o (.text) arch/powerpc/cpu/mpc5xxx/start.o (.text*)
*(.text) arch/powerpc/cpu/mpc5xxx/traps.o (.text*)
*(.got1) *(.text*)
. = ALIGN(16); . = ALIGN(16);
*(.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: */
. = (. + 0x0FFF) & 0xFFFFF000; . = (. + 0x0FFF) & 0xFFFFF000;
@ -69,23 +41,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 = .);
@ -111,10 +79,9 @@ SECTIONS
__bss_start = .; __bss_start = .;
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
*(.sbss) *(.scommon)
*(.dynbss)
*(.bss)
*(COMMON) *(COMMON)
*(.bss*)
*(.sbss*)
. = ALIGN(4); . = ALIGN(4);
} }
_end = . ; _end = . ;

@ -1,24 +0,0 @@
#
# (C) Copyright 2004
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds

@ -28,38 +28,13 @@ OUTPUT_ARCH(powerpc)
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* 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 : .text :
{ {
/* WARNING - the following is hand-optimized to fit within */ /* WARNING - the following is hand-optimized to fit within */
/* the first two sectors (=8KB) of our S29GL flash chip */ /* the first two sectors (=8KB) of our S29GL flash chip */
arch/powerpc/cpu/mpc5xxx/start.o (.text) arch/powerpc/cpu/mpc5xxx/start.o (.text*)
arch/powerpc/cpu/mpc5xxx/traps.o (.text) arch/powerpc/cpu/mpc5xxx/traps.o (.text*)
lib/crc32.o (.text) board/matrix_vision/common/libmatrix_vision.o (.text*)
arch/powerpc/lib/cache.o (.text)
arch/powerpc/lib/time.o (.text)
/* This is only needed to force failure if size of above code will ever */ /* This is only needed to force failure if size of above code will ever */
/* increase and grow into reserved space. */ /* increase and grow into reserved space. */
@ -69,15 +44,10 @@ SECTIONS
. = env_offset; /* ld error as soon as above ALIGN misplaces lc */ . = env_offset; /* ld error as soon as above ALIGN misplaces lc */
common/env_embedded.o (.ppcenv) common/env_embedded.o (.ppcenv)
*(.text) *(.text*)
*(.got1)
. = ALIGN(16); . = ALIGN(16);
*(.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: */
. = (. + 0x0FFF) & 0xFFFFF000; . = (. + 0x0FFF) & 0xFFFFF000;
@ -85,23 +55,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 = .);
@ -127,10 +93,8 @@ SECTIONS
__bss_start = .; __bss_start = .;
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
*(.sbss) *(.scommon) *(.bss*)
*(.dynbss) *(.sbss*)
*(.bss)
*(COMMON)
. = ALIGN(4); . = ALIGN(4);
} }
_end = . ; _end = . ;

@ -396,6 +396,7 @@
/* use CFI flash driver */ /* use CFI flash driver */
#define CONFIG_SYS_FLASH_CFI 1 /* Flash is CFI conformant */ #define CONFIG_SYS_FLASH_CFI 1 /* Flash is CFI conformant */
#define CONFIG_FLASH_CFI_DRIVER 1 /* Use the common driver */ #define CONFIG_FLASH_CFI_DRIVER 1 /* Use the common driver */
#define CONFIG_FLASH_CFI_MTD /* with MTD support */
#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_BOOTCS_START } #define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_BOOTCS_START }
#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of flash banks #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of flash banks
(= chip selects) */ (= chip selects) */
@ -417,7 +418,6 @@
/* Dynamic MTD partition support */ /* Dynamic MTD partition support */
#define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MTDPARTS
#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT "nor0=TQM5200-0" #define MTDIDS_DEFAULT "nor0=TQM5200-0"
#ifdef CONFIG_STK52XX #ifdef CONFIG_STK52XX

@ -121,7 +121,7 @@
#define CONFIG_CMD_USB #define CONFIG_CMD_USB
#undef CONFIG_CMD_NET #undef CONFIG_CMD_NET
#undef CONFIG_CMD_NFS
/* /*
* Autobooting * Autobooting

Loading…
Cancel
Save