Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2004, Psyent Corporation <www.psyent.com> |
| 3 | * Scott McNutt <smcnutt@psyent.com> |
| 4 | * |
Wolfgang Denk | 3765b3e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 6 | */ |
| 7 | |
Thomas Chou | c69d2e5 | 2014-08-28 17:29:06 +0800 | [diff] [blame] | 8 | #include <config.h> |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 9 | |
| 10 | OUTPUT_FORMAT("elf32-littlenios2") |
| 11 | OUTPUT_ARCH(nios2) |
| 12 | ENTRY(_start) |
| 13 | |
| 14 | SECTIONS |
| 15 | { |
Thomas Chou | c69d2e5 | 2014-08-28 17:29:06 +0800 | [diff] [blame] | 16 | . = CONFIG_SYS_MONITOR_BASE; |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 17 | .text : |
| 18 | { |
Scott McNutt | 254ab7b | 2010-04-16 16:12:39 -0400 | [diff] [blame] | 19 | arch/nios2/cpu/start.o (.text) |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 20 | *(.text) |
| 21 | *(.text.*) |
| 22 | *(.gnu.linkonce.t*) |
Trent Piepho | f62fb99 | 2009-02-18 15:22:05 -0800 | [diff] [blame] | 23 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 24 | *(.gnu.linkonce.r*) |
| 25 | } |
| 26 | . = ALIGN (4); |
| 27 | _etext = .; |
| 28 | PROVIDE (etext = .); |
| 29 | |
| 30 | /* CMD TABLE - sandwich this in between text and data so |
| 31 | * the initialization code relocates the command table as |
| 32 | * well -- admittedly, this is just pure laziness ;-) |
| 33 | */ |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 34 | |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 35 | . = ALIGN(4); |
| 36 | .u_boot_list : { |
Albert ARIBAUD | ef123c5 | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 37 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 40 | /* INIT DATA sections - "Small" data (see the gcc -G option) |
| 41 | * is always gp-relative. Here we make all init data sections |
| 42 | * adjacent to simplify the startup code -- and provide |
| 43 | * the global pointer for gp-relative access. |
| 44 | */ |
| 45 | _data = .; |
| 46 | .data : |
| 47 | { |
| 48 | *(.data) |
| 49 | *(.data.*) |
| 50 | *(.gnu.linkonce.d*) |
| 51 | } |
| 52 | |
Thomas Chou | 355483e | 2015-09-06 20:18:10 +0800 | [diff] [blame] | 53 | /* |
| 54 | * gp - Since we don't use gp for small data with option "-G0", |
| 55 | * we will use gp as global data pointer. The _gp location is |
| 56 | * not needed. |
| 57 | */ |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 58 | |
| 59 | .sdata : |
| 60 | { |
| 61 | *(.sdata) |
| 62 | *(.sdata.*) |
| 63 | *(.gnu.linkonce.s.*) |
| 64 | } |
| 65 | . = ALIGN(4); |
| 66 | |
| 67 | _edata = .; |
| 68 | PROVIDE (edata = .); |
| 69 | |
Thomas Chou | 1226dfd | 2015-09-06 20:13:34 +0800 | [diff] [blame] | 70 | /* |
| 71 | * _end - This is end of u-boot.bin image. |
| 72 | * dtb will be appended here to make u-boot-dtb.bin |
| 73 | */ |
| 74 | _end = .; |
| 75 | |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 76 | /* UNINIT DATA - Small uninitialized data is first so it's |
| 77 | * adjacent to sdata and can be referenced via gp. The normal |
| 78 | * bss follows. We keep it adjacent to simplify init code. |
| 79 | */ |
| 80 | __bss_start = .; |
Wolfgang Denk | 64134f0 | 2008-01-12 20:31:39 +0100 | [diff] [blame] | 81 | .sbss (NOLOAD) : |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 82 | { |
| 83 | *(.sbss) |
| 84 | *(.sbss.*) |
| 85 | *(.gnu.linkonce.sb.*) |
| 86 | *(.scommon) |
| 87 | } |
| 88 | . = ALIGN(4); |
Wolfgang Denk | 64134f0 | 2008-01-12 20:31:39 +0100 | [diff] [blame] | 89 | .bss (NOLOAD) : |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 90 | { |
| 91 | *(.bss) |
| 92 | *(.bss.*) |
| 93 | *(.dynbss) |
| 94 | *(COMMON) |
| 95 | *(.scommon) |
| 96 | } |
| 97 | . = ALIGN(4); |
Simon Glass | 3929fb0 | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 98 | __bss_end = .; |
Scott McNutt | 9cc8337 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 99 | PROVIDE (end = .); |
| 100 | |
| 101 | /* DEBUG -- symbol table, string table, etc. etc. |
| 102 | */ |
| 103 | .stab 0 : { *(.stab) } |
| 104 | .stabstr 0 : { *(.stabstr) } |
| 105 | .stab.excl 0 : { *(.stab.excl) } |
| 106 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 107 | .stab.index 0 : { *(.stab.index) } |
| 108 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 109 | .comment 0 : { *(.comment) } |
| 110 | .debug 0 : { *(.debug) } |
| 111 | .line 0 : { *(.line) } |
| 112 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 113 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 114 | .debug_aranges 0 : { *(.debug_aranges) } |
| 115 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 116 | .debug_info 0 : { *(.debug_info) } |
| 117 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 118 | .debug_line 0 : { *(.debug_line) } |
| 119 | .debug_frame 0 : { *(.debug_frame) } |
| 120 | .debug_str 0 : { *(.debug_str) } |
| 121 | .debug_loc 0 : { *(.debug_loc) } |
| 122 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 123 | .debug_weaknames 0 : { *(.debug_weaknames) } |
| 124 | .debug_funcnames 0 : { *(.debug_funcnames) } |
| 125 | .debug_typenames 0 : { *(.debug_typenames) } |
| 126 | .debug_varnames 0 : { *(.debug_varnames) } |
| 127 | } |