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