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