9
0
Fork 0

Linking: Remove linker scripts from (arm based-) boards and add

a generic linker script to arch/arm/lib/u-boot.lds.S.
	 If a board wants to overwrite a linker script it can do
	 so using CONFIG_BOARD_LINKER_SCRIPT.
	 There is no generic linker script for ppc and blackfin
	 yet, so still use the board specific one.
This commit is contained in:
sascha 2007-10-17 12:21:53 +02:00
parent b36fca0cb8
commit d59ca7feb3
14 changed files with 23 additions and 280 deletions

View File

@ -494,8 +494,8 @@ common-y := $(patsubst %/, %/built-in.o, $(common-y))
# System.map is generated to document addresses of all kernel symbols
uboot-common := $(common-y)
uboot-all := $(uboot-common)
uboot-lds := $(BOARD)/u-boot.lds
uboot-all := $(uboot-common)
uboot-lds := $(lds-y)
# Rule to link uboot
# May be overridden by arch/$(ARCH)/Makefile
@ -903,7 +903,7 @@ endif # CONFIG_MODULES
# Directories & files removed with 'make clean'
CLEAN_DIRS += $(MODVERDIR)
CLEAN_FILES += uboot System.map include/uboot_default_env.h \
.tmp_version .tmp_uboot* uboot.bin uboot.S $(uboot-lds) \
.tmp_version .tmp_uboot* uboot.bin uboot.S \
.tmp_kallsyms*
# Directories & files removed with 'make mrproper'

View File

@ -16,6 +16,15 @@ config BOARDINFO
config BOARDINFO
default "Phytec Phycore MX27" if MACH_PCM038
config BOARD_LINKER_SCRIPT
bool
default n
config GENERIC_LINKER_SCRIPT
bool
default y
depends on !BOARD_LINKER_SCRIPT
config ARM
bool
select HAS_KALLSYMS

View File

@ -77,4 +77,8 @@ endif
common-y += $(BOARD) $(MACH)
common-y += arch/arm/lib/ arch/arm/cpu/
lds-$(CONFIG_GENERIC_LINKER_SCRIPT) := arch/arm/lib/u-boot.lds
lds-$(CONFIG_BOARD_LINKER_SCRIPT) := $(BOARD)/u-boot.lds
CLEAN_FILES += arch/arm/lib/u-boot.lds
MRPROPER_FILES += include/asm-arm/arch include/asm-arm/proc

View File

@ -10,3 +10,5 @@ obj-y += _umodsi3.o
obj-y += _lshrdi3.o
obj-y += arm.o
obj-$(CONFIG_MODULES) += module.o
extra-$(CONFIG_GENERIC_LINKER_SCRIPT) += u-boot.lds

View File

@ -53,6 +53,8 @@ CPU :=
endif
common-y += $(BOARD)
common-y += arch/blackfin/lib/ $(CPU)
common-y += arch/blackfin/lib/ $(CPU)
lds-y += $(BOARD)/u-boot.lds
MRPROPER_FILES += include/asm-arm/arch include/asm-arm/proc

View File

@ -58,4 +58,6 @@ endif
common-y += $(BOARD) $(CPU)
common-y += arch/ppc/lib/
lds-y += $(BOARD)/u-boot.lds
MRPROPER_FILES += include/asm-ppc/arch

View File

@ -1,3 +1,2 @@
obj-y += eco920.o
extra-y += u-boot.lds

View File

@ -1,63 +0,0 @@
/*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@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
*/
#include <asm-generic/u-boot.lds.h>
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
*(.text_entry)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
__u_boot_initcalls_start = .;
.u_boot_initcalls : { INITCALLS }
__u_boot_initcalls_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -1,2 +1 @@
obj-y += netx.o
extra-y += u-boot.lds

View File

@ -1,65 +0,0 @@
/*
* (C) Copyright 2000-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
*
*/
#include <asm-generic/u-boot.lds.h>
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
_stext = .;
_text = .;
*(.text_entry)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { U_BOOT_CMDS }
__u_boot_cmd_end = .;
__u_boot_initcalls_start = .;
.u_boot_initcalls : { INITCALLS }
__u_boot_initcalls_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -1,5 +1,3 @@
obj-y += lowlevel_init.o
obj-y += pcm038.o
extra-y += u-boot.lds

View File

@ -1,71 +0,0 @@
/*
* (C) Copyright 2000-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
*
*/
#include <asm-generic/u-boot.lds.h>
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = TEXT_BASE;
. = ALIGN(4);
.text :
{
_stext = .;
_text = .;
*(.text_entry)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
_etext = .; /* End of text and rodata section */
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { U_BOOT_CMDS }
__u_boot_cmd_end = .;
__u_boot_initcalls_start = .;
.u_boot_initcalls : { INITCALLS }
__u_boot_initcalls_end = .;
__usymtab_start = .;
__usymtab : { U_BOOT_SYMS }
__usymtab_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -1,5 +1,3 @@
obj-y += lowlevel_init.o
obj-y += scb9328.o
extra-y += u-boot.lds

View File

@ -1,71 +0,0 @@
/*
* (C) Copyright 2000-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
*
*/
#include <asm-generic/u-boot.lds.h>
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = TEXT_BASE;
. = ALIGN(4);
.text :
{
_stext = .;
_text = .;
*(.text_entry)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
_etext = .; /* End of text and rodata section */
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { U_BOOT_CMDS }
__u_boot_cmd_end = .;
__u_boot_initcalls_start = .;
.u_boot_initcalls : { INITCALLS }
__u_boot_initcalls_end = .;
__usymtab_start = .;
__usymtab : { U_BOOT_SYMS }
__usymtab_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}