]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kernel.arm.ld
c629433889edd0effb162313622322778606d875
[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     __CTOR_END__ = .;
141     CONSTRUCTORS
142     KEEP (*(.ctors))
143     KEEP (*(SORT (.ctors.*)))
144     __CTOR_LIST__ = .;
145
146     __DTOR_END__ = .;    
147     KEEP (*(SORT(.dtors.*)))
148     KEEP (*(.dtors))
149     __DTOR_LIST__ = .;
150
151     PROVIDE(_edata  =  .);
152
153   }
154
155   . = ALIGN(8);
156   .per_cpu_data : AT (ADDR(.per_cpu_data) - phys_offset) {
157     PROVIDE (_per_cpu_data_start = .);
158     *(.per_cpu.data)
159     . = ALIGN(8);
160     PROVIDE (_per_cpu_data_end = .);
161   }
162
163   /* ARM AEABI */
164   . = ALIGN(8);
165   .ARM.exidx : { *(.ARM.exidx.*) }
166   .ARM.extab : { *(.ARM.extab.*) }
167
168
169
170   . = ALIGN(4K);
171   .bss : AT (ADDR(.bss) - phys_offset) {
172     PROVIDE(__bss_start = .);
173     *(.bss .bss.* COMMON .gnu.linkonce.b.*)
174     *(.bss.jdb)
175     PROVIDE(__bss_end = .);
176     . = ALIGN(4K);
177   }
178   __end_of_the_kernel = .;
179
180   ivt_start = ADDR(.bss) + SIZEOF(.bss) - phys_offset;
181   .excp 0xffff0000 : AT (ivt_start) {
182     *(.vect .excp.text)
183     *(.vect.extra)
184   }
185
186   . = __end_of_the_kernel + SIZEOF(.excp);
187
188   PROVIDE( _end = . );
189     
190   . = ALIGN(4K);
191   .initcall : AT(ADDR(.initcall) - phys_offset) {
192     _initcall_start = .;
193     *(.initcall.*)
194     . = ALIGN(4K);
195     _initcall_end = .;
196   } 
197
198   /DISCARD/ :{
199     *(.stab .stabstr .stab.excl .stab.exclstr)
200     *(.stab.index .stab.indexstr .comment)
201   }
202
203 }