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