1/*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * 2017-5-30     bernard       first version
8 */
9
10OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
11OUTPUT_ARCH(arm)
12
13SECTIONS
14{
15    . = 0x00008000;
16    . = ALIGN(4);
17    .text :
18    {
19        *(.vectors)
20        *(.text)                        /* remaining code */
21        *(.text.*)                      /* remaining code */
22
23        *(.rodata)                      /* read-only data (constants) */
24        *(.rodata*)
25        *(.glue_7)
26        *(.glue_7t)
27        *(.gnu.linkonce.t*)
28
29        /* section information for finsh shell */
30        . = ALIGN(4);
31        __fsymtab_start = .;
32        KEEP(*(FSymTab))
33        __fsymtab_end = .;
34        . = ALIGN(4);
35        __vsymtab_start = .;
36        KEEP(*(VSymTab))
37        __vsymtab_end = .;
38        . = ALIGN(4);
39
40        /* section information for initial. */
41        . = ALIGN(4);
42        __rt_init_start = .;
43        KEEP(*(SORT(.rti_fn*)))
44        __rt_init_end = .;
45        . = ALIGN(4);
46
47        . = ALIGN(4);
48        _etext = .;
49    }
50
51    .eh_frame_hdr :
52    {
53         *(.eh_frame_hdr)
54         *(.eh_frame_entry)
55    }
56    .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
57
58    . = ALIGN(4);
59    .data :
60    {
61     *(.data)
62     *(.data.*)
63
64     *(.data1)
65     *(.data1.*)
66
67     . = ALIGN(8);
68     _gp = ABSOLUTE(.);     /* Base of small data */
69
70     *(.sdata)
71     *(.sdata.*)
72    }
73
74    . = ALIGN(4);
75    .ctors :
76    {
77        PROVIDE(__ctors_start__ = .);
78        /* new GCC version uses .init_array */
79        KEEP(*(SORT(.init_array.*)))
80        KEEP(*(.init_array))
81        PROVIDE(__ctors_end__ = .);
82    }
83
84    .dtors :
85    {
86        PROVIDE(__dtors_start__ = .);
87        KEEP(*(SORT(.dtors.*)))
88        KEEP(*(.dtors))
89        PROVIDE(__dtors_end__ = .);
90    }
91
92    . = ALIGN(4);
93    .bss :
94    {
95        PROVIDE(__bss_start = .);
96        *(.bss)
97        *(.bss.*)
98        *(.dynbss)
99        *(COMMON)
100        PROVIDE(__bss_end = .);
101    }
102    _end = .;
103
104    /* Stabs debugging sections.  */
105    .stab          0 : { *(.stab) }
106    .stabstr       0 : { *(.stabstr) }
107    .stab.excl     0 : { *(.stab.excl) }
108    .stab.exclstr  0 : { *(.stab.exclstr) }
109    .stab.index    0 : { *(.stab.index) }
110    .stab.indexstr 0 : { *(.stab.indexstr) }
111    .comment       0 : { *(.comment) }
112    /* DWARF debug sections.
113     * Symbols in the DWARF debugging sections are relative to the beginning
114     * of the section so we begin them at 0.  */
115    /* DWARF 1 */
116    .debug          0 : { *(.debug) }
117    .line           0 : { *(.line) }
118    /* GNU DWARF 1 extensions */
119    .debug_srcinfo  0 : { *(.debug_srcinfo) }
120    .debug_sfnames  0 : { *(.debug_sfnames) }
121    /* DWARF 1.1 and DWARF 2 */
122    .debug_aranges  0 : { *(.debug_aranges) }
123    .debug_pubnames 0 : { *(.debug_pubnames) }
124    /* DWARF 2 */
125    .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
126    .debug_abbrev   0 : { *(.debug_abbrev) }
127    .debug_line     0 : { *(.debug_line) }
128    .debug_frame    0 : { *(.debug_frame) }
129    .debug_str      0 : { *(.debug_str) }
130    .debug_loc      0 : { *(.debug_loc) }
131    .debug_macinfo  0 : { *(.debug_macinfo) }
132    /* SGI/MIPS DWARF 2 extensions */
133    .debug_weaknames 0 : { *(.debug_weaknames) }
134    .debug_funcnames 0 : { *(.debug_funcnames) }
135    .debug_typenames 0 : { *(.debug_typenames) }
136    .debug_varnames  0 : { *(.debug_varnames) }
137}
138