xref: /openbmc/u-boot/arch/nios2/cpu/u-boot.lds (revision cbd2fba1)
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
4 * Scott McNutt <smcnutt@psyent.com>
5 */
6
7#include <config.h>
8
9OUTPUT_FORMAT("elf32-littlenios2")
10OUTPUT_ARCH(nios2)
11ENTRY(_start)
12
13SECTIONS
14{
15	. = CONFIG_SYS_MONITOR_BASE;
16	.text :
17	{
18	  arch/nios2/cpu/start.o (.text)
19	  *(.text)
20	  *(.text.*)
21	  *(.gnu.linkonce.t*)
22	  *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
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	 */
33
34	. = ALIGN(4);
35	.u_boot_list : {
36		KEEP(*(SORT(.u_boot_list*)));
37	}
38
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
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	 */
57
58	.sdata :
59	{
60	  *(.sdata)
61	  *(.sdata.*)
62	  *(.gnu.linkonce.s.*)
63	}
64	. = ALIGN(4);
65
66	_edata = .;
67	PROVIDE (edata = .);
68
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
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 = .;
80	.sbss (NOLOAD) :
81	{
82	  *(.sbss)
83	  *(.sbss.*)
84	  *(.gnu.linkonce.sb.*)
85	  *(.scommon)
86	}
87	. = ALIGN(4);
88	.bss (NOLOAD) :
89	{
90	  *(.bss)
91	  *(.bss.*)
92	  *(.dynbss)
93	  *(COMMON)
94	  *(.scommon)
95	}
96	. = ALIGN(4);
97	__bss_end = .;
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}
127