]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kernel.ux.ld
72782296cab86db82faed7ba6cc82f169b8973c6
[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   .init_array : {
49     PROVIDE (__init_array_start = .);
50     *(.init_array)
51     PROVIDE (__init_array_end = .);
52   }
53
54   .fini_array : {
55     PROVIDE (__fini_array_start = .);
56     *(.fini_array)
57     PROVIDE (__fini_array_end = .);
58   }
59
60   PROVIDE (_etext = .);
61
62   . = ALIGN(4K);
63   .kip : { 
64     *(.kernel_info_page)
65     _initkip_start = .;
66     KEEP(*(.initkip.version))
67     KEEP(*(.initkip.features))
68     KEEP(*(.initkip.features.fini))
69     _initkip_end = .;
70     . = ALIGN(4K);
71   }
72
73   .data : {
74     PROVIDE (_kernel_data_start = .);
75     *(.data .data.* .gnu.linkonce.d.*)
76     SORT (CONSTRUCTORS)
77
78     __PER_CPU_CTORS_END__ = .;
79     KEEP (*(.ctors.00010))
80     KEEP (*(.ctors.00009))
81     KEEP (*(.ctors.00008))
82     KEEP (*(.ctors.00007))
83     KEEP (*(.ctors.00006))
84     KEEP (*(.ctors.00005))
85     KEEP (*(.ctors.00004))
86     KEEP (*(.ctors.00003))
87     KEEP (*(.ctors.00002))
88     KEEP (*(.ctors.00001))
89     __PER_CPU_CTORS_LIST__ = .;
90
91     . = ALIGN(4);
92     PROVIDE (_log_table = .);
93     /*
94      * The section must start with ".debug" because else the linker
95      * complains about references to discarded sections
96      */
97     KEEP(*(SORT(.debug.jdb.log_table)))
98     PROVIDE (_log_table_end = .);
99   }
100
101   .tdata : {
102     *(.tdata .tdata.* .gnu.linkonce.td.*)
103   }
104   .tbss : {
105     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
106   }
107
108   .eh_frame         : { KEEP (*(.eh_frame)) }
109   .gcc_except_table : { *(.gcc_except_table) }
110
111   .ctors : {
112     KEEP (*crtbegin.o(.ctors))
113     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
114     KEEP (*(SORT(.ctors.*)))
115     KEEP (*(.ctors))
116   }
117
118   .dtors : {
119     KEEP (*crtbegin.o(.dtors))
120     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
121     KEEP (*(SORT(.dtors.*)))
122     KEEP (*(.dtors))
123   }
124
125   .got : {
126     *(.got.plt)
127     *(.got)
128   }
129
130   . = ALIGN(8);
131   .per_cpu_data : {
132     PROVIDE (_per_cpu_data_start = .);
133     *(.per_cpu.data)
134     . = ALIGN(8);
135     PROVIDE (_per_cpu_data_end = .);
136   }
137
138   PROVIDE (_edata = .);
139
140   . = ALIGN(4096);
141   .initcall : {
142     PROVIDE (_initcall_start = .);
143     *(.initcall.*)
144     . = ALIGN(4096);
145     PROVIDE (_initcall_end = .);
146   }
147
148   . = ALIGN(4096);
149   .bss : {                      /* Linux 2.2 requires BSS to be last */
150     *(.dynbss)
151     *(.bss .bss.* .gnu.linkonce.b.*)
152     *(COMMON)
153   }
154
155   PROVIDE (_end = .);
156
157   /* make the kip_init code happy */
158   PROVIDE (_boot_sys_start = .);
159   PROVIDE (_boot_sys_end   = .);
160
161   /DISCARD/ : {
162     *(.note)
163     *(.note.ABI-tag)
164     *(.comment)
165   }
166 }