Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2004, Psyent Corporation <www.psyent.com> |
| 3 | * Scott McNutt <smcnutt@psyent.com> |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | |
| 25 | OUTPUT_FORMAT("elf32-littlenios2") |
| 26 | OUTPUT_ARCH(nios2) |
| 27 | ENTRY(_start) |
| 28 | |
| 29 | SECTIONS |
| 30 | { |
| 31 | . = text_base; |
| 32 | .text : |
| 33 | { |
| 34 | arch/nios2/cpu/start.o (.text) |
| 35 | *(.text) |
| 36 | *(.text.*) |
| 37 | *(.gnu.linkonce.t*) |
| 38 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
| 39 | *(.gnu.linkonce.r*) |
| 40 | } |
| 41 | . = ALIGN (4); |
| 42 | _etext = .; |
| 43 | PROVIDE (etext = .); |
| 44 | |
| 45 | /* CMD TABLE - sandwich this in between text and data so |
| 46 | * the initialization code relocates the command table as |
| 47 | * well -- admittedly, this is just pure laziness ;-) |
| 48 | */ |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 49 | |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 50 | . = ALIGN(4); |
| 51 | .u_boot_list : { |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 52 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 53 | } |
| 54 | |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 55 | /* INIT DATA sections - "Small" data (see the gcc -G option) |
| 56 | * is always gp-relative. Here we make all init data sections |
| 57 | * adjacent to simplify the startup code -- and provide |
| 58 | * the global pointer for gp-relative access. |
| 59 | */ |
| 60 | _data = .; |
| 61 | .data : |
| 62 | { |
| 63 | *(.data) |
| 64 | *(.data.*) |
| 65 | *(.gnu.linkonce.d*) |
| 66 | } |
| 67 | |
| 68 | . = ALIGN(16); |
| 69 | _gp = .; /* Global pointer addr */ |
| 70 | PROVIDE (gp = .); |
| 71 | |
| 72 | .sdata : |
| 73 | { |
| 74 | *(.sdata) |
| 75 | *(.sdata.*) |
| 76 | *(.gnu.linkonce.s.*) |
| 77 | } |
| 78 | . = ALIGN(4); |
| 79 | |
| 80 | _edata = .; |
| 81 | PROVIDE (edata = .); |
| 82 | |
| 83 | /* UNINIT DATA - Small uninitialized data is first so it's |
| 84 | * adjacent to sdata and can be referenced via gp. The normal |
| 85 | * bss follows. We keep it adjacent to simplify init code. |
| 86 | */ |
| 87 | __bss_start = .; |
| 88 | .sbss (NOLOAD) : |
| 89 | { |
| 90 | *(.sbss) |
| 91 | *(.sbss.*) |
| 92 | *(.gnu.linkonce.sb.*) |
| 93 | *(.scommon) |
| 94 | } |
| 95 | . = ALIGN(4); |
| 96 | .bss (NOLOAD) : |
| 97 | { |
| 98 | *(.bss) |
| 99 | *(.bss.*) |
| 100 | *(.dynbss) |
| 101 | *(COMMON) |
| 102 | *(.scommon) |
| 103 | } |
| 104 | . = ALIGN(4); |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 105 | __bss_end = .; |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 106 | PROVIDE (end = .); |
| 107 | |
| 108 | /* DEBUG -- symbol table, string table, etc. etc. |
| 109 | */ |
| 110 | .stab 0 : { *(.stab) } |
| 111 | .stabstr 0 : { *(.stabstr) } |
| 112 | .stab.excl 0 : { *(.stab.excl) } |
| 113 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 114 | .stab.index 0 : { *(.stab.index) } |
| 115 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 116 | .comment 0 : { *(.comment) } |
| 117 | .debug 0 : { *(.debug) } |
| 118 | .line 0 : { *(.line) } |
| 119 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 120 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 121 | .debug_aranges 0 : { *(.debug_aranges) } |
| 122 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 123 | .debug_info 0 : { *(.debug_info) } |
| 124 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 125 | .debug_line 0 : { *(.debug_line) } |
| 126 | .debug_frame 0 : { *(.debug_frame) } |
| 127 | .debug_str 0 : { *(.debug_str) } |
| 128 | .debug_loc 0 : { *(.debug_loc) } |
| 129 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 130 | .debug_weaknames 0 : { *(.debug_weaknames) } |
| 131 | .debug_funcnames 0 : { *(.debug_funcnames) } |
| 132 | .debug_typenames 0 : { *(.debug_typenames) } |
| 133 | .debug_varnames 0 : { *(.debug_varnames) } |
| 134 | } |