Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 1 | /* Linker script for Gaisler Research AB's GRSIM LEON3 simulator. |
| 2 | * |
| 3 | * (C) Copyright 2007 |
| 4 | * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. |
| 5 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") |
| 27 | OUTPUT_ARCH(sparc) |
| 28 | ENTRY(_start) |
| 29 | SECTIONS |
| 30 | { |
| 31 | |
| 32 | /* Read-only sections, merged into text segment: */ |
| 33 | . = + SIZEOF_HEADERS; |
| 34 | .interp : { *(.interp) } |
| 35 | .hash : { *(.hash) } |
| 36 | .dynsym : { *(.dynsym) } |
| 37 | .dynstr : { *(.dynstr) } |
| 38 | .rel.text : { *(.rel.text) } |
| 39 | .rela.text : { *(.rela.text) } |
| 40 | .rel.data : { *(.rel.data) } |
| 41 | .rela.data : { *(.rela.data) } |
| 42 | .rel.rodata : { *(.rel.rodata) } |
| 43 | .rela.rodata : { *(.rela.rodata) } |
| 44 | .rel.got : { *(.rel.got) } |
| 45 | .rela.got : { *(.rela.got) } |
| 46 | .rel.ctors : { *(.rel.ctors) } |
| 47 | .rela.ctors : { *(.rela.ctors) } |
| 48 | .rel.dtors : { *(.rel.dtors) } |
| 49 | .rela.dtors : { *(.rela.dtors) } |
| 50 | .rel.bss : { *(.rel.bss) } |
| 51 | .rela.bss : { *(.rela.bss) } |
| 52 | .rel.plt : { *(.rel.plt) } |
| 53 | .rela.plt : { *(.rela.plt) } |
| 54 | .init : { *(.init) } |
| 55 | .plt : { *(.plt) } |
| 56 | |
| 57 | .text : { |
| 58 | _load_addr = .; |
| 59 | _text = .; |
| 60 | |
| 61 | *(.start) |
Peter Tyser | e9b287d | 2010-04-12 22:28:18 -0500 | [diff] [blame] | 62 | arch/sparc/cpu/leon3/start.o (.text) |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 63 | /* 8k is the same as the PROM offset from end of main memory, (CONFIG_SYS_PROM_SIZE) */ |
Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 64 | . = ALIGN(8192); |
| 65 | /* PROM CODE, Will be relocated to the end of memory, |
| 66 | * no global data accesses please. |
| 67 | */ |
| 68 | __prom_start = .; |
| 69 | *(.prom.pgt) |
| 70 | *(.prom.data) |
| 71 | *(.prom.text) |
| 72 | . = ALIGN(16); |
| 73 | __prom_end = .; |
| 74 | *(.text) |
| 75 | *(.fixup) |
| 76 | *(.gnu.warning) |
| 77 | /* *(.got1)*/ |
| 78 | . = ALIGN(16); |
Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 79 | *(.eh_frame) |
Trent Piepho | 4438e5e | 2009-02-18 15:22:05 -0800 | [diff] [blame] | 80 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 81 | } |
| 82 | . = ALIGN(4); |
| 83 | _etext = .; |
| 84 | |
| 85 | /* CMD Table */ |
| 86 | |
Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 87 | |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 88 | . = ALIGN(4); |
| 89 | .u_boot_list : { |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 90 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 91 | } |
| 92 | |
Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 93 | .data : |
| 94 | { |
| 95 | *(.data) |
| 96 | *(.data1) |
| 97 | *(.data.rel) |
| 98 | *(.data.rel.*) |
| 99 | *(.sdata) |
| 100 | *(.sdata2) |
| 101 | *(.dynamic) |
| 102 | CONSTRUCTORS |
| 103 | } |
| 104 | _edata = .; |
| 105 | PROVIDE (edata = .); |
| 106 | |
| 107 | . = ALIGN(4); |
| 108 | __got_start = .; |
| 109 | .got : { |
| 110 | *(.got) |
| 111 | /* *(.data.rel) |
| 112 | *(.data.rel.local)*/ |
| 113 | . = ALIGN(16); |
| 114 | } |
| 115 | __got_end = .; |
| 116 | |
| 117 | /* .data.rel : { } */ |
| 118 | |
| 119 | |
| 120 | . = ALIGN(4096); |
| 121 | __init_begin = .; |
| 122 | .text.init : { *(.text.init) } |
| 123 | .data.init : { *(.data.init) } |
| 124 | . = ALIGN(4096); |
| 125 | __init_end = .; |
| 126 | |
| 127 | __bss_start = .; |
| 128 | .bss : |
| 129 | { |
| 130 | *(.sbss) *(.scommon) |
| 131 | *(.dynbss) |
| 132 | *(.bss) |
| 133 | *(COMMON) |
| 134 | . = ALIGN(16); /* to speed clearing of bss up */ |
| 135 | } |
| 136 | __bss_end = . ; |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 137 | __bss_end = . ; |
Daniel Hellstrom | ce43fed | 2008-03-28 10:06:52 +0100 | [diff] [blame] | 138 | PROVIDE (end = .); |
| 139 | |
| 140 | /* Relocated into main memory */ |
| 141 | |
| 142 | /* Start of main memory */ |
| 143 | /*. = 0x40000000;*/ |
| 144 | |
| 145 | .stack (NOLOAD) : { *(.stack) } |
| 146 | |
| 147 | /* PROM CODE */ |
| 148 | |
| 149 | /* global data in RAM passed to kernel after booting */ |
| 150 | |
| 151 | |
| 152 | .stab 0 : { *(.stab) } |
| 153 | .stabstr 0 : { *(.stabstr) } |
| 154 | .stab.excl 0 : { *(.stab.excl) } |
| 155 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 156 | .stab.index 0 : { *(.stab.index) } |
| 157 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 158 | .comment 0 : { *(.comment) } |
| 159 | |
| 160 | } |