From d8dc110fb113323f6def8bd5aeee650072a8a12c Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 16 Oct 2007 10:10:32 +0000 Subject: [PATCH] Put rodata in text section. Move stack out bss section. Typos. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@884 38d2e660-2303-0410-9eaa-f027e97ec537 --- cpu/arm/scripts/sam7s256_rom.ld | 104 ++++++++++++++++---------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/cpu/arm/scripts/sam7s256_rom.ld b/cpu/arm/scripts/sam7s256_rom.ld index 6dc69c75..15776ef1 100644 --- a/cpu/arm/scripts/sam7s256_rom.ld +++ b/cpu/arm/scripts/sam7s256_rom.ld @@ -84,6 +84,15 @@ SEARCH_DIR(.) OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) +/* + * Define memory configuration for AT91SAM7S + */ +MEMORY +{ + rom(rx) : org = 0x00000000, len = 256k + ram(rw) : org = 0x00200000, len = 64k +} + /* * Define stack size here @@ -94,15 +103,6 @@ ABT_STACK_SIZE = 0x0100; UND_STACK_SIZE = 0x0100; SVC_STACK_SIZE = 0x0400; -/* - * Define memory configuration for AT91SAM7S - */ -MEMORY -{ - rom(rx) : org = 0x00000000, len = 256k - ram(rw) : org = 0x00200000, len = 64k -} - /* * Allocate section memory */ @@ -110,29 +110,29 @@ SECTIONS { .text : { - * ( .vectors ); - . = ALIGN ( 4 ); - * ( .init ); - . = ALIGN ( 4 ); + * (.vectors); + . = ALIGN (4); + * (.init); + . = ALIGN (4); + * (.rodata); + . = ALIGN (4); + * (.rodata*); + . = ALIGN (4); } > rom - . = ALIGN ( 4 ); + . = ALIGN (4); _etext = .; - PROVIDE ( __etext = . ); + PROVIDE (__etext = .); - .data : AT ( __etext ) + .data : AT (__etext) { - PROVIDE ( __data_start = . ); - * ( .data ) - . = ALIGN ( 4 ); + PROVIDE (__data_start = .); + * (.data) + . = ALIGN (4); _edata = .; - PROVIDE ( __data_end = . ); - } - > ram + PROVIDE (__data_end = .); + } > ram -/* - * Allocate bss section and stack. - */ .bss : { PROVIDE (__bss_start = .); @@ -140,39 +140,41 @@ SECTIONS *(COMMON) . = ALIGN(4); PROVIDE (__bss_end = .); + } > ram - . = ALIGN(256); - - PROVIDE (__stack_start = .); +/* + * Allocate 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(4); - PROVIDE (__stack_fiq_end = .); + PROVIDE (__stack_fiq_start = .); + . += FIQ_STACK_SIZE; + . = ALIGN(4); + PROVIDE (__stack_fiq_end = .); - PROVIDE (__stack_irq_start = .); - . += IRQ_STACK_SIZE; - . = ALIGN(4); - PROVIDE (__stack_irq_end = .); + PROVIDE (__stack_irq_start = .); + . += IRQ_STACK_SIZE; + . = ALIGN(4); + PROVIDE (__stack_irq_end = .); - PROVIDE (__stack_abt_start = .); - . += ABT_STACK_SIZE; - . = ALIGN(4); - PROVIDE (__stack_abt_end = .); + PROVIDE (__stack_abt_start = .); + . += ABT_STACK_SIZE; + . = ALIGN(4); + PROVIDE (__stack_abt_end = .); - PROVIDE (__stack_und_start = .); - . += UND_STACK_SIZE; - . = ALIGN(4); - PROVIDE (__stack_und_end = .); + PROVIDE (__stack_und_start = .); + . += UND_STACK_SIZE; + . = ALIGN(4); + PROVIDE (__stack_und_end = .); - PROVIDE (__stack_svc_start = .); - . += SVC_STACK_SIZE; - . = ALIGN(4); - PROVIDE (__stack_svc_end = .); + PROVIDE (__stack_svc_start = .); + . += SVC_STACK_SIZE; + . = ALIGN(4); + PROVIDE (__stack_svc_end = .); - PROVIDE (__stack_end = .); + PROVIDE (__stack_end = .); - PROVIDE (__heap_start = .); - } > ram + PROVIDE (__heap_start = .); } -- 2.25.1