]> 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   .mp_tramp : AT (ADDR(.mp_tramp) - phys_offset) {
83     KEEP(*(.mp_tramp))
84   }
85
86   .text_kernel : AT (ADDR(.text_kernel) - phys_offset) {
87     crt0.o(.text)
88     *(.init)
89     *(.text .text.* .gnu.linkonce.t.*)
90     *(.glue_7t) *(.glue_7)
91     *(.got .got.*)
92     *(.fini)
93
94     *(.text.jdb)
95      
96     PROVIDE (_ecode = .);
97
98     *(.rodata .rodata.* .gnu.linkonce.r.* .rodata1)
99
100     . = ALIGN(4);
101     PROVIDE (_log_table = .);
102     /*
103      * The section must start with ".debug" because else the linker
104      * complains about references to discarded sections
105      */
106     KEEP(*(SORT(.debug.jdb.log_table)))
107     PROVIDE (_log_table_end = .);
108
109     . = ALIGN(0x40);
110     
111     PROVIDE (_etext = .);
112
113     *(.data .data.* .gnu.linkonce.d.*)
114     *(.anno)
115
116     *(.data) 
117     *(.gnu.linkonce.d*)
118     *(.anno)
119     *(.data.jdb)
120
121     *(.init.data)
122
123 /* Constructor and destructor lists, ordered by priority.  The lists
124    are traversed from end to start, therefore the *_END__ symbols
125    precede the *_LIST__ symbols. */
126
127     __PER_CPU_CTORS_END__ = .;
128     KEEP (*(.ctors.00010))
129     KEEP (*(.ctors.00009))
130     KEEP (*(.ctors.00008))
131     KEEP (*(.ctors.00007))
132     KEEP (*(.ctors.00006))
133     KEEP (*(.ctors.00005))
134     KEEP (*(.ctors.00004))
135     KEEP (*(.ctors.00003))
136     KEEP (*(.ctors.00002))
137     KEEP (*(.ctors.00001))
138     __PER_CPU_CTORS_LIST__ = .;
139
140     __PER_CPU_LATE_CTORS_END__ = .;
141     KEEP (*(.ctors.00020))
142     KEEP (*(.ctors.00019))
143     KEEP (*(.ctors.00018))
144     KEEP (*(.ctors.00017))
145     KEEP (*(.ctors.00016))
146     KEEP (*(.ctors.00015))
147     KEEP (*(.ctors.00014))
148     KEEP (*(.ctors.00013))
149     KEEP (*(.ctors.00012))
150     KEEP (*(.ctors.00011))
151     __PER_CPU_LATE_CTORS_LIST__ = .;
152
153     __CTOR_END__ = .;
154     CONSTRUCTORS
155     KEEP (*(.ctors))
156     KEEP (*(SORT (.ctors.*)))
157     __CTOR_LIST__ = .;
158
159     __DTOR_END__ = .;    
160     KEEP (*(SORT(.dtors.*)))
161     KEEP (*(.dtors))
162     __DTOR_LIST__ = .;
163
164     PROVIDE(_edata  =  .);
165
166   }
167
168   . = ALIGN(8);
169   .per_cpu_data : AT (ADDR(.per_cpu_data) - phys_offset) {
170     PROVIDE (_per_cpu_data_start = .);
171     *(.per_cpu.data)
172     . = ALIGN(8);
173     PROVIDE (_per_cpu_data_end = .);
174   }
175
176   /* ARM AEABI */
177   . = ALIGN(8);
178   .ARM.exidx : { *(.ARM.exidx.*) }
179   .ARM.extab : { *(.ARM.extab.*) }
180
181
182
183   . = ALIGN(4K);
184   .bss : AT (ADDR(.bss) - phys_offset) {
185     PROVIDE(__bss_start = .);
186     *(.bss .bss.* COMMON .gnu.linkonce.b.*)
187     *(.bss.jdb)
188     PROVIDE(__bss_end = .);
189     . = ALIGN(4K);
190   }
191   __end_of_the_kernel = .;
192
193   ivt_start = ADDR(.bss) + SIZEOF(.bss) - phys_offset;
194   .excp 0xffff0000 : AT (ivt_start) {
195     *(.vect .excp.text)
196     *(.vect.extra)
197   }
198
199   . = __end_of_the_kernel + SIZEOF(.excp);
200
201   PROVIDE( _end = . );
202     
203   . = ALIGN(4K);
204   .initcall : AT(ADDR(.initcall) - phys_offset) {
205     _initcall_start = .;
206     *(.initcall.*)
207     . = ALIGN(4K);
208     _initcall_end = .;
209   } 
210
211   /DISCARD/ :{
212     *(.stab .stabstr .stab.excl .stab.exclstr)
213     *(.stab.index .stab.indexstr .comment)
214   }
215
216 }