blob: cbf54b46103faaf2925e5cba7c98a1e49ff73bce [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Scott McNutt2ca00852006-06-08 13:37:39 -04002/*
3 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
4 * Scott McNutt <smcnutt@psyent.com>
Scott McNutt2ca00852006-06-08 13:37:39 -04005 */
6
Thomas Choua174b912014-08-28 17:29:06 +08007#include <config.h>
Scott McNutt2ca00852006-06-08 13:37:39 -04008
9OUTPUT_FORMAT("elf32-littlenios2")
10OUTPUT_ARCH(nios2)
11ENTRY(_start)
12
13SECTIONS
14{
Thomas Choua174b912014-08-28 17:29:06 +080015 . = CONFIG_SYS_MONITOR_BASE;
Scott McNutt2ca00852006-06-08 13:37:39 -040016 .text :
17 {
Scott McNutt12a8a652010-04-16 16:12:39 -040018 arch/nios2/cpu/start.o (.text)
Scott McNutt2ca00852006-06-08 13:37:39 -040019 *(.text)
20 *(.text.*)
21 *(.gnu.linkonce.t*)
Trent Piepho4438e5e2009-02-18 15:22:05 -080022 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
Scott McNutt2ca00852006-06-08 13:37:39 -040023 *(.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 McNutt2ca00852006-06-08 13:37:39 -040033
Marek Vasut607092a2012-10-12 10:27:03 +000034 . = ALIGN(4);
35 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000036 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut607092a2012-10-12 10:27:03 +000037 }
38
Scott McNutt2ca00852006-06-08 13:37:39 -040039 /* 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 Chou63ed2552015-09-06 20:18:10 +080052 /*
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 McNutt2ca00852006-06-08 13:37:39 -040057
58 .sdata :
59 {
60 *(.sdata)
61 *(.sdata.*)
62 *(.gnu.linkonce.s.*)
63 }
64 . = ALIGN(4);
65
66 _edata = .;
67 PROVIDE (edata = .);
68
Thomas Chou93a78422015-09-06 20:13:34 +080069 /*
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 McNutt2ca00852006-06-08 13:37:39 -040075 /* 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 Denk828a9782008-01-12 20:31:39 +010080 .sbss (NOLOAD) :
Scott McNutt2ca00852006-06-08 13:37:39 -040081 {
82 *(.sbss)
83 *(.sbss.*)
84 *(.gnu.linkonce.sb.*)
85 *(.scommon)
86 }
87 . = ALIGN(4);
Wolfgang Denk828a9782008-01-12 20:31:39 +010088 .bss (NOLOAD) :
Scott McNutt2ca00852006-06-08 13:37:39 -040089 {
90 *(.bss)
91 *(.bss.*)
92 *(.dynbss)
93 *(COMMON)
94 *(.scommon)
95 }
96 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +000097 __bss_end = .;
Scott McNutt2ca00852006-06-08 13:37:39 -040098 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}