]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kernel.ia32.ld
update
[l4.git] / kernel / fiasco / src / kernel.ia32.ld
1 /* -*- c -*- */
2
3 #include "globalconfig.h"
4 #include "linking.h"
5
6 _boot_sys_start = 0x300000;
7 _kernel_image   = FIASCO_IMAGE_VIRT_START;      /* kernel link address */
8 _load           = FIASCO_IMAGE_PHYS_START & 0x3fffff;
9 /*
10 _load           = 0x1000;       /* skip page 0 to preserve BIOS data and
11                                  * page 1 to reserve space for the KIP */
12
13 /*_fiasco_image_offset = 0xf0000000;*/
14 _fiasco_image_offset = FIASCO_IMAGE_PHYS_OFFSET;
15
16 ENTRY(bootstrap__boot_start)
17
18 PHDRS {
19   tramp PT_LOAD;
20   btext PT_LOAD;
21   bdata PT_LOAD;
22   kip PT_LOAD;
23   koptions PT_LOAD;
24   ktext PT_LOAD;
25   kdata PT_LOAD;
26   kitext PT_LOAD;
27   kidata PT_LOAD;
28 }
29
30 SECTIONS {
31   . = FIASCO_MP_TRAMP_PAGE;
32   .mp_tramp : {
33       KEEP(*(.mp_tramp))
34       . = ALIGN(0x1000);
35   } : tramp
36
37   . = _boot_sys_start;
38   .text_boot : ALIGN(0x1000) {
39     *(.bootstrap.text .bootstrap.text.* .bootstrap.gnu.linkonce.t.*)
40   } : btext
41   
42   . = ALIGN(0x10);
43   .bss_boot : {
44     *(.bootstrap.bss)
45   . = ALIGN(0x1000);
46   PROVIDE(_boot_sys_end = .);
47   } : bdata
48
49   . = _kernel_image + _load;
50
51   .kip : AT(ADDR(.kip) - _fiasco_image_offset) {
52     _kernel_image_start = .;
53     *(.kernel_info_page)
54     _initkip_start = .;
55     KEEP(*(.initkip.version))
56     KEEP(*(.initkip.features))
57     KEEP(*(.initkip.features.fini))
58     _initkip_end = .;
59     . = ALIGN(4K);
60   } : kip = 0
61
62   .koptions : AT (ADDR(.koptions) - _fiasco_image_offset) {
63     *(.koptions)
64   } : koptions = 0
65
66 #ifdef CONFIG_ALLOW_RO_TEXT
67   . = ALIGN(4K);
68 #endif
69   .text : AT (ADDR(.text) - _fiasco_image_offset) {
70     PROVIDE ( _kernel_text_start = . );
71     crt0.o(.text)
72     *(.init)
73     *(.text SORT(.text.*) .gnu.linkonce.t.*)
74     *(.fini)
75
76     PROVIDE (_ecode = .);
77
78     *(.rodata .rodata.* .gnu.linkonce.r.*)
79
80     . = ALIGN(4);
81     PROVIDE (_log_table = .);
82     /*
83      * The section must start with ".debug" because else the linker
84      * complains about references to discarded sections
85      */
86     KEEP(*(SORT(.debug.jdb.log_table)))
87     PROVIDE (_log_table_end = .);
88
89     . = ALIGN(0x40);
90
91     PROVIDE (_etext = .);
92   } : ktext = 0x90909090
93
94 #ifdef CONFIG_ALLOW_RO_TEXT
95   . = ALIGN(4K);
96 #else
97   . = ALIGN(0x10);
98 #endif
99   .data : AT (ADDR(.data) - _fiasco_image_offset) {
100     PROVIDE (_kernel_data_start = .);
101     *(.data .data.* .gnu.linkonce.d.*)
102     *(.anno)
103
104     /* Constructor and destructor lists, ordered by priority.  The lists
105        are traversed from end to start, therefore the *_END__ symbols
106        precede the *_LIST__ symbols. */
107
108     __PER_CPU_CTORS_END__ = .;
109     KEEP (*(.ctors.00010))
110     KEEP (*(.ctors.00009))
111     KEEP (*(.ctors.00008))
112     KEEP (*(.ctors.00007))
113     KEEP (*(.ctors.00006))
114     KEEP (*(.ctors.00005))
115     KEEP (*(.ctors.00004))
116     KEEP (*(.ctors.00003))
117     KEEP (*(.ctors.00002))
118     KEEP (*(.ctors.00001))
119     __PER_CPU_CTORS_LIST__ = .;
120
121     __PER_CPU_LATE_CTORS_END__ = .;
122     KEEP (*(.ctors.00020))
123     KEEP (*(.ctors.00019))
124     KEEP (*(.ctors.00018))
125     KEEP (*(.ctors.00017))
126     KEEP (*(.ctors.00016))
127     KEEP (*(.ctors.00015))
128     KEEP (*(.ctors.00014))
129     KEEP (*(.ctors.00013))
130     KEEP (*(.ctors.00012))
131     KEEP (*(.ctors.00011))
132     __PER_CPU_LATE_CTORS_LIST__ = .;
133
134     __CTOR_END__ = .;
135     CONSTRUCTORS
136     KEEP (*(.ctors))
137     KEEP (*(SORT (.ctors.*)))
138     __CTOR_LIST__ = .;
139
140     __DTOR_END__ = .;    
141     KEEP (*(SORT (.dtors.*)))
142     KEEP (*(.dtors))
143     __DTOR_LIST__ = .;
144
145     PROVIDE (_edata = .);
146   } : kdata
147
148   . = ALIGN(8);
149   .per_cpu_data : AT (ADDR(.per_cpu_data) - _fiasco_image_offset) {
150     PROVIDE (_per_cpu_data_start = .);
151     *(.per_cpu.data)
152     . = ALIGN(8);
153     PROVIDE (_per_cpu_data_end = .);
154   } : kdata
155
156   . = ALIGN(0x10);
157   .bss : AT (ADDR(.bss) - _fiasco_image_offset) {
158     PROVIDE (_bss_start = .);
159     *(.bss .bss.* .gnu.linkonce.b.* COMMON)
160     PROVIDE (_bss_end = .);
161   } : kdata
162
163   PROVIDE (_end = .);
164
165   . = ALIGN(4096);
166   PROVIDE (_initcall_start = .);
167   .initcall.text : AT (ADDR(.initcall.text) - _fiasco_image_offset) {
168     *(.initcall.text*)
169   } : kitext = 0x90909090
170
171   .initcall.data : AT (ADDR(.initcall.data) - _fiasco_image_offset) {
172     *(.initcall.data*)
173     . = ALIGN(4096);
174     PROVIDE (_initcall_end = .);
175   } : kidata
176
177   /DISCARD/ : {
178     *(.note)
179     *(.note.ABI-tag)
180     *(.comment)
181     *(.eh_frame)
182   }
183 }