1 /* $NetBSD: ldscript,v 1.2 2020/02/12 18:11:30 thorpej Exp $ */ 2 3 OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", 4 "elf32-littlearm") 5 OUTPUT_ARCH(arm) 6 ENTRY(SDRAM) 7 MEMORY 8 { 9 /* RedBoot will copy the gzboot+compressed kernel image from the 10 FIS partition starting @ 0x50060000 to the SDRAM location starting 11 at 0x01d00000. gzboot will uncompress the kernel to 0x00200000. 12 NOTE: Even though there is room for 3M of gzboot+compressed kernel, 13 there is only room for 1M of this in the FIS partition. So we declare 14 that same limit for "sdram" to simplify the linker script. */ 15 flash : o = 0x50060000, l = 1M 16 sdram : o = 0x01d00000, l = 1M /* kernel loads at 0x00200000 */ 17 } 18 SECTIONS 19 { 20 SDRAM = 0x01d00000; 21 22 /DISCARD/ : { *(.ARM.attributes*) *(.ARM.exidx) } 23 24 /* Read-only sections, merged into text segment: */ 25 __text_store = SDRAM; 26 .text : 27 AT (SDRAM) 28 { 29 *(.text) 30 *(.text.*) 31 *(.stub) 32 *(.glue_7t) *(.glue_7) 33 *(.rodata) *(.rodata.*) 34 } > sdram =0 35 PROVIDE (__etext = .); 36 PROVIDE (_etext = .); 37 PROVIDE (etext = .); 38 __data_store = SDRAM + SIZEOF(.text); 39 .data : 40 AT (LOADADDR(.text) + SIZEOF(.text)) 41 { 42 __data_start = . ; 43 *(.data) 44 *(.data.*) 45 } > sdram 46 .sdata : 47 AT (LOADADDR(.data) + SIZEOF(.data)) 48 { 49 *(.sdata) 50 *(.sdata.*) 51 . = ALIGN(32 / 8); 52 } > sdram 53 _edata = .; 54 PROVIDE (edata = .); 55 __bss_start = .; 56 __bss_start__ = .; 57 .sbss : 58 AT (LOADADDR(.sdata) + SIZEOF(.sdata)) 59 { 60 PROVIDE (__sbss_start = .); 61 PROVIDE (___sbss_start = .); 62 *(.dynsbss) 63 *(.sbss) 64 *(.sbss.*) 65 *(.scommon) 66 PROVIDE (__sbss_end = .); 67 PROVIDE (___sbss_end = .); 68 } > sdram 69 .bss : 70 AT (LOADADDR(.sbss) + SIZEOF(.sbss)) 71 { 72 *(.dynbss) 73 *(.bss) 74 *(.bss.*) 75 *(COMMON) 76 /* Align here to ensure that the .bss section occupies space up to 77 _end. Align after .bss to ensure correct alignment even if the 78 .bss section disappears because there are no input sections. */ 79 . = ALIGN(32 / 8); 80 } > sdram 81 . = ALIGN(32 / 8); 82 _end = .; 83 _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; 84 PROVIDE (end = .); 85 .image : 86 AT (LOADADDR(.bss) + SIZEOF(.bss)) 87 { 88 *(.image) 89 } > sdram 90 } 91