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