1/* $NetBSD: ldscript,v 1.4 2009/09/26 07:29:55 skrll Exp $ */ 2 3OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", 4 "elf32-littlearm") 5 6OUTPUT_ARCH(arm) 7ENTRY(FLASH) 8 9MEMORY 10{ 11 /* We will locate the .text section in flash, and will run directly 12 from there just long enough to relocate our .text and .data into 13 a small chunk of SDRAM starting at (SDRAM + 1M). */ 14 flash : o = 0x00000000, l = 16M 15 sdram : o = 0x08000000, l = 1M /* kernel loads at 0x08200000 */ 16} 17 18SECTIONS 19{ 20 FLASH = 0x00000000; 21 SDRAM = 0x08000000; 22 23 /* Read-only sections, merged into text segment: */ 24 /* __text_store = FLASH; */ 25 .text : 26 AT (FLASH) 27 { 28 *(.vectors) 29 __text_store = . - SDRAM; 30 *(.text) 31 *(.text.*) 32 *(.stub) 33 *(.glue_7t) *(.glue_7) 34 *(.rodata) *(.rodata.*) 35 } > sdram = 0 36 PROVIDE (__etext = .); 37 PROVIDE (_etext = .); 38 PROVIDE (etext = .); 39 __data_store = FLASH + SIZEOF(.text); 40 .data : 41 AT (LOADADDR(.text) + SIZEOF(.text)) 42 { 43 __data_start = . ; 44 *(.data) 45 *(.data.*) 46 } > sdram 47 .sdata : 48 AT (LOADADDR(.data) + SIZEOF(.data)) 49 { 50 *(.sdata) 51 *(.sdata.*) 52 . = ALIGN(32 / 8); 53 } > sdram 54 _edata = .; 55 PROVIDE (edata = .); 56 __bss_start = .; 57 __bss_start__ = .; 58 .sbss : 59 AT (ADDR(.sbss)) 60 { 61 PROVIDE (__sbss_start = .); 62 PROVIDE (___sbss_start = .); 63 *(.dynsbss) 64 *(.sbss) 65 *(.sbss.*) 66 *(.scommon) 67 PROVIDE (__sbss_end = .); 68 PROVIDE (___sbss_end = .); 69 } > sdram 70 .bss : 71 AT (ADDR(.bss)) 72 { 73 *(.dynbss) 74 *(.bss) 75 *(.bss.*) 76 *(COMMON) 77 /* Align here to ensure that the .bss section occupies space up to 78 _end. Align after .bss to ensure correct alignment even if the 79 .bss section disappears because there are no input sections. */ 80 . = ALIGN(32 / 8); 81 } > sdram 82 . = ALIGN(32 / 8); 83 _end = .; 84 _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; 85 PROVIDE (end = .); 86 /* .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : */ 87 .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : 88 AT (LOADADDR(.sdata) + SIZEOF(.sdata)) 89 { 90 *(.image) 91 } 92 93 __rom_size__ = LOADADDR(.image) + SIZEOF(.image); 94} 95 96