Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Linker script for Gaisler Research AB's GRSIM LEON3 simulator. |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 3 | * |
| 4 | * (C) Copyright 2007 |
| 5 | * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. |
| 6 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") |
| 11 | OUTPUT_ARCH(sparc) |
| 12 | ENTRY(_start) |
| 13 | SECTIONS |
| 14 | { |
| 15 | |
| 16 | /* Read-only sections, merged into text segment: */ |
| 17 | . = + SIZEOF_HEADERS; |
| 18 | .interp : { *(.interp) } |
| 19 | .hash : { *(.hash) } |
| 20 | .dynsym : { *(.dynsym) } |
| 21 | .dynstr : { *(.dynstr) } |
| 22 | .rel.text : { *(.rel.text) } |
| 23 | .rela.text : { *(.rela.text) } |
| 24 | .rel.data : { *(.rel.data) } |
| 25 | .rela.data : { *(.rela.data) } |
| 26 | .rel.rodata : { *(.rel.rodata) } |
| 27 | .rela.rodata : { *(.rela.rodata) } |
| 28 | .rel.got : { *(.rel.got) } |
| 29 | .rela.got : { *(.rela.got) } |
| 30 | .rel.ctors : { *(.rel.ctors) } |
| 31 | .rela.ctors : { *(.rela.ctors) } |
| 32 | .rel.dtors : { *(.rel.dtors) } |
| 33 | .rela.dtors : { *(.rela.dtors) } |
| 34 | .rel.bss : { *(.rel.bss) } |
| 35 | .rela.bss : { *(.rela.bss) } |
| 36 | .rel.plt : { *(.rel.plt) } |
| 37 | .rela.plt : { *(.rela.plt) } |
| 38 | .init : { *(.init) } |
| 39 | .plt : { *(.plt) } |
| 40 | |
| 41 | .text : { |
| 42 | _load_addr = .; |
| 43 | _text = .; |
| 44 | |
| 45 | *(.start) |
Peter Tyser | 1e9c265 | 2010-04-12 22:28:18 -0500 | [diff] [blame] | 46 | arch/sparc/cpu/leon3/start.o (.text) |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 47 | /* 8k is the same as the PROM offset from end of main memory, (CONFIG_SYS_PROM_SIZE) */ |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 48 | . = ALIGN(8192); |
| 49 | /* PROM CODE, Will be relocated to the end of memory, |
| 50 | * no global data accesses please. |
| 51 | */ |
| 52 | __prom_start = .; |
| 53 | *(.prom.pgt) |
| 54 | *(.prom.data) |
| 55 | *(.prom.text) |
| 56 | . = ALIGN(16); |
| 57 | __prom_end = .; |
| 58 | *(.text) |
| 59 | *(.fixup) |
| 60 | *(.gnu.warning) |
| 61 | /* *(.got1)*/ |
| 62 | . = ALIGN(16); |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 63 | *(.eh_frame) |
Trent Piepho | f62fb99 | 2009-02-18 15:22:05 -0800 | [diff] [blame] | 64 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 65 | } |
| 66 | . = ALIGN(4); |
| 67 | _etext = .; |
| 68 | |
| 69 | /* CMD Table */ |
| 70 | |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 71 | |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 72 | . = ALIGN(4); |
| 73 | .u_boot_list : { |
Albert ARIBAUD | ef123c5 | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 74 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 75 | } |
| 76 | |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 77 | .data : |
| 78 | { |
| 79 | *(.data) |
| 80 | *(.data1) |
| 81 | *(.data.rel) |
| 82 | *(.data.rel.*) |
| 83 | *(.sdata) |
| 84 | *(.sdata2) |
| 85 | *(.dynamic) |
| 86 | CONSTRUCTORS |
| 87 | } |
| 88 | _edata = .; |
| 89 | PROVIDE (edata = .); |
| 90 | |
| 91 | . = ALIGN(4); |
| 92 | __got_start = .; |
| 93 | .got : { |
| 94 | *(.got) |
| 95 | /* *(.data.rel) |
| 96 | *(.data.rel.local)*/ |
| 97 | . = ALIGN(16); |
| 98 | } |
| 99 | __got_end = .; |
| 100 | |
| 101 | /* .data.rel : { } */ |
| 102 | |
| 103 | |
| 104 | . = ALIGN(4096); |
| 105 | __init_begin = .; |
| 106 | .text.init : { *(.text.init) } |
| 107 | .data.init : { *(.data.init) } |
| 108 | . = ALIGN(4096); |
| 109 | __init_end = .; |
| 110 | |
| 111 | __bss_start = .; |
| 112 | .bss : |
| 113 | { |
| 114 | *(.sbss) *(.scommon) |
| 115 | *(.dynbss) |
| 116 | *(.bss) |
| 117 | *(COMMON) |
| 118 | . = ALIGN(16); /* to speed clearing of bss up */ |
| 119 | } |
| 120 | __bss_end = . ; |
Simon Glass | 3929fb0 | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 121 | __bss_end = . ; |
Daniel Hellstrom | 823edd8 | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 122 | PROVIDE (end = .); |
| 123 | |
| 124 | /* Relocated into main memory */ |
| 125 | |
| 126 | /* Start of main memory */ |
| 127 | /*. = 0x40000000;*/ |
| 128 | |
| 129 | .stack (NOLOAD) : { *(.stack) } |
| 130 | |
| 131 | /* PROM CODE */ |
| 132 | |
| 133 | /* global data in RAM passed to kernel after booting */ |
| 134 | |
| 135 | |
| 136 | .stab 0 : { *(.stab) } |
| 137 | .stabstr 0 : { *(.stabstr) } |
| 138 | .stab.excl 0 : { *(.stab.excl) } |
| 139 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 140 | .stab.index 0 : { *(.stab.index) } |
| 141 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 142 | .comment 0 : { *(.comment) } |
| 143 | |
| 144 | } |