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