Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Linker script for Gaisler Research AB's Template design |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 3 | * for Altera NIOS Development board Stratix II Edition, EP2S60 FPGA. |
| 4 | * |
| 5 | * (C) Copyright 2008 |
| 6 | * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. |
| 7 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") |
| 12 | OUTPUT_ARCH(sparc) |
| 13 | ENTRY(_start) |
| 14 | SECTIONS |
| 15 | { |
| 16 | |
| 17 | /* Read-only sections, merged into text segment: */ |
| 18 | . = + SIZEOF_HEADERS; |
| 19 | .interp : { *(.interp) } |
| 20 | .hash : { *(.hash) } |
| 21 | .dynsym : { *(.dynsym) } |
| 22 | .dynstr : { *(.dynstr) } |
| 23 | .rel.text : { *(.rel.text) } |
| 24 | .rela.text : { *(.rela.text) } |
| 25 | .rel.data : { *(.rel.data) } |
| 26 | .rela.data : { *(.rela.data) } |
| 27 | .rel.rodata : { *(.rel.rodata) } |
| 28 | .rela.rodata : { *(.rela.rodata) } |
| 29 | .rel.got : { *(.rel.got) } |
| 30 | .rela.got : { *(.rela.got) } |
| 31 | .rel.ctors : { *(.rel.ctors) } |
| 32 | .rela.ctors : { *(.rela.ctors) } |
| 33 | .rel.dtors : { *(.rel.dtors) } |
| 34 | .rela.dtors : { *(.rela.dtors) } |
| 35 | .rel.bss : { *(.rel.bss) } |
| 36 | .rela.bss : { *(.rela.bss) } |
| 37 | .rel.plt : { *(.rel.plt) } |
| 38 | .rela.plt : { *(.rela.plt) } |
| 39 | .init : { *(.init) } |
| 40 | .plt : { *(.plt) } |
| 41 | |
| 42 | .text : { |
| 43 | _load_addr = .; |
| 44 | _text = .; |
| 45 | |
| 46 | *(.start) |
Peter Tyser | e9b287d | 2010-04-12 22:28:18 -0500 | [diff] [blame] | 47 | arch/sparc/cpu/leon3/start.o (.text) |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 48 | /* 8k is the same as the PROM offset from end of main memory, (CONFIG_SYS_PROM_SIZE) */ |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 49 | . = ALIGN(8192); |
| 50 | /* PROM CODE, Will be relocated to the end of memory, |
| 51 | * no global data accesses please. |
| 52 | */ |
| 53 | __prom_start = .; |
| 54 | *(.prom.pgt) |
| 55 | *(.prom.data) |
| 56 | *(.prom.text) |
| 57 | . = ALIGN(16); |
| 58 | __prom_end = .; |
| 59 | *(.text) |
| 60 | *(.fixup) |
| 61 | *(.gnu.warning) |
| 62 | /* *(.got1)*/ |
| 63 | . = ALIGN(16); |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 64 | *(.eh_frame) |
Trent Piepho | 4438e5e | 2009-02-18 15:22:05 -0800 | [diff] [blame] | 65 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 66 | } |
| 67 | . = ALIGN(4); |
| 68 | _etext = .; |
| 69 | |
| 70 | /* CMD Table */ |
| 71 | |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 72 | |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 73 | . = ALIGN(4); |
| 74 | .u_boot_list : { |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 75 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +0100 | [diff] [blame] | 78 | .data : |
| 79 | { |
| 80 | *(.data) |
| 81 | *(.data1) |
| 82 | *(.data.rel) |
| 83 | *(.data.rel.*) |
| 84 | *(.sdata) |
| 85 | *(.sdata2) |
| 86 | *(.dynamic) |
| 87 | CONSTRUCTORS |
| 88 | } |
| 89 | _edata = .; |
| 90 | PROVIDE (edata = .); |
| 91 | |
| 92 | . = ALIGN(4); |
| 93 | __got_start = .; |
| 94 | .got : { |
| 95 | *(.got) |
| 96 | /* *(.data.rel) |
| 97 | *(.data.rel.local)*/ |
| 98 | . = ALIGN(16); |
| 99 | } |
| 100 | __got_end = .; |
| 101 | |
| 102 | /* .data.rel : { } */ |
| 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 | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 121 | __bss_end = . ; |
Daniel Hellstrom | e045a4c | 2008-03-26 23:34:47 +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 | .stab 0 : { *(.stab) } |
| 136 | .stabstr 0 : { *(.stabstr) } |
| 137 | .stab.excl 0 : { *(.stab.excl) } |
| 138 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 139 | .stab.index 0 : { *(.stab.index) } |
| 140 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 141 | .comment 0 : { *(.comment) } |
| 142 | |
| 143 | } |