From e60a2810f6c237e1c78c2916c3ea232cfcd4c8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 8 Aug 2009 16:02:34 +0000 Subject: [PATCH] [ARM] Include board-specific file from the u-boot ldscript, to allow linking to different load addresses. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32207 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/Jamfile | 7 ++++++- src/system/ldscripts/arm/board/overo/board.ld | 6 ++++++ src/system/ldscripts/arm/board/verdex/board.ld | 6 ++++++ src/system/ldscripts/arm/boot_loader_u-boot.ld | 6 ++++-- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 src/system/ldscripts/arm/board/overo/board.ld create mode 100644 src/system/ldscripts/arm/board/verdex/board.ld diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile index 33551f77b6..7cd9903e8f 100644 --- a/src/system/boot/Jamfile +++ b/src/system/boot/Jamfile @@ -22,6 +22,11 @@ local librootFunctions = strtol.o ; +local extraLinkerArgs = ; +if $(TARGET_BOOT_BOARD) { + extraLinkerArgs += -L$(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/board/$(TARGET_BOOT_BOARD) ; +} + AddResources haiku_loader : boot_loader.rdef ; KernelLd boot_loader_$(TARGET_BOOT_PLATFORM) : @@ -45,7 +50,7 @@ KernelLd boot_loader_$(TARGET_BOOT_PLATFORM) : $(librootFunctions:G=src!system!kernel!lib) : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld - : -Bstatic + : -Bstatic $(extraLinkerArgs) ; rule BuildCoffLoader { diff --git a/src/system/ldscripts/arm/board/overo/board.ld b/src/system/ldscripts/arm/board/overo/board.ld new file mode 100644 index 0000000000..b8078f8c0b --- /dev/null +++ b/src/system/ldscripts/arm/board/overo/board.ld @@ -0,0 +1,6 @@ +/* + * Gumstix Overo ld definitions + */ + +BOARD_LOADER_BASE = 0x80008000 ; +#error diff --git a/src/system/ldscripts/arm/board/verdex/board.ld b/src/system/ldscripts/arm/board/verdex/board.ld new file mode 100644 index 0000000000..2bc99ae81a --- /dev/null +++ b/src/system/ldscripts/arm/board/verdex/board.ld @@ -0,0 +1,6 @@ +/* + * Gumstix Verdex ld definitions + */ + +BOARD_LOADER_BASE = 0xa2000000 ; + diff --git a/src/system/ldscripts/arm/boot_loader_u-boot.ld b/src/system/ldscripts/arm/boot_loader_u-boot.ld index 8d90215c34..aa8bcaa767 100644 --- a/src/system/ldscripts/arm/boot_loader_u-boot.ld +++ b/src/system/ldscripts/arm/boot_loader_u-boot.ld @@ -1,11 +1,13 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) +/* include board-specific definitions */ +INCLUDE board.ld + ENTRY(_start) SECTIONS { -/* . = 0x80008000; */ - . = 0xa2000000; + . = BOARD_LOADER_BASE; /* text/read-only data */ .text : { *(.text .gnu.linkonce.t.*) }