/*============================================================================ * LinkerScript for AT91SAM7S256 to test EVBmmTm Propox Board *============================================================================ * * The Linker Script defines how the code and data emitted by the * GNU C compiler and assembler are to be loaded into memory (code goes * into RAM, variables go into RAM). * Any symbols defined in the Linker Script are automatically global and * available to the rest of the program. * * To force the linker to use this LINKER SCRIPT, just add the * -T EVBmmTm_SAM7S256_RAM.cmd directive to the linker flags in the makefile. * For example, * LFLAGS = -Map main.map -T EVBmmTm_SAM7S256_RAM.cmd * * The order that the object files are listed in the makefile determines * what .text section is placed first. * * For example: $(LD) $(LFLAGS) -o main.out $(OBJECTS) * cstartup.o is first in the list of objects, so it will be * placed at address 0x00000000 * * The top of the stack (_stack_end) is (last_byte_of_ram +1) - 4 * * Therefore: _stack_end = (0x0020FFFF + 1) - 4 = 0x00210000 - 4 = 0x0020FFFC * * Note that this symbol (_stack_end) is automatically GLOBAL and will be * used by the cstartup.s startup assembler routine to specify all stacks * for the various ARM modes * * MEMORY MAP * | |0x00210000 <---------- _stack_end * ------->|-------------------------------|0x0021FFFF * | | * | UDF Stack -> 32 bytes | * | | * |-------------------------------|0x0020FFE0 * | | * | ABT Stack -> 32 bytes | * | | * |-------------------------------|0x0020FFC0 * | | * | FIQ Stack -> 128 bytes | * | | * |-------------------------------|0x0020FF40 * | | * | IRQ Stack -> 128 bytes | * | | * |-------------------------------|0x0020FEC0 * | | * | SVC Stack -> 128 bytes | * | | * |-------------------------------|0x0020FE40 * | | * | stack area for system/user | * | | * | | * | free ram | * ram | | * | | * |.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.|0x0020XXXX <-------- _ebss * | | * | .bss uninitialized variables | * | | * |.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.|0x0020XXXX <-------- _sbss * | | _edata * | | * | .data initialized variables | * | | _sdata * |.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.|0x0020XXXX <-------- _etext * | | * | | * | C code | * | | * | | * |-------------------------------|0x00000XXX main() * | | * | Startup Code (cstartup.s) | * | (assembler) | * | | * |-------------------------------|0x00000020 * | FIQ and IRQ Code | * | | * |-------------------------------|0x00000020 * | | * | Interrupt Vector Table | * | 32 bytes | * ------->|-------------------------------|0x00000000 _vec_reset * * Author: Heiko Suesens Dec. 22, 2007 *============================================================================*/ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) /* identify the Entry Point (_reset_handler is defined in file cstartup.s) */ ENTRY(_reset_handler) /* define the output sections */ SECTIONS { .text : /* collect all sections that should go into SRAM after startup */ { _stext = .; /* define a global symbol _stext just at the begin of code */ *(.vectors) /* interrupt vectors at start */ *(.text) /* all .text sections (code) */ *(.rodata) /* all .rodata sections (constants, strings, etc.) */ *(.rodata*) /* all .rodata* sections (constants, strings, etc.) */ . = ALIGN(4); /* align section on 32-bit boundary */ _etext = .; /* define a global symbol _etext just after the last code byte */ } .data : AT ( ADDR (.text) + SIZEOF (.text) ) /* collect all initialized .data sections that go into RAM */ { _sdata = .; /* create a global symbol marking the start of the .data section */ *(.data) /* all .data sections */ *(.ramfunc) /* all .ramfunc sections */ _edata = .; /* define a global symbol marking the end of the .data section */ } .bss (NOLOAD) : { /* collect all uninitialized .bss sections that go into FLASH */ . = ALIGN(4); /* align section on 32-bit boundary */ _sbss = .; /* define a global symbol marking the start of the .bss section */ *(.bss) _ebss = .; /* define a global symbol marking the end of the .bss section */ } } end = .; /* define a global symbol marking the end of application */ **************************************************************************************************** Cross Reference Table Symbol File AT91F_Dabt_handler cpu_init.o cstartup_flash.o AT91F_Default_FIQ_handler cpu_init.o AT91F_Default_IRQ_handler cpu_init.o AT91F_Pabt_handler cpu_init.o cstartup_flash.o AT91F_Software_Int_handler cpu_init.o cstartup_flash.o AT91F_Spurious_handler cpu_init.o cstartup_flash.o FIQCount main.o cstartup_flash.o Flag_ptr main.o glcd_unit.o uart_unit.o pio_unit.o flash_unit.o spi_unit.o pit_unit.o cpu_init.o SER_OUTPUT_Flags uart_unit.o pit_unit.o SPI_Flags flash_unit.o spi_unit.o SPI_RxBuffer flash_unit.o spi_unit.o SPI_RxHead flash_unit.o spi_unit.o SPI_RxTail flash_unit.o spi_unit.o SPI_TxBuffer flash_unit.o spi_unit.o SPI_TxHead flash_unit.o spi_unit.o SPI_TxTail flash_unit.o spi_unit.o TODO_Flags main.o uart_unit.o pio_unit.o pit_unit.o UART0_RxBuffer uart_unit.o UART0_RxHead uart_unit.o UART0_RxTail uart_unit.o UART0_TxBuffer uart_unit.o UART0_TxHead uart_unit.o UART0_TxTail uart_unit.o _ebss cstartup_flash.o _edata cstartup_flash.o _etext cstartup_flash.o _reset_handler cstartup_flash.o _sbss cstartup_flash.o _sdata cstartup_flash.o cpu_init cpu_init.o cstartup_flash.o flash_Buffer1_Read flash_unit.o flash_ContinousArrayRead flash_unit.o flash_buffer flash_unit.o flash_buffer_size flash_unit.o flash_cmd_read_buffer1 flash_unit.o flash_cmd_read_buffer1_size flash_unit.o flash_cmd_read_buffer2 flash_unit.o flash_cmd_read_buffer2_size flash_unit.o flash_cmd_read_id flash_unit.o flash_cmd_read_id_size flash_unit.o flash_cmd_read_status flash_unit.o flash_cmd_read_status_size flash_unit.o flash_init flash_unit.o main.o flash_read_id flash_unit.o flash_ready flash_unit.o glcd_busy glcd_unit.o glcd_clear_screen glcd_unit.o main.o glcd_init glcd_unit.o main.o glcd_pos_counter main.o glcd_unit.o glcd_print_char glcd_unit.o glcd_print_string glcd_unit.o main.o glcd_set_position glcd_unit.o glcd_strobe glcd_unit.o glcd_write_command glcd_unit.o glcd_write_databyte glcd_unit.o main main.o cstartup_flash.o msec_counter main.o pit_unit.o pdc_flash_Buffer1_Read flash_unit.o main.o pdc_flash_Buffer1_Write flash_unit.o pdc_flash_Buffer2_Read flash_unit.o pdc_flash_read_id flash_unit.o main.o pdc_flash_read_status flash_unit.o pdc_spi_cmd_read spi_unit.o flash_unit.o pdc_spi_cmd_write spi_unit.o pdc_spi_read_buffer spi_unit.o flash_unit.o pdc_start_RxTx spi_unit.o pio_init pio_unit.o main.o pioa_irq_handler pio_unit.o pit_init pit_unit.o main.o pit_irq_handler pit_unit.o spi_init spi_unit.o flash_unit.o spi_irq_handler spi_unit.o spi_put_int_2_buffer spi_unit.o flash_unit.o spi_start_tx spi_unit.o flash_unit.o strlen d:/programme/atmel/arm/programme/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libc.a(lib_a-strlen.o) uart_unit.o tmp_counter main.o uart0_irq_handler uart_unit.o uart_get_string uart_unit.o uart_init uart_unit.o main.o uart_print_buffer uart_unit.o main.o cpu_init.o uart_print_mem uart_unit.o uart_print_reg uart_unit.o uart_print_string uart_unit.o uart_put_char_2_buffer uart_unit.o ********************************************************************************************************** **** Build of configuration Default for project EVBmmTm_Propox **** make all Heiko Suesens -> compile cstartup_flash arm-elf-gcc -g -mcpu=arm7tdmi -D__ASSEMBLY__ -DAT91SAM7S256 -c -O0 -Wall -I./ -Wa,-adhlns=cstartup_flash.lst,--gdwarf-2 cstartup_flash.S -o cstartup_flash.o Compiliert für SAM7S256, Memory_End = 0x00210000 Compiliert für SAM7S256 FLASH = 0x00100000 Heiko Suesens -> compile cpu_init arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 cpu_init.c -o cpu_init.o Heiko Suesens -> compile pit_unit arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 pit_unit.c -o pit_unit.o Heiko Suesens -> compile spi_unit arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 spi_unit.c -o spi_unit.o Heiko Suesens -> compile flash_unit include flash_buffer arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 -DINCLUDE_FLASH_BUFFER flash_unit.c -o flash_unit.o Heiko Suesens -> compile pio_unit arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 pio_unit.c -o pio_unit.o Heiko Suesens -> compile uart_unit arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 uart_unit.c -o uart_unit.o Heiko Suesens -> compile glcd_unit arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 glcd_unit.c -o glcd_unit.o Heiko Suesens -> compile main arm-elf-gcc -c -g -mcpu=arm7tdmi -O0 -Wall -I./ -DAT91SAM7S256 main.c -o main.o arm-elf-gcc -nostartfiles -Wl,--cref -lc -lgcc -TEVBmmTm_SAM7S256_RAM.cmd -Ttext 0x00100000 -Wl,--section-start,Flash_Buffer_Section=0x0013A000 -Tdata 0x0020B000 -n -o evbmmtm_sam7S256_flash.elf cstartup_flash.o cpu_init.o pit_unit.o spi_unit.o flash_unit.o pio_unit.o uart_unit.o glcd_unit.o main.o > evbmmtm_sam7S256_flash.map d:/programme/atmel/arm/programme/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld.exe: warning: dot moved backwards before `Flash_Buffer_Section' d:/programme/atmel/arm/programme/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld.exe: warning: dot moved backwards before `Flash_Buffer_Section' d:/programme/atmel/arm/programme/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld.exe: warning: dot moved backwards before `Flash_Buffer_Section' arm-elf-objcopy --strip-debug --strip-unneeded evbmmtm_sam7S256_flash.elf -O binary evbmmtm_sam7S256_flash.bin arm-elf-objdump -D -S evbmmtm_sam7S256_flash.elf > evbmmtm_sam7S256_flash.lst