blob: 9720d585846186297ab3a4c88a48599ea39abf2d [file] [log] [blame]
Thomas Chou7ffbbf52010-04-21 08:40:59 +08001/*
2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Thomas Chou7ffbbf52010-04-21 08:40:59 +08006 */
7
8
9OUTPUT_FORMAT("elf32-littlenios2")
10OUTPUT_ARCH(nios2)
11ENTRY(_start)
12
13SECTIONS
14{
15 . = text_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 */
Thomas Chou7ffbbf52010-04-21 08:40:59 +080033
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
Thomas Chou7ffbbf52010-04-21 08:40:59 +080039 /* 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 . = ALIGN(16);
53 _gp = .; /* Global pointer addr */
54 PROVIDE (gp = .);
55
56 .sdata :
57 {
58 *(.sdata)
59 *(.sdata.*)
60 *(.gnu.linkonce.s.*)
61 }
62 . = ALIGN(4);
63
64 _edata = .;
65 PROVIDE (edata = .);
66
67 /* UNINIT DATA - Small uninitialized data is first so it's
68 * adjacent to sdata and can be referenced via gp. The normal
69 * bss follows. We keep it adjacent to simplify init code.
70 */
71 __bss_start = .;
72 .sbss (NOLOAD) :
73 {
74 *(.sbss)
75 *(.sbss.*)
76 *(.gnu.linkonce.sb.*)
77 *(.scommon)
78 }
79 . = ALIGN(4);
80 .bss (NOLOAD) :
81 {
82 *(.bss)
83 *(.bss.*)
84 *(.dynbss)
85 *(COMMON)
86 *(.scommon)
87 }
88 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +000089 __bss_end = .;
Thomas Chou7ffbbf52010-04-21 08:40:59 +080090 PROVIDE (end = .);
91
92 /* DEBUG -- symbol table, string table, etc. etc.
93 */
94 .stab 0 : { *(.stab) }
95 .stabstr 0 : { *(.stabstr) }
96 .stab.excl 0 : { *(.stab.excl) }
97 .stab.exclstr 0 : { *(.stab.exclstr) }
98 .stab.index 0 : { *(.stab.index) }
99 .stab.indexstr 0 : { *(.stab.indexstr) }
100 .comment 0 : { *(.comment) }
101 .debug 0 : { *(.debug) }
102 .line 0 : { *(.line) }
103 .debug_srcinfo 0 : { *(.debug_srcinfo) }
104 .debug_sfnames 0 : { *(.debug_sfnames) }
105 .debug_aranges 0 : { *(.debug_aranges) }
106 .debug_pubnames 0 : { *(.debug_pubnames) }
107 .debug_info 0 : { *(.debug_info) }
108 .debug_abbrev 0 : { *(.debug_abbrev) }
109 .debug_line 0 : { *(.debug_line) }
110 .debug_frame 0 : { *(.debug_frame) }
111 .debug_str 0 : { *(.debug_str) }
112 .debug_loc 0 : { *(.debug_loc) }
113 .debug_macinfo 0 : { *(.debug_macinfo) }
114 .debug_weaknames 0 : { *(.debug_weaknames) }
115 .debug_funcnames 0 : { *(.debug_funcnames) }
116 .debug_typenames 0 : { *(.debug_typenames) }
117 .debug_varnames 0 : { *(.debug_varnames) }
118}