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 = 0x30000000, l = 1M /* kernel loads at 0x30200000 */ 16} 17 18SECTIONS 19{ 20 FLASH = 0x00000000; 21 SDRAM = 0x30000000; 22 23 /DISCARD/ : { *(.ARM.attributes*) *(.ARM.exidx) } 24 25 /* Read-only sections, merged into text segment: */ 26 /* __text_store = FLASH; */ 27 .text : 28 AT (FLASH) 29 { 30 *(.vectors) 31 __text_store = . - SDRAM; 32 *(.text) 33 *(.text.*) 34 *(.stub) 35 *(.glue_7t) *(.glue_7) 36 *(.rodata) *(.rodata.*) 37 } > sdram = 0 38 PROVIDE (__etext = .); 39 PROVIDE (_etext = .); 40 PROVIDE (etext = .); 41 __data_store = FLASH + SIZEOF(.text); 42 .data : 43 AT (LOADADDR(.text) + SIZEOF(.text)) 44 { 45 __data_start = . ; 46 *(.data) 47 *(.data.*) 48 } > sdram 49 .sdata : 50 AT (LOADADDR(.data) + SIZEOF(.data)) 51 { 52 *(.sdata) 53 *(.sdata.*) 54 . = ALIGN(32 / 8); 55 } > sdram 56 _edata = .; 57 PROVIDE (edata = .); 58 __bss_start = .; 59 __bss_start__ = .; 60 .sbss : 61 AT (ADDR(.sbss)) 62 { 63 PROVIDE (__sbss_start = .); 64 PROVIDE (___sbss_start = .); 65 *(.dynsbss) 66 *(.sbss) 67 *(.sbss.*) 68 *(.scommon) 69 PROVIDE (__sbss_end = .); 70 PROVIDE (___sbss_end = .); 71 } > sdram 72 .bss : 73 AT (ADDR(.bss)) 74 { 75 *(.dynbss) 76 *(.bss) 77 *(.bss.*) 78 *(COMMON) 79 /* Align here to ensure that the .bss section occupies space up to 80 _end. Align after .bss to ensure correct alignment even if the 81 .bss section disappears because there are no input sections. */ 82 . = ALIGN(32 / 8); 83 } > sdram 84 . = ALIGN(32 / 8); 85 _end = .; 86 _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; 87 PROVIDE (end = .); 88 /* .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : */ 89 .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : 90 AT (LOADADDR(.sdata) + SIZEOF(.sdata)) 91 { 92 *(.image) 93 } 94 95 __rom_size__ = LOADADDR(.image) + SIZEOF(.image); 96} 97 98