1 __stack = ORIGIN(dram_seg) + LENGTH(dram_seg);
2 __MIN_STACK_SIZE = 0x1000;
7 . = SEGMENT_START("iram_seg", 0);
10 _vector_table = ABSOLUTE(.);
12 KEEP(*(.WindowVectors.text));
14 KEEP(*(.Level2InterruptVector.text));
16 KEEP(*(.Level3InterruptVector.text));
18 KEEP(*(.Level4InterruptVector.text));
20 KEEP(*(.Level5InterruptVector.text));
22 KEEP(*(.DebugExceptionVector.text));
24 KEEP(*(.NMIExceptionVector.text));
26 KEEP(*(.KernelExceptionVector.text));
28 KEEP(*(.UserExceptionVector.text));
30 KEEP(*(.DoubleExceptionVector.text));
32 KEEP(*(.ResetVector.text));
39 KEEP (*(.init.literal))
40 KEEP (*(SORT_NONE(.init)))
41 *(.literal .text .stub .literal.* .text.* .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
42 /* .gnu.warning sections are handled specially by elf32.em. */
44 KEEP (*(.fini.literal))
45 KEEP (*(SORT_NONE(.fini)))
48 PROVIDE (__etext = .);
52 /* Adjust the address for the data segment. We want to adjust up to
53 the same address within the page on the next page up. */
54 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
58 *(.rodata .rodata.* .gnu.linkonce.r.*)
60 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
61 *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
66 PROVIDE_HIDDEN (__preinit_array_start = .);
67 KEEP (*(.preinit_array))
68 PROVIDE_HIDDEN (__preinit_array_end = .);
72 PROVIDE_HIDDEN (__init_array_start = .);
73 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
74 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
75 PROVIDE_HIDDEN (__init_array_end = .);
79 PROVIDE_HIDDEN (__fini_array_start = .);
80 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
81 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
82 PROVIDE_HIDDEN (__fini_array_end = .);
86 /* gcc uses crtbegin.o to find the start of
87 the constructors, so we make sure it is
88 first. Because this is a wildcard, it
89 doesn't matter if the user does not
90 actually link against crtbegin.o; the
91 linker won't look for a file to match a
92 wildcard. The wildcard also means that it
93 doesn't matter which directory crtbegin.o
95 KEEP (*crtbegin.o(.ctors))
96 KEEP (*crtbegin?.o(.ctors))
97 /* We don't want to include the .ctor section from
98 the crtend.o file until after the sorted ctors.
99 The .ctor section from the crtend file contains the
100 end of ctors marker and it must be last */
101 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
102 KEEP (*(SORT(.ctors.*)))
107 KEEP (*crtbegin.o(.dtors))
108 KEEP (*crtbegin?.o(.dtors))
109 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
110 KEEP (*(SORT(.dtors.*)))
117 *(.data .data.* .gnu.linkonce.d.*)
121 _edata = .; PROVIDE (edata = .);
127 *(.sbss .sbss.* .gnu.linkonce.sb.*)
130 *(.bss .bss.* .gnu.linkonce.b.*)
132 /* Align here to ensure that the .bss section occupies space up to
133 _end. Align after .bss to ensure correct alignment even if the
134 .bss section disappears because there are no input sections.
135 FIXME: Why do we need it? When there is no .bss section, we do not
136 pad the .data section. */
137 . = ALIGN(. != 0 ? 32 / 8 : 1);
141 _end = .; PROVIDE (end = .);
142 . = DATA_SEGMENT_END (.);
144 /* Check if data + heap + stack exceeds RAM limit */
145 ASSERT(. <= __stack - __MIN_STACK_SIZE, "region DRAM overflowed by .data and .bss sections")
147 /* Stabs debugging sections. */
148 .stab 0 : { *(.stab) }
149 .stabstr 0 : { *(.stabstr) }
150 .stab.excl 0 : { *(.stab.excl) }
151 .stab.exclstr 0 : { *(.stab.exclstr) }
152 .stab.index 0 : { *(.stab.index) }
153 .stab.indexstr 0 : { *(.stab.indexstr) }
154 .comment 0 : { *(.comment) }
155 .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
156 /* DWARF debug sections.
157 Symbols in the DWARF debugging sections are relative to the beginning
158 of the section so we begin them at 0. */
160 .debug 0 : { *(.debug) }
161 .line 0 : { *(.line) }
162 /* GNU DWARF 1 extensions */
163 .debug_srcinfo 0 : { *(.debug_srcinfo) }
164 .debug_sfnames 0 : { *(.debug_sfnames) }
165 /* DWARF 1.1 and DWARF 2 */
166 .debug_aranges 0 : { *(.debug_aranges) }
167 .debug_pubnames 0 : { *(.debug_pubnames) }
169 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
170 .debug_abbrev 0 : { *(.debug_abbrev) }
171 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
172 .debug_frame 0 : { *(.debug_frame) }
173 .debug_str 0 : { *(.debug_str) }
174 .debug_loc 0 : { *(.debug_loc) }
175 .debug_macinfo 0 : { *(.debug_macinfo) }
176 /* SGI/MIPS DWARF 2 extensions */
177 .debug_weaknames 0 : { *(.debug_weaknames) }
178 .debug_funcnames 0 : { *(.debug_funcnames) }
179 .debug_typenames 0 : { *(.debug_typenames) }
180 .debug_varnames 0 : { *(.debug_varnames) }
182 .debug_pubtypes 0 : { *(.debug_pubtypes) }
183 .debug_ranges 0 : { *(.debug_ranges) }
184 /* DWARF Extension. */
185 .debug_macro 0 : { *(.debug_macro) }
186 .debug_addr 0 : { *(.debug_addr) }
187 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
188 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }