1 /* $NetBSD: ldscript,v 1.2 2004/12/24 16:17:27 joff Exp $ */ 2 3 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", 4 "elf32-littlearm") 5 6 OUTPUT_ARCH(arm) 7 ENTRY(FLASH) 8 9 MEMORY 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 18 SECTIONS 19 { 20 FLASH = 0x00000000; 21 SDRAM = 0x30000000; 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 { 60 PROVIDE (__sbss_start = .); 61 PROVIDE (___sbss_start = .); 62 *(.dynsbss) 63 *(.sbss) 64 *(.sbss.*) 65 *(.scommon) 66 PROVIDE (__sbss_end = .); 67 PROVIDE (___sbss_end = .); 68 } > sdram 69 .bss : 70 { 71 *(.dynbss) 72 *(.bss) 73 *(.bss.*) 74 *(COMMON) 75 /* Align here to ensure that the .bss section occupies space up to 76 _end. Align after .bss to ensure correct alignment even if the 77 .bss section disappears because there are no input sections. */ 78 . = ALIGN(32 / 8); 79 } > sdram 80 . = ALIGN(32 / 8); 81 _end = .; 82 _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; 83 PROVIDE (end = .); 84 /* .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : */ 85 .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : 86 AT (LOADADDR(.sdata) + SIZEOF(.sdata)) 87 { 88 *(.image) 89 } 90 91 __rom_size__ = LOADADDR(.image) + SIZEOF(.image); 92 } 93 94