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