wip, fb sync thread
[ginge.git] / loader / script_ia32.lds
CommitLineData
55fe8e70 1/* Script for -z combreloc: combine and sort reloc sections */
2OUTPUT_FORMAT("elf32-i386")
3OUTPUT_ARCH(i386)
4ENTRY(_start)
5SEARCH_DIR("/usr/local/lib32"); SEARCH_DIR("/lib32"); SEARCH_DIR("/usr/lib32");
6SECTIONS
7{
8 mybase = 0x70000000; /* 0x08048000 */
9 /* Read-only sections, merged into text segment: */
10 PROVIDE (__executable_start = SEGMENT_START("text-segment", mybase));
11 . = SEGMENT_START("text-segment", mybase) + SIZEOF_HEADERS;
12 .interp : { *(.interp) }
13 .note.gnu.build-id : { *(.note.gnu.build-id) }
14 .hash : { *(.hash) }
15 .gnu.hash : { *(.gnu.hash) }
16 .dynsym : { *(.dynsym) }
17 .dynstr : { *(.dynstr) }
18 .gnu.version : { *(.gnu.version) }
19 .gnu.version_d : { *(.gnu.version_d) }
20 .gnu.version_r : { *(.gnu.version_r) }
21 .rel.dyn :
22 {
23 *(.rel.init)
24 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
25 *(.rel.fini)
26 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
27 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
28 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
29 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
30 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
31 *(.rel.ctors)
32 *(.rel.dtors)
33 *(.rel.got)
34 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
35 *(.rel.ifunc)
36 }
37 .rel.plt :
38 {
39 *(.rel.plt)
40 PROVIDE_HIDDEN (__rel_iplt_start = .);
41 *(.rel.iplt)
42 PROVIDE_HIDDEN (__rel_iplt_end = .);
43 }
44 .init :
45 {
46 KEEP (*(.init))
47 } =0x90909090
48 .plt : { *(.plt) *(.iplt) }
49 .text :
50 {
51 *(.text.unlikely .text.*_unlikely)
52 *(.text .stub .text.* .gnu.linkonce.t.*)
53 /* .gnu.warning sections are handled specially by elf32.em. */
54 *(.gnu.warning)
55 } =0x90909090
56 .fini :
57 {
58 KEEP (*(.fini))
59 } =0x90909090
60 PROVIDE (__etext = .);
61 PROVIDE (_etext = .);
62 PROVIDE (etext = .);
63 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
64 .rodata1 : { *(.rodata1) }
65 .eh_frame_hdr : { *(.eh_frame_hdr) }
66 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
67 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
68 /* Adjust the address for the data segment. We want to adjust up to
69 the same address within the page on the next page up. */
70 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
71 /* Exception handling */
72 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
73 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
74 /* Thread Local Storage sections */
75 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
76 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
77 .preinit_array :
78 {
79 PROVIDE_HIDDEN (__preinit_array_start = .);
80 KEEP (*(.preinit_array))
81 PROVIDE_HIDDEN (__preinit_array_end = .);
82 }
83 .init_array :
84 {
85 PROVIDE_HIDDEN (__init_array_start = .);
86 KEEP (*(SORT(.init_array.*)))
87 KEEP (*(.init_array))
88 PROVIDE_HIDDEN (__init_array_end = .);
89 }
90 .fini_array :
91 {
92 PROVIDE_HIDDEN (__fini_array_start = .);
93 KEEP (*(.fini_array))
94 KEEP (*(SORT(.fini_array.*)))
95 PROVIDE_HIDDEN (__fini_array_end = .);
96 }
97 .ctors :
98 {
99 /* gcc uses crtbegin.o to find the start of
100 the constructors, so we make sure it is
101 first. Because this is a wildcard, it
102 doesn't matter if the user does not
103 actually link against crtbegin.o; the
104 linker won't look for a file to match a
105 wildcard. The wildcard also means that it
106 doesn't matter which directory crtbegin.o
107 is in. */
108 KEEP (*crtbegin.o(.ctors))
109 KEEP (*crtbegin?.o(.ctors))
110 /* We don't want to include the .ctor section from
111 the crtend.o file until after the sorted ctors.
112 The .ctor section from the crtend file contains the
113 end of ctors marker and it must be last */
114 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
115 KEEP (*(SORT(.ctors.*)))
116 KEEP (*(.ctors))
117 }
118 .dtors :
119 {
120 KEEP (*crtbegin.o(.dtors))
121 KEEP (*crtbegin?.o(.dtors))
122 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
123 KEEP (*(SORT(.dtors.*)))
124 KEEP (*(.dtors))
125 }
126 .jcr : { KEEP (*(.jcr)) }
127 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
128 .dynamic : { *(.dynamic) }
129 .got : { *(.got) *(.igot) }
130 . = DATA_SEGMENT_RELRO_END (12, .);
131 .got.plt : { *(.got.plt) *(.igot.plt) }
132 .data :
133 {
134 *(.data .data.* .gnu.linkonce.d.*)
135 SORT(CONSTRUCTORS)
136 }
137 .data1 : { *(.data1) }
138 _edata = .; PROVIDE (edata = .);
139 __bss_start = .;
140 .bss :
141 {
142 *(.dynbss)
143 *(.bss .bss.* .gnu.linkonce.b.*)
144 *(COMMON)
145 /* Align here to ensure that the .bss section occupies space up to
146 _end. Align after .bss to ensure correct alignment even if the
147 .bss section disappears because there are no input sections.
148 FIXME: Why do we need it? When there is no .bss section, we don't
149 pad the .data section. */
150 . = ALIGN(. != 0 ? 32 / 8 : 1);
151 }
152 . = ALIGN(32 / 8);
153 . = ALIGN(32 / 8);
154 _end = .; PROVIDE (end = .);
155 . = DATA_SEGMENT_END (.);
156 /* Stabs debugging sections. */
157 .stab 0 : { *(.stab) }
158 .stabstr 0 : { *(.stabstr) }
159 .stab.excl 0 : { *(.stab.excl) }
160 .stab.exclstr 0 : { *(.stab.exclstr) }
161 .stab.index 0 : { *(.stab.index) }
162 .stab.indexstr 0 : { *(.stab.indexstr) }
163 .comment 0 : { *(.comment) }
164 /* DWARF debug sections.
165 Symbols in the DWARF debugging sections are relative to the beginning
166 of the section so we begin them at 0. */
167 /* DWARF 1 */
168 .debug 0 : { *(.debug) }
169 .line 0 : { *(.line) }
170 /* GNU DWARF 1 extensions */
171 .debug_srcinfo 0 : { *(.debug_srcinfo) }
172 .debug_sfnames 0 : { *(.debug_sfnames) }
173 /* DWARF 1.1 and DWARF 2 */
174 .debug_aranges 0 : { *(.debug_aranges) }
175 .debug_pubnames 0 : { *(.debug_pubnames) }
176 /* DWARF 2 */
177 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
178 .debug_abbrev 0 : { *(.debug_abbrev) }
179 .debug_line 0 : { *(.debug_line) }
180 .debug_frame 0 : { *(.debug_frame) }
181 .debug_str 0 : { *(.debug_str) }
182 .debug_loc 0 : { *(.debug_loc) }
183 .debug_macinfo 0 : { *(.debug_macinfo) }
184 /* SGI/MIPS DWARF 2 extensions */
185 .debug_weaknames 0 : { *(.debug_weaknames) }
186 .debug_funcnames 0 : { *(.debug_funcnames) }
187 .debug_typenames 0 : { *(.debug_typenames) }
188 .debug_varnames 0 : { *(.debug_varnames) }
189 /* DWARF 3 */
190 .debug_pubtypes 0 : { *(.debug_pubtypes) }
191 .debug_ranges 0 : { *(.debug_ranges) }
192 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
193 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
194}
195