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