From 74e7b3b8e8a08cdc1f3d60323433d143431e0fc0 Mon Sep 17 00:00:00 2001 From: batt Date: Sun, 28 Mar 2010 10:42:40 +0000 Subject: [PATCH] Refactor AT91SAM7 linker scripts. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3282 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/arm/scripts/at91sam7_128_ram.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_128_rom.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_256_ram.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_256_rom.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_512_ram.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_512_rom.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_64_ram.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_64_rom.ld | 93 +-------------- bertos/cpu/arm/scripts/at91sam7_ram.ld | 129 +++++++++++++++++++++ bertos/cpu/arm/scripts/at91sam7_rom.ld | 129 +++++++++++++++++++++ 10 files changed, 266 insertions(+), 736 deletions(-) create mode 100644 bertos/cpu/arm/scripts/at91sam7_ram.ld create mode 100644 bertos/cpu/arm/scripts/at91sam7_rom.ld diff --git a/bertos/cpu/arm/scripts/at91sam7_128_ram.ld b/bertos/cpu/arm/scripts/at91sam7_128_ram.ld index 971d901e..d7e6fab4 100644 --- a/bertos/cpu/arm/scripts/at91sam7_128_ram.ld +++ b/bertos/cpu/arm/scripts/at91sam7_128_ram.ld @@ -39,10 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) /* * Define memory configuration for AT91SAM7_128 family @@ -53,91 +49,4 @@ MEMORY ram(rwx) : org = 0x00200000, len = 64k } - -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > ram - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_ram.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_128_rom.ld b/bertos/cpu/arm/scripts/at91sam7_128_rom.ld index 65ee524a..8b41c7de 100644 --- a/bertos/cpu/arm/scripts/at91sam7_128_rom.ld +++ b/bertos/cpu/arm/scripts/at91sam7_128_rom.ld @@ -39,11 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) - /* * Define memory configuration for AT91SAM7_128 family */ @@ -54,90 +49,4 @@ MEMORY } -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > rom - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_rom.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_256_ram.ld b/bertos/cpu/arm/scripts/at91sam7_256_ram.ld index c570b971..0d8cbd25 100644 --- a/bertos/cpu/arm/scripts/at91sam7_256_ram.ld +++ b/bertos/cpu/arm/scripts/at91sam7_256_ram.ld @@ -39,11 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) - /* * Define memory configuration for AT91SAM7_256 family */ @@ -54,90 +49,4 @@ MEMORY } -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > ram - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_ram.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_256_rom.ld b/bertos/cpu/arm/scripts/at91sam7_256_rom.ld index 14a45435..031d64e1 100644 --- a/bertos/cpu/arm/scripts/at91sam7_256_rom.ld +++ b/bertos/cpu/arm/scripts/at91sam7_256_rom.ld @@ -39,10 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) /* * Define memory configuration for AT91SAM7_256 family @@ -53,91 +49,4 @@ MEMORY ram(rwx) : org = 0x00200000, len = 64k } - -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > rom - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "scripts/at91sam7_rom.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_512_ram.ld b/bertos/cpu/arm/scripts/at91sam7_512_ram.ld index 4c6d2cfd..3d230a82 100644 --- a/bertos/cpu/arm/scripts/at91sam7_512_ram.ld +++ b/bertos/cpu/arm/scripts/at91sam7_512_ram.ld @@ -39,11 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) - /* * Define memory configuration for AT91SAM7_512 family */ @@ -54,90 +49,4 @@ MEMORY } -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > ram - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_ram.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_512_rom.ld b/bertos/cpu/arm/scripts/at91sam7_512_rom.ld index 70bab584..92285864 100644 --- a/bertos/cpu/arm/scripts/at91sam7_512_rom.ld +++ b/bertos/cpu/arm/scripts/at91sam7_512_rom.ld @@ -39,11 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) - /* * Define memory configuration for AT91SAM7_512 family */ @@ -54,90 +49,4 @@ MEMORY } -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > rom - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_rom.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_64_ram.ld b/bertos/cpu/arm/scripts/at91sam7_64_ram.ld index 1d16f9fb..ad04e7cb 100644 --- a/bertos/cpu/arm/scripts/at91sam7_64_ram.ld +++ b/bertos/cpu/arm/scripts/at91sam7_64_ram.ld @@ -39,11 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) - /* * Define memory configuration for AT91SAM7_64 family */ @@ -54,90 +49,4 @@ MEMORY } -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > ram - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_ram.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_64_rom.ld b/bertos/cpu/arm/scripts/at91sam7_64_rom.ld index d0e1584d..fdf080c4 100644 --- a/bertos/cpu/arm/scripts/at91sam7_64_rom.ld +++ b/bertos/cpu/arm/scripts/at91sam7_64_rom.ld @@ -39,11 +39,6 @@ */ -ENTRY(_init) -SEARCH_DIR(.) -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) - /* * Define memory configuration for AT91SAM7_64 family */ @@ -54,90 +49,4 @@ MEMORY } -/* - * Define stack size here - */ -FIQ_STACK_SIZE = 0x0100; -IRQ_STACK_SIZE = 0x0400; -ABT_STACK_SIZE = 0x0100; -UND_STACK_SIZE = 0x0100; -SVC_STACK_SIZE = 0x1000; - -/* - * Allocate section memory - */ -SECTIONS -{ - .text : - { - KEEP(*(.vectors)); - . = ALIGN (4); - KEEP(*(.init)); - . = ALIGN (4); - *(.rodata .rodata.*); - . = ALIGN (4); - *(.text .text.*); - . = ALIGN (4); - *(.glue_7t); - . = ALIGN(4); - *(.glue_7); - . = ALIGN(4); - } > rom - - _etext = .; - PROVIDE (__etext = .); - - .data : AT (_etext) - { - PROVIDE (__data_start = .); - *(.data .data.*) - . = ALIGN (4); - _edata = .; - PROVIDE (__data_end = .); - } > ram - - .bss : - { - PROVIDE (__bss_start = .); - *(.bss .bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE (__bss_end = .); - } > ram - - /* - * Allocated stack at the end of bss section. - * Data heap is allocate at end of stack. - */ - PROVIDE (__stack_start = .); - - PROVIDE (__stack_fiq_start = .); - . += FIQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_fiq_end = .); - - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_irq_end = .); - - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_abt_end = .); - - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(8); - PROVIDE (__stack_und_end = .); - - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(4); - PROVIDE (__stack_svc_end = .); - - PROVIDE (__stack_end = .); - - PROVIDE (__heap_start = .); -} +INCLUDE "bertos/cpu/arm/scripts/at91sam7_rom.ld" diff --git a/bertos/cpu/arm/scripts/at91sam7_ram.ld b/bertos/cpu/arm/scripts/at91sam7_ram.ld new file mode 100644 index 00000000..1dfabd09 --- /dev/null +++ b/bertos/cpu/arm/scripts/at91sam7_ram.ld @@ -0,0 +1,129 @@ +/** + * \file + * + * + * \author Daniele Basile + * + * \brief Linker Script for Atmel AT91SAM7 family processors, RAM execution. + * + */ + +ENTRY(_init) +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) + +/* + * Define stack size here + */ +FIQ_STACK_SIZE = 0x0100; +IRQ_STACK_SIZE = 0x0400; +ABT_STACK_SIZE = 0x0100; +UND_STACK_SIZE = 0x0100; +SVC_STACK_SIZE = 0x1000; + +/* + * Allocate section memory + */ +SECTIONS +{ + .text : + { + KEEP(*(.vectors)); + . = ALIGN (4); + KEEP(*(.init)); + . = ALIGN (4); + *(.rodata .rodata.*); + . = ALIGN (4); + *(.text .text.*); + . = ALIGN (4); + *(.glue_7t); + . = ALIGN(4); + *(.glue_7); + . = ALIGN(4); + } > ram + + _etext = .; + PROVIDE (__etext = .); + + .data : AT (_etext) + { + PROVIDE (__data_start = .); + *(.data .data.*) + . = ALIGN (4); + _edata = .; + PROVIDE (__data_end = .); + } > ram + + .bss : + { + PROVIDE (__bss_start = .); + *(.bss .bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE (__bss_end = .); + } > ram + + /* + * Allocated stack at the end of bss section. + * Data heap is allocate at end of stack. + */ + PROVIDE (__stack_start = .); + + PROVIDE (__stack_fiq_start = .); + . += FIQ_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_fiq_end = .); + + PROVIDE (__stack_irq_start = .); + . += IRQ_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_irq_end = .); + + PROVIDE (__stack_abt_start = .); + . += ABT_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_abt_end = .); + + PROVIDE (__stack_und_start = .); + . += UND_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_und_end = .); + + PROVIDE (__stack_svc_start = .); + . += SVC_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_svc_end = .); + + PROVIDE (__stack_end = .); + + PROVIDE (__heap_start = .); +} diff --git a/bertos/cpu/arm/scripts/at91sam7_rom.ld b/bertos/cpu/arm/scripts/at91sam7_rom.ld new file mode 100644 index 00000000..3088e269 --- /dev/null +++ b/bertos/cpu/arm/scripts/at91sam7_rom.ld @@ -0,0 +1,129 @@ +/** + * \file + * + * + * \author Daniele Basile + * + * \brief Linker Script for Atmel AT91SAM7 family processors, ROM execution. + * + */ + +ENTRY(_init) +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) + +/* + * Define stack size here + */ +FIQ_STACK_SIZE = 0x0100; +IRQ_STACK_SIZE = 0x0400; +ABT_STACK_SIZE = 0x0100; +UND_STACK_SIZE = 0x0100; +SVC_STACK_SIZE = 0x1000; + +/* + * Allocate section memory + */ +SECTIONS +{ + .text : + { + KEEP(*(.vectors)); + . = ALIGN (4); + KEEP(*(.init)); + . = ALIGN (4); + *(.rodata .rodata.*); + . = ALIGN (4); + *(.text .text.*); + . = ALIGN (4); + *(.glue_7t); + . = ALIGN(4); + *(.glue_7); + . = ALIGN(4); + } > rom + + _etext = .; + PROVIDE (__etext = .); + + .data : AT (_etext) + { + PROVIDE (__data_start = .); + *(.data .data.*) + . = ALIGN (4); + _edata = .; + PROVIDE (__data_end = .); + } > ram + + .bss : + { + PROVIDE (__bss_start = .); + *(.bss .bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE (__bss_end = .); + } > ram + + /* + * Allocated stack at the end of bss section. + * Data heap is allocate at end of stack. + */ + PROVIDE (__stack_start = .); + + PROVIDE (__stack_fiq_start = .); + . += FIQ_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_fiq_end = .); + + PROVIDE (__stack_irq_start = .); + . += IRQ_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_irq_end = .); + + PROVIDE (__stack_abt_start = .); + . += ABT_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_abt_end = .); + + PROVIDE (__stack_und_start = .); + . += UND_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_und_end = .); + + PROVIDE (__stack_svc_start = .); + . += SVC_STACK_SIZE; + . = ALIGN(8); + PROVIDE (__stack_svc_end = .); + + PROVIDE (__stack_end = .); + + PROVIDE (__heap_start = .); +} -- 2.25.1