1 #include <asm-generic/barebox.lds.h>
3 OUTPUT_FORMAT(ELF_FORMAT)
9 /* Read-only sections, merged into text segment: */
10 PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;
11 .interp : { *(.interp) }
13 .gnu.hash : { *(.gnu.hash) }
14 .dynsym : { *(.dynsym) }
15 .dynstr : { *(.dynstr) }
16 .gnu.version : { *(.gnu.version) }
17 .gnu.version_d : { *(.gnu.version_d) }
18 .gnu.version_r : { *(.gnu.version_r) }
22 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
24 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
25 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
26 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
27 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
28 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
32 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
33 *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)
34 *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)
35 *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)
40 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
42 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
43 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
44 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
45 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
49 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
50 *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
51 *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
52 *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
54 .rel.plt : { *(.rel.plt) }
55 .rela.plt : { *(.rela.plt) }
63 *(.text .stub .text.* .gnu.linkonce.t.*)
64 KEEP (*(.text.*personality*))
65 /* .gnu.warning sections are handled specially by elf32.em. */
74 __barebox_initcalls_start = .;
75 __barebox_initcalls : { INITCALLS }
76 __barebox_initcalls_end = .;
78 __barebox_cmd_start = .;
79 __barebox_cmd : { BAREBOX_CMDS }
80 __barebox_cmd_end = .;
82 PROVIDE (__etext = .);
85 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
86 .rodata1 : { *(.rodata1) }
87 .eh_frame_hdr : { *(.eh_frame_hdr) }
88 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
89 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
90 /* Adjust the address for the data segment. We want to adjust up to
91 the same address within the page on the next page up. */
92 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
93 /* Exception handling */
94 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
95 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
96 /* Thread Local Storage sections */
97 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
98 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
101 PROVIDE_HIDDEN (__preinit_array_start = .);
102 KEEP (*(.preinit_array))
103 PROVIDE_HIDDEN (__preinit_array_end = .);
107 PROVIDE_HIDDEN (__init_array_start = .);
108 KEEP (*(SORT(.init_array.*)))
109 KEEP (*(.init_array))
110 PROVIDE_HIDDEN (__init_array_end = .);
114 PROVIDE_HIDDEN (__fini_array_start = .);
115 KEEP (*(.fini_array))
116 KEEP (*(SORT(.fini_array.*)))
117 PROVIDE_HIDDEN (__fini_array_end = .);
121 /* gcc uses crtbegin.o to find the start of
122 the constructors, so we make sure it is
123 first. Because this is a wildcard, it
124 doesn't matter if the user does not
125 actually link against crtbegin.o; the
126 linker won't look for a file to match a
127 wildcard. The wildcard also means that it
128 doesn't matter which directory crtbegin.o
130 KEEP (*crtbegin.o(.ctors))
131 KEEP (*crtbegin?.o(.ctors))
132 /* We don't want to include the .ctor section from
133 the crtend.o file until after the sorted ctors.
134 The .ctor section from the crtend file contains the
135 end of ctors marker and it must be last */
136 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
137 KEEP (*(SORT(.ctors.*)))
142 KEEP (*crtbegin.o(.dtors))
143 KEEP (*crtbegin?.o(.dtors))
144 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
145 KEEP (*(SORT(.dtors.*)))
148 .jcr : { KEEP (*(.jcr)) }
149 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
150 .dynamic : { *(.dynamic) }
152 . = DATA_SEGMENT_RELRO_END (24, .);
153 .got.plt : { *(.got.plt) }
156 *(.data .data.* .gnu.linkonce.d.*)
157 KEEP (*(.gnu.linkonce.d.*personality*))
160 .data1 : { *(.data1) }
161 _edata = .; PROVIDE (edata = .);
166 *(.bss .bss.* .gnu.linkonce.b.*)
168 /* Align here to ensure that the .bss section occupies space up to
169 _end. Align after .bss to ensure correct alignment even if the
170 .bss section disappears because there are no input sections.
171 FIXME: Why do we need it? When there is no .bss section, we don't
172 pad the .data section. */
173 . = ALIGN(. != 0 ? 64 / 8 : 1);
178 *(.lbss .lbss.* .gnu.linkonce.lb.*)
182 .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
184 *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
186 .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
188 *(.ldata .ldata.* .gnu.linkonce.l.*)
189 . = ALIGN(. != 0 ? 64 / 8 : 1);
192 _end = .; PROVIDE (end = .);
193 . = DATA_SEGMENT_END (.);
194 /* Stabs debugging sections. */
195 .stab 0 : { *(.stab) }
196 .stabstr 0 : { *(.stabstr) }
197 .stab.excl 0 : { *(.stab.excl) }
198 .stab.exclstr 0 : { *(.stab.exclstr) }
199 .stab.index 0 : { *(.stab.index) }
200 .stab.indexstr 0 : { *(.stab.indexstr) }
201 .comment 0 : { *(.comment) }
202 /* DWARF debug sections.
203 Symbols in the DWARF debugging sections are relative to the beginning
204 of the section so we begin them at 0. */
206 .debug 0 : { *(.debug) }
207 .line 0 : { *(.line) }
208 /* GNU DWARF 1 extensions */
209 .debug_srcinfo 0 : { *(.debug_srcinfo) }
210 .debug_sfnames 0 : { *(.debug_sfnames) }
211 /* DWARF 1.1 and DWARF 2 */
212 .debug_aranges 0 : { *(.debug_aranges) }
213 .debug_pubnames 0 : { *(.debug_pubnames) }
215 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
216 .debug_abbrev 0 : { *(.debug_abbrev) }
217 .debug_line 0 : { *(.debug_line) }
218 .debug_frame 0 : { *(.debug_frame) }
219 .debug_str 0 : { *(.debug_str) }
220 .debug_loc 0 : { *(.debug_loc) }
221 .debug_macinfo 0 : { *(.debug_macinfo) }
222 /* SGI/MIPS DWARF 2 extensions */
223 .debug_weaknames 0 : { *(.debug_weaknames) }
224 .debug_funcnames 0 : { *(.debug_funcnames) }
225 .debug_typenames 0 : { *(.debug_typenames) }
226 .debug_varnames 0 : { *(.debug_varnames) }
227 /DISCARD/ : { *(.note.GNU-stack) }