mpc85xx: Update linker scripts for Freescale boards

* Move to using absolute addressing always.  Makes the scripts a bit more
  portable and common
* Moved .bss after the end of the image.  These allows us to have more
  room in the resulting binary image for code and data.
* Removed .text object files that aren't really needed
* Make sure _end is 4-byte aligned as the .bss init code expects this.
  (Its possible that the end of .bss isn't 4-byte aligned)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
Kumar Gala 2008-07-30 14:13:30 -05:00 committed by Wolfgang Denk
parent 57c219ad5d
commit f0ff885ca6
7 changed files with 108 additions and 161 deletions

View File

@ -2,6 +2,8 @@
* (C) Copyright 2002,2003, Motorola,Inc.
* Xianghua Xiao, X.Xiao@motorola.com.
*
* Copyright 2008 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
@ -26,16 +28,6 @@ OUTPUT_ARCH(powerpc)
__DYNAMIC = 0; */
SECTIONS
{
.resetvec 0xFFFFFFFC :
{
*(.resetvec)
} = 0xffff
.bootpg 0xFFFFF000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -62,17 +54,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
cpu/mpc85xx/speed.o (.text)
cpu/mpc85xx/pci.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -134,6 +115,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -142,6 +135,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2004 Freescale Semiconductor.
* Copyright 2004, 2008 Freescale Semiconductor.
*
* See file CREDITS for list of people who contributed to this
* project.
@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc)
__DYNAMIC = 0; */
SECTIONS
{
.resetvec 0xFFFFFFFC :
{
*(.resetvec)
} = 0xffff
.bootpg 0xFFFFF000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -61,18 +51,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
drivers/net/tsec.o (.text)
cpu/mpc85xx/speed.o (.text)
cpu/mpc85xx/pci.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -134,6 +112,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -142,6 +132,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2007 Freescale Semiconductor, Inc.
* Copyright 2007-2008 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc)
__DYNAMIC = 0; */
SECTIONS
{
.resetvec 0xFFFFFFFC :
{
*(.resetvec)
} = 0xffff
.bootpg 0xFFFFF000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -61,17 +51,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
cpu/mpc85xx/speed.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
drivers/bios_emulator/atibios.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -133,6 +112,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -141,6 +132,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2004, 2007 Freescale Semiconductor.
* Copyright 2004, 2007-2008 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc)
__DYNAMIC = 0; */
SECTIONS
{
.resetvec 0xFFFFFFFC :
{
*(.resetvec)
} = 0xffff
.bootpg 0xFFFFF000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -61,17 +51,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
drivers/net/tsec.o (.text)
cpu/mpc85xx/speed.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -133,6 +112,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -141,6 +132,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2004 Freescale Semiconductor.
* Copyright 2004, 2008 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@ -25,16 +25,6 @@ OUTPUT_ARCH(powerpc)
__DYNAMIC = 0; */
SECTIONS
{
.resetvec 0xFFFFFFFC :
{
*(.resetvec)
} = 0xffff
.bootpg 0xFFFFF000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -61,18 +51,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
drivers/net/tsec.o (.text)
cpu/mpc85xx/speed.o (.text)
cpu/mpc85xx/pci.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -134,6 +112,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -142,6 +132,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,7 +1,9 @@
/*
* (C) Copyright 2002,2003,Motorola,Inc.
* (C) Copyright 2002,2003, Motorola,Inc.
* Xianghua Xiao, X.Xiao@motorola.com.
*
* Copyright 2008 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
@ -26,16 +28,6 @@ OUTPUT_ARCH(powerpc)
__DYNAMIC = 0; */
SECTIONS
{
.resetvec 0xFFFFFFFC :
{
*(.resetvec)
} = 0xffff
.bootpg 0xFFFFF000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -62,20 +54,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/commproc.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/serial_scc.o (.text)
cpu/mpc85xx/ether_fcc.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
cpu/mpc85xx/speed.o (.text)
cpu/mpc85xx/spd_sdram.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -137,6 +115,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -145,6 +135,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2004-2007 Freescale Semiconductor.
* Copyright 2004-2008 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@ -23,21 +23,8 @@
OUTPUT_ARCH(powerpc)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
{
/* ELIOR - From RAM: From FLASH: 0xFFFFFFFC*/
.resetvec 0xFFFFFFFC:
{
*(.resetvec)
} = 0xffff
/*(ELIOR - From RAM: From FLASH: 0xFFFFF000*/
.bootpg 0xFFFFF000:
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
/* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -64,17 +51,6 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
cpu/mpc85xx/start.o (.text)
cpu/mpc85xx/traps.o (.text)
cpu/mpc85xx/interrupts.o (.text)
cpu/mpc85xx/cpu_init.o (.text)
cpu/mpc85xx/cpu.o (.text)
cpu/mpc85xx/speed.o (.text)
cpu/mpc85xx/pci.o (.text)
common/dlmalloc.o (.text)
lib_generic/crc32.o (.text)
lib_ppc/extable.o (.text)
lib_generic/zlib.o (.text)
*(.text)
*(.fixup)
*(.got1)
@ -136,6 +112,18 @@ SECTIONS
. = ALIGN(256);
__init_end = .;
.bootpg ADDR(.text) + 0x7f000 :
{
cpu/mpc85xx/start.o (.bootpg)
} = 0xffff
.resetvec ADDR(.text) + 0x7fffc :
{
*(.resetvec)
} = 0xffff
. = ADDR(.text) + 0x80000;
__bss_start = .;
.bss (NOLOAD) :
{
@ -144,6 +132,8 @@ SECTIONS
*(.bss)
*(COMMON)
}
. = ALIGN(4);
_end = . ;
PROVIDE (end = .);
}