]> 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   .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     __PER_CPU_LATE_CTORS_END__ = .;
92     KEEP (*(.ctors.00020))
93     KEEP (*(.ctors.00019))
94     KEEP (*(.ctors.00018))
95     KEEP (*(.ctors.00017))
96     KEEP (*(.ctors.00016))
97     KEEP (*(.ctors.00015))
98     KEEP (*(.ctors.00014))
99     KEEP (*(.ctors.00013))
100     KEEP (*(.ctors.00012))
101     KEEP (*(.ctors.00011))
102     __PER_CPU_LATE_CTORS_LIST__ = .;
103
104     . = ALIGN(4);
105     PROVIDE (_log_table = .);
106     /*
107      * The section must start with ".debug" because else the linker
108      * complains about references to discarded sections
109      */
110     KEEP(*(SORT(.debug.jdb.log_table)))
111     PROVIDE (_log_table_end = .);
112   }
113
114   .tdata : {
115     *(.tdata .tdata.* .gnu.linkonce.td.*)
116   }
117   .tbss : {
118     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
119   }
120
121   .eh_frame         : { KEEP (*(.eh_frame)) }
122   .gcc_except_table : { *(.gcc_except_table) }
123
124   .ctors : {
125     KEEP (*crtbegin.o(.ctors))
126     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
127     KEEP (*(SORT(.ctors.*)))
128     KEEP (*(.ctors))
129   }
130
131   .dtors : {
132     KEEP (*crtbegin.o(.dtors))
133     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
134     KEEP (*(SORT(.dtors.*)))
135     KEEP (*(.dtors))
136   }
137
138   .got : {
139     *(.got.plt)
140     *(.got)
141   }
142
143   . = ALIGN(8);
144   .per_cpu_data : {
145     PROVIDE (_per_cpu_data_start = .);
146     *(.per_cpu.data)
147     . = ALIGN(8);
148     PROVIDE (_per_cpu_data_end = .);
149   }
150
151   PROVIDE (_edata = .);
152
153   . = ALIGN(4096);
154   .initcall : {
155     PROVIDE (_initcall_start = .);
156     *(.initcall.*)
157     . = ALIGN(4096);
158     PROVIDE (_initcall_end = .);
159   }
160
161   . = ALIGN(4096);
162   .bss : {                      /* Linux 2.2 requires BSS to be last */
163     *(.dynbss)
164     *(.bss .bss.* .gnu.linkonce.b.*)
165     *(COMMON)
166   }
167
168   PROVIDE (_end = .);
169
170   /* make the kip_init code happy */
171   PROVIDE (_boot_sys_start = .);
172   PROVIDE (_boot_sys_end   = .);
173
174   /DISCARD/ : {
175     *(.note)
176     *(.note.ABI-tag)
177     *(.comment)
178   }
179 }