]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kernel.arm.ld
update
[l4.git] / kernel / fiasco / src / kernel.arm.ld
1 /* -*- c -*- */
2
3 /* this file defines the construction of the kernel's virtual address
4    space */
5
6 _tcbs_1            = 0xd0000000;        /* assumption: 256MB-aligned */
7 /*_unused1_1         = _mappings_end_1; /* assumption: 4MB-aligned */
8 _unused2_1         = 0xea400000;        /* assumption: 4MB-aligned */
9 _unused3_1         = 0xea800000;        /* assumption: 4MB-aligned */
10 _service           = 0xeac00000;        /* assumption: 4MB-aligned */
11 /* 0xeb000000 - 0xee000000 unused */
12 _ipc_window0_1     = 0xee000000;        /* assumption: 8MB-aligned */
13 _ipc_window1_1     = 0xee800000;        /* assumption: 8MB-aligned */
14 /* 0xef000000 - 0xef800000 unused */
15 _kstatic1_1        = 0xef800000;        /* assumption: 4MB-aligned */
16 _iobitmap_1        = 0xefc00000;        /* assumption: 4MB-aligned */
17 _unused4_io_1      = 0xefc80000;        /* assumption: 2nd level field in 
18                                            page table for IO bitmap */
19 _physmem_1         = 0x0000000;         /* assumption: 256MB-aligned */
20 _kernel_phys_start = _physmem_1;
21 _kernel_phys_end   = 0xffffffff;
22
23
24 virt_address       = 0xf0000000;
25 phys_offset        = virt_address - kernel_load_addr;
26
27
28 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
29               "elf32-littlearm")
30 OUTPUT_ARCH(arm)
31 ENTRY(_start)
32
33 SECTIONS {
34
35
36   /DISCARD/ : {                 /* Exit code and data           */
37                 *(.exitcall.exit)
38               }
39               
40   . = kernel_load_addr + 0x1000;
41               
42   .text : {
43     bootstrap*(.init)
44     bootstrap*(.text .text.* .gnu.linkonce.t.*)
45     bootstrap*(.glue_7t) *(.glue_7)
46     bootstrap*(.got .got.*)
47     bootstrap*(.fini)
48     
49     bootstrap*(.rodata .rodata.* .gnu.linkonce.r.* .rodata1)
50
51     . = ALIGN(0x40);
52     
53     bootstrap*(.data .data.* .gnu.linkonce.d.*)
54     bootstrap*(.anno)
55
56     bootstrap*(.data) 
57     bootstrap*(.gnu.linkonce.d*)
58   }
59
60   PROVIDE(bootstrap_bss_start = .);
61   .bss_bootstrap : {
62     bootstrap*(.bss .bss.* COMMON .gnu.linkonce.b.*)
63   }
64   PROVIDE(bootstrap_bss_end = .);
65
66   . = ALIGN(4K);
67   end_of_loader = .;
68
69   . = end_of_loader - kernel_load_addr + virt_address;
70
71   .kip : AT (end_of_loader) {
72     _kernel_image_start = .;
73     *(.kernel_info_page)
74     _initkip_start = .;
75     KEEP(*(.initkip.version))
76     KEEP(*(.initkip.features))
77     KEEP(*(.initkip.features.fini))
78     _initkip_end = .;
79     . = ALIGN(4K);
80   }
81
82   .koptions : AT (ADDR(.koptions) - phys_offset) {
83     *(.koptions)
84   }
85
86   .mp_tramp : AT (ADDR(.mp_tramp) - phys_offset) {
87     KEEP(*(.mp_tramp))
88   }
89
90   .text_kernel : AT (ADDR(.text_kernel) - phys_offset) {
91     crt0.o(.text)
92     *(.init)
93     *(.text .text.* .gnu.linkonce.t.*)
94     *(.glue_7t) *(.glue_7)
95     *(.got .got.*)
96     *(.fini)
97
98     *(.text.jdb)
99      
100     PROVIDE (_ecode = .);
101
102     *(.rodata .rodata.* .gnu.linkonce.r.* .rodata1)
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     . = ALIGN(0x40);
114     
115     PROVIDE (_etext = .);
116
117     *(.data .data.* .gnu.linkonce.d.*)
118     *(.anno)
119
120     *(.data) 
121     *(.gnu.linkonce.d*)
122     *(.anno)
123     *(.data.jdb)
124
125     *(.init.data)
126
127 /* Constructor and destructor lists, ordered by priority.  The lists
128    are traversed from end to start, therefore the *_END__ symbols
129    precede the *_LIST__ symbols. */
130
131     __PER_CPU_CTORS_END__ = .;
132     KEEP (*(.ctors.00010))
133     KEEP (*(.ctors.00009))
134     KEEP (*(.ctors.00008))
135     KEEP (*(.ctors.00007))
136     KEEP (*(.ctors.00006))
137     KEEP (*(.ctors.00005))
138     KEEP (*(.ctors.00004))
139     KEEP (*(.ctors.00003))
140     KEEP (*(.ctors.00002))
141     KEEP (*(.ctors.00001))
142     __PER_CPU_CTORS_LIST__ = .;
143
144     __PER_CPU_LATE_CTORS_END__ = .;
145     KEEP (*(.ctors.00020))
146     KEEP (*(.ctors.00019))
147     KEEP (*(.ctors.00018))
148     KEEP (*(.ctors.00017))
149     KEEP (*(.ctors.00016))
150     KEEP (*(.ctors.00015))
151     KEEP (*(.ctors.00014))
152     KEEP (*(.ctors.00013))
153     KEEP (*(.ctors.00012))
154     KEEP (*(.ctors.00011))
155     __PER_CPU_LATE_CTORS_LIST__ = .;
156
157     __CTOR_END__ = .;
158     CONSTRUCTORS
159     KEEP (*(.ctors))
160     KEEP (*(SORT (.ctors.*)))
161     __CTOR_LIST__ = .;
162
163     __DTOR_END__ = .;    
164     KEEP (*(SORT(.dtors.*)))
165     KEEP (*(.dtors))
166     __DTOR_LIST__ = .;
167
168     PROVIDE(_edata  =  .);
169
170   }
171
172   . = ALIGN(8);
173   .per_cpu_data : AT (ADDR(.per_cpu_data) - phys_offset) {
174     PROVIDE (_per_cpu_data_start = .);
175     *(.per_cpu.data)
176     . = ALIGN(8);
177     PROVIDE (_per_cpu_data_end = .);
178   }
179
180   /* ARM AEABI */
181   . = ALIGN(8);
182   .ARM.exidx : { *(.ARM.exidx.*) }
183   .ARM.extab : { *(.ARM.extab.*) }
184
185
186
187   . = ALIGN(4K);
188   .bss : AT (ADDR(.bss) - phys_offset) {
189     PROVIDE(__bss_start = .);
190     *(.bss .bss.* COMMON .gnu.linkonce.b.*)
191     *(.bss.jdb)
192     PROVIDE(__bss_end = .);
193     . = ALIGN(4K);
194   }
195   __end_of_the_kernel = .;
196
197   ivt_start = ADDR(.bss) + SIZEOF(.bss) - phys_offset;
198   .excp 0xffff0000 : AT (ivt_start) {
199     *(.vect .excp.text)
200     *(.vect.extra)
201   }
202
203   . = __end_of_the_kernel + SIZEOF(.excp);
204
205   PROVIDE( _end = . );
206     
207   . = ALIGN(4K);
208   .initcall : AT(ADDR(.initcall) - phys_offset) {
209     _initcall_start = .;
210     *(.initcall.*)
211     . = ALIGN(4K);
212     _initcall_end = .;
213   } 
214
215   /DISCARD/ :{
216     *(.stab .stabstr .stab.excl .stab.exclstr)
217     *(.stab.index .stab.indexstr .comment)
218   }
219
220 }