]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kernel.ux.ld
update
[l4.git] / kernel / fiasco / src / kernel.ux.ld
1
2 _load   = 0x10000;      /* kernel load address */
3
4 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
5 OUTPUT_ARCH(i386)
6 ENTRY(_start)
7 SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
8
9 SECTIONS {
10
11   . = _load + SIZEOF_HEADERS;
12
13   .rel.plt : {
14       *(.rel.plt)
15       PROVIDE_HIDDEN (__rel_iplt_start = .);
16       *(.rel.iplt)
17       PROVIDE_HIDDEN (__rel_iplt_end = .);
18   }
19
20   .init : {
21     _kernel_image_start = .;
22     KEEP (*(.init))
23   }
24   
25   .text : {
26     *(.text .stub .text.* .gnu.linkonce.t.*)
27   } = 0x90
28
29   PROVIDE (_ecode = .);
30
31   .fini : {
32     KEEP (*(.fini))
33   }
34
35   .rodata : {
36     *(.rodata .rodata.* .gnu.linkonce.r.*)
37     /* Discarding the build-id section will yield to an error from the
38      * linker so just put it here */
39     *(.note.gnu.build-id)
40   }
41
42   .preinit_array : {
43     PROVIDE (__preinit_array_start = .);
44     *(.preinit_array)
45     PROVIDE (__preinit_array_end = .);
46   }
47
48   /* 
49   .init_array : {
50     PROVIDE (__init_array_start = .);
51     KEEP (*(SORT (.init_array.*)))
52     KEEP (*(.init_array))
53     PROVIDE (__init_array_end = .);
54   }
55   */
56
57   .fini_array : {
58     PROVIDE (__fini_array_start = .);
59     *(.fini_array)
60     *(.fini_array.*)
61     PROVIDE (__fini_array_end = .);
62   }
63
64   PROVIDE (_etext = .);
65
66   . = ALIGN(4K);
67   .kip : { 
68     *(.kernel_info_page)
69     _initkip_start = .;
70     KEEP(*(.initkip.version))
71     KEEP(*(.initkip.features))
72     KEEP(*(.initkip.features.fini))
73     _initkip_end = .;
74     . = ALIGN(4K);
75   }
76
77   .data : {
78     PROVIDE (_kernel_data_start = .);
79     *(.data .data.* .gnu.linkonce.d.*)
80
81     __PER_CPU_INIT_ARRAY_START__ = .;
82     KEEP (*(.init_array.65534))
83     KEEP (*(.init_array.65533))
84     KEEP (*(.init_array.65532))
85     KEEP (*(.init_array.65531))
86     KEEP (*(.init_array.65530))
87     KEEP (*(.init_array.65529))
88     KEEP (*(.init_array.65528))
89     KEEP (*(.init_array.65527))
90     KEEP (*(.init_array.65526))
91     KEEP (*(.init_array.65525))
92     __PER_CPU_INIT_ARRAY_END__ = .;
93
94     __PER_CPU_LATE_INIT_ARRAY_START__ = .;
95     KEEP (*(.init_array.65524))
96     KEEP (*(.init_array.65523))
97     KEEP (*(.init_array.65522))
98     KEEP (*(.init_array.65521))
99     KEEP (*(.init_array.65520))
100     KEEP (*(.init_array.65519))
101     KEEP (*(.init_array.65518))
102     KEEP (*(.init_array.65517))
103     KEEP (*(.init_array.65516))
104     KEEP (*(.init_array.65515))
105     __PER_CPU_LATE_INIT_ARRAY_END__ = .;
106
107     __INIT_ARRAY_START__ = .;
108     PROVIDE (__init_array_start = .);
109     KEEP (*(SORT (.init_array.*)))
110     KEEP (*(.init_array))
111     PROVIDE (__init_array_end = .);
112     __INIT_ARRAY_END__ = .;
113     __CTOR_LIST__ = .;
114     __CTOR_END__ = .;
115
116     SORT (CONSTRUCTORS)
117
118     __PER_CPU_CTORS_END__ = .;
119     KEEP (*(.ctors.00010))
120     KEEP (*(.ctors.00009))
121     KEEP (*(.ctors.00008))
122     KEEP (*(.ctors.00007))
123     KEEP (*(.ctors.00006))
124     KEEP (*(.ctors.00005))
125     KEEP (*(.ctors.00004))
126     KEEP (*(.ctors.00003))
127     KEEP (*(.ctors.00002))
128     KEEP (*(.ctors.00001))
129     __PER_CPU_CTORS_LIST__ = .;
130
131     __PER_CPU_LATE_CTORS_END__ = .;
132     KEEP (*(.ctors.00020))
133     KEEP (*(.ctors.00019))
134     KEEP (*(.ctors.00018))
135     KEEP (*(.ctors.00017))
136     KEEP (*(.ctors.00016))
137     KEEP (*(.ctors.00015))
138     KEEP (*(.ctors.00014))
139     KEEP (*(.ctors.00013))
140     KEEP (*(.ctors.00012))
141     KEEP (*(.ctors.00011))
142     __PER_CPU_LATE_CTORS_LIST__ = .;
143
144     . = ALIGN(4);
145     PROVIDE (_log_table = .);
146     /*
147      * The section must start with ".debug" because else the linker
148      * complains about references to discarded sections
149      */
150     KEEP(*(SORT(.debug.jdb.log_table)))
151     PROVIDE (_log_table_end = .);
152   }
153
154   .tdata : {
155     *(.tdata .tdata.* .gnu.linkonce.td.*)
156   }
157   .tbss : {
158     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
159   }
160
161   .eh_frame         : { KEEP (*(.eh_frame)) }
162   .gcc_except_table : { *(.gcc_except_table) }
163
164   .ctors : {
165     KEEP (*crtbegin.o(.ctors))
166     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
167     KEEP (*(SORT(.ctors.*)))
168     KEEP (*(.ctors))
169   }
170
171   .dtors : {
172     KEEP (*crtbegin.o(.dtors))
173     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
174     KEEP (*(SORT(.dtors.*)))
175     KEEP (*(.dtors))
176   }
177
178   .got : {
179     *(.got.plt)
180     *(.got)
181   }
182
183   . = ALIGN(8);
184   .per_cpu_data : {
185     PROVIDE (_per_cpu_data_start = .);
186     *(.per_cpu.data)
187     . = ALIGN(8);
188     PROVIDE (_per_cpu_data_end = .);
189   }
190
191   PROVIDE (_edata = .);
192
193   . = ALIGN(4096);
194   .initcall : {
195     PROVIDE (_initcall_start = .);
196     *(.initcall.*)
197     . = ALIGN(4096);
198     PROVIDE (_initcall_end = .);
199   }
200
201   . = ALIGN(4096);
202   .bss : {                      /* Linux 2.2 requires BSS to be last */
203     *(.dynbss)
204     . = ALIGN(4);
205     _per_cpu_ctor_data_start = .;
206     KEEP (*(.bss.per_cpu_ctor_data))
207     _per_cpu_ctor_data_end = .;
208     *(.bss .bss.* .gnu.linkonce.b.*)
209     *(COMMON)
210   }
211
212   PROVIDE (_end = .);
213
214   /* make the kip_init code happy */
215   PROVIDE (_boot_sys_start = .);
216   PROVIDE (_boot_sys_end   = .);
217
218   /* make the construction.cc code happy w/o dtros */
219   PROVIDE (__DTOR_END__ = .);
220   PROVIDE (__DTOR_LIST__ = __DTOR_END__);
221
222   /DISCARD/ : {
223     *(.note)
224     *(.note.ABI-tag)
225     *(.comment)
226   }
227 }