1/*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date           Author       Notes
8 * 2010-05-17     swkyer       first version
9 * 2010-09-04     bernard      move the beginning entry to 0x80200000
10 * 2019-12-04     Jiaxun Yang  Adapt new memory layout
11 */
12
13OUTPUT_ARCH(mips)
14GROUP(-lgcc -lc)
15
16ENTRY(_start)
17SECTIONS
18{
19    . = 0x80200000;
20    .text :
21    {
22    start = ABSOLUTE(.);
23     *(.selfboot);
24     *(.selfboot_data);
25    . = ALIGN(4);
26    __selfboot_end = .;
27    . = ALIGN(0x1000);
28    __ebase_entry = .;
29        KEEP(*(.exc_vectors))
30        __ebase_end = .;
31     *(.start);
32         *(.text)
33         *(.text.*)
34         *(.rodata)
35         *(.rodata.*)
36         *(.rodata1)
37         *(.rodata1.*)
38
39         /* section information for finsh shell */
40         . = ALIGN(4);
41         __fsymtab_start = .;
42         KEEP(*(FSymTab))
43         __fsymtab_end = .;
44         . = ALIGN(4);
45         __vsymtab_start = .;
46         KEEP(*(VSymTab))
47         __vsymtab_end = .;
48         . = ALIGN(4);
49
50         . = ALIGN(4);
51         __rt_init_start = .;
52         KEEP(*(SORT(.rti_fn*)))
53          __rt_init_end = .;
54         . = ALIGN(4);
55    }
56
57    .eh_frame_hdr :
58    {
59         *(.eh_frame_hdr)
60         *(.eh_frame_entry)
61    }
62    .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
63
64    . = ALIGN(4);
65    .data :
66    {
67         *(.data)
68         *(.data.*)
69
70         *(.data1)
71         *(.data1.*)
72
73         . = ALIGN(8);
74         _gp = ABSOLUTE(.);     /* Base of small data */
75
76         *(.sdata)
77         *(.sdata.*)
78    }
79    _edata = .;
80
81    .stack :
82    {
83        . = ALIGN(8);
84        _system_stack_start = .;
85        . = . + 0x400; /* 1kb system stack */
86        _system_stack = .;
87    }
88
89    .sbss :
90    {
91        __bss_start = .;
92        *(.sbss)
93        *(.sbss.*)
94        *(.dynsbss)
95        *(.scommon)
96    }
97
98    .bss :
99    {
100        *(.bss)
101        *(.bss.*)
102        *(.dynbss)
103        *(COMMON)
104        __bss_end = .;
105    }
106    _end = .;
107
108    /* Stabs debugging sections.  */
109    .stab          0 : { *(.stab) }
110    .stabstr       0 : { *(.stabstr) }
111    .stab.excl     0 : { *(.stab.excl) }
112    .stab.exclstr  0 : { *(.stab.exclstr) }
113    .stab.index    0 : { *(.stab.index) }
114    .stab.indexstr 0 : { *(.stab.indexstr) }
115    .comment       0 : { *(.comment) }
116    /* DWARF debug sections.
117     * Symbols in the DWARF debugging sections are relative to the beginning
118     * of the section so we begin them at 0.  */
119    /* DWARF 1 */
120    .debug          0 : { *(.debug) }
121    .line           0 : { *(.line) }
122    /* GNU DWARF 1 extensions */
123    .debug_srcinfo  0 : { *(.debug_srcinfo) }
124    .debug_sfnames  0 : { *(.debug_sfnames) }
125    /* DWARF 1.1 and DWARF 2 */
126    .debug_aranges  0 : { *(.debug_aranges) }
127    .debug_pubnames 0 : { *(.debug_pubnames) }
128    /* DWARF 2 */
129    .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
130    .debug_abbrev   0 : { *(.debug_abbrev) }
131    .debug_line     0 : { *(.debug_line) }
132    .debug_frame    0 : { *(.debug_frame) }
133    .debug_str      0 : { *(.debug_str) }
134    .debug_loc      0 : { *(.debug_loc) }
135    .debug_macinfo  0 : { *(.debug_macinfo) }
136    /* SGI/MIPS DWARF 2 extensions */
137    .debug_weaknames 0 : { *(.debug_weaknames) }
138    .debug_funcnames 0 : { *(.debug_funcnames) }
139    .debug_typenames 0 : { *(.debug_typenames) }
140    .debug_varnames  0 : { *(.debug_varnames) }
141}
142