diff --git a/Makefile b/Makefile index b1dba18..1d4b5b1 100644 --- a/Makefile +++ b/Makefile @@ -494,8 +494,8 @@ # 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 @@ # 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' diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5392322..41f9fc8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -16,6 +16,15 @@ 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 diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f838d37..fb81d23 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -77,4 +77,8 @@ 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 diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 5c20745..9656ca8 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -10,3 +10,5 @@ obj-y += _lshrdi3.o obj-y += arm.o obj-$(CONFIG_MODULES) += module.o +extra-$(CONFIG_GENERIC_LINKER_SCRIPT) += u-boot.lds + diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index a3a1cf5..2ca75dc 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile @@ -53,6 +53,8 @@ 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 diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index c926636..3645a28 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -58,4 +58,6 @@ common-y += $(BOARD) $(CPU) common-y += arch/ppc/lib/ +lds-y += $(BOARD)/u-boot.lds + MRPROPER_FILES += include/asm-ppc/arch diff --git a/board/eco920/Makefile b/board/eco920/Makefile index 6526628..2cc70ca 100644 --- a/board/eco920/Makefile +++ b/board/eco920/Makefile @@ -1,3 +1,2 @@ obj-y += eco920.o -extra-y += u-boot.lds diff --git a/board/eco920/u-boot.lds.S b/board/eco920/u-boot.lds.S deleted file mode 100644 index 109aae3..0000000 --- a/board/eco920/u-boot.lds.S +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (C) Copyright 2002 - * Gary Jennejohn, DENX Software Engineering, - * - * 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 - -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 = .; -} diff --git a/board/netx/Makefile b/board/netx/Makefile index 33ad98d..c1d02f8 100644 --- a/board/netx/Makefile +++ b/board/netx/Makefile @@ -1,2 +1 @@ obj-y += netx.o -extra-y += u-boot.lds diff --git a/board/netx/u-boot.lds.S b/board/netx/u-boot.lds.S deleted file mode 100644 index 3641ca6..0000000 --- a/board/netx/u-boot.lds.S +++ /dev/null @@ -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 - -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 = .; -} diff --git a/board/phycore_pcm038/Makefile b/board/phycore_pcm038/Makefile index a382b3b..6082b2d 100644 --- a/board/phycore_pcm038/Makefile +++ b/board/phycore_pcm038/Makefile @@ -1,5 +1,3 @@ obj-y += lowlevel_init.o obj-y += pcm038.o - -extra-y += u-boot.lds diff --git a/board/phycore_pcm038/u-boot.lds.S b/board/phycore_pcm038/u-boot.lds.S deleted file mode 100644 index 1494a8e..0000000 --- a/board/phycore_pcm038/u-boot.lds.S +++ /dev/null @@ -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 - -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 = .; -} diff --git a/board/scb9328/Makefile b/board/scb9328/Makefile index 72dc0f5..db6fd7e 100644 --- a/board/scb9328/Makefile +++ b/board/scb9328/Makefile @@ -1,5 +1,3 @@ obj-y += lowlevel_init.o obj-y += scb9328.o - -extra-y += u-boot.lds diff --git a/board/scb9328/u-boot.lds.S b/board/scb9328/u-boot.lds.S deleted file mode 100644 index 1494a8e..0000000 --- a/board/scb9328/u-boot.lds.S +++ /dev/null @@ -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 - -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 = .; -}