blob: 6e174be2c0c19ae41e04b3727d24cc86bef548e0 [file] [log] [blame]
Scott McNutt2ca00852006-06-08 13:37:39 -04001/*
2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
4 *
Wolfgang Denkbd8ec7e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Scott McNutt2ca00852006-06-08 13:37:39 -04006 */
7
Thomas Choua174b912014-08-28 17:29:06 +08008#include <config.h>
Scott McNutt2ca00852006-06-08 13:37:39 -04009
10OUTPUT_FORMAT("elf32-littlenios2")
11OUTPUT_ARCH(nios2)
12ENTRY(_start)
13
14SECTIONS
15{
Thomas Choua174b912014-08-28 17:29:06 +080016 . = CONFIG_SYS_MONITOR_BASE;
Scott McNutt2ca00852006-06-08 13:37:39 -040017 .text :
18 {
Scott McNutt12a8a652010-04-16 16:12:39 -040019 arch/nios2/cpu/start.o (.text)
Scott McNutt2ca00852006-06-08 13:37:39 -040020 *(.text)
21 *(.text.*)
22 *(.gnu.linkonce.t*)
Trent Piepho4438e5e2009-02-18 15:22:05 -080023 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
Scott McNutt2ca00852006-06-08 13:37:39 -040024 *(.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 McNutt2ca00852006-06-08 13:37:39 -040034
Marek Vasut607092a2012-10-12 10:27:03 +000035 . = ALIGN(4);
36 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000037 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut607092a2012-10-12 10:27:03 +000038 }
39
Scott McNutt2ca00852006-06-08 13:37:39 -040040 /* 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
53 . = ALIGN(16);
54 _gp = .; /* Global pointer addr */
55 PROVIDE (gp = .);
56
57 .sdata :
58 {
59 *(.sdata)
60 *(.sdata.*)
61 *(.gnu.linkonce.s.*)
62 }
63 . = ALIGN(4);
64
65 _edata = .;
66 PROVIDE (edata = .);
67
68 /* UNINIT DATA - Small uninitialized data is first so it's
69 * adjacent to sdata and can be referenced via gp. The normal
70 * bss follows. We keep it adjacent to simplify init code.
71 */
72 __bss_start = .;
Wolfgang Denk828a9782008-01-12 20:31:39 +010073 .sbss (NOLOAD) :
Scott McNutt2ca00852006-06-08 13:37:39 -040074 {
75 *(.sbss)
76 *(.sbss.*)
77 *(.gnu.linkonce.sb.*)
78 *(.scommon)
79 }
80 . = ALIGN(4);
Wolfgang Denk828a9782008-01-12 20:31:39 +010081 .bss (NOLOAD) :
Scott McNutt2ca00852006-06-08 13:37:39 -040082 {
83 *(.bss)
84 *(.bss.*)
85 *(.dynbss)
86 *(COMMON)
87 *(.scommon)
88 }
89 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +000090 __bss_end = .;
Scott McNutt2ca00852006-06-08 13:37:39 -040091 PROVIDE (end = .);
92
93 /* DEBUG -- symbol table, string table, etc. etc.
94 */
95 .stab 0 : { *(.stab) }
96 .stabstr 0 : { *(.stabstr) }
97 .stab.excl 0 : { *(.stab.excl) }
98 .stab.exclstr 0 : { *(.stab.exclstr) }
99 .stab.index 0 : { *(.stab.index) }
100 .stab.indexstr 0 : { *(.stab.indexstr) }
101 .comment 0 : { *(.comment) }
102 .debug 0 : { *(.debug) }
103 .line 0 : { *(.line) }
104 .debug_srcinfo 0 : { *(.debug_srcinfo) }
105 .debug_sfnames 0 : { *(.debug_sfnames) }
106 .debug_aranges 0 : { *(.debug_aranges) }
107 .debug_pubnames 0 : { *(.debug_pubnames) }
108 .debug_info 0 : { *(.debug_info) }
109 .debug_abbrev 0 : { *(.debug_abbrev) }
110 .debug_line 0 : { *(.debug_line) }
111 .debug_frame 0 : { *(.debug_frame) }
112 .debug_str 0 : { *(.debug_str) }
113 .debug_loc 0 : { *(.debug_loc) }
114 .debug_macinfo 0 : { *(.debug_macinfo) }
115 .debug_weaknames 0 : { *(.debug_weaknames) }
116 .debug_funcnames 0 : { *(.debug_funcnames) }
117 .debug_typenames 0 : { *(.debug_typenames) }
118 .debug_varnames 0 : { *(.debug_varnames) }
119}