1 /* ld script to make ARM Linux kernel
2 * taken from the i386 version by Russell King
3 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
6 #include <asm-generic/vmlinux.lds.h>
7 #include <asm/thread_info.h>
8 #include <asm/memory.h>
12 VMLINUX_SYMBOL(__proc_info_begin) = .; \
14 VMLINUX_SYMBOL(__proc_info_end) = .;
16 #ifdef CONFIG_HOTPLUG_CPU
17 #define ARM_CPU_DISCARD(x)
18 #define ARM_CPU_KEEP(x) x
20 #define ARM_CPU_DISCARD(x) x
21 #define ARM_CPU_KEEP(x)
30 jiffies = jiffies_64 + 4;
35 #ifdef CONFIG_XIP_KERNEL
36 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
38 . = PAGE_OFFSET + TEXT_OFFSET;
41 .init : { /* Init code and data */
47 ARM_CPU_DISCARD(PROC_INFO)
48 __arch_info_begin = .;
54 #ifdef CONFIG_SMP_ON_UP
67 #ifndef CONFIG_XIP_KERNEL
68 __init_begin = _stext;
75 #ifndef CONFIG_XIP_KERNEL
81 * unwind exit sections must be discarded before the rest of the
82 * unwind sections get included.
85 *(.ARM.exidx.exit.text)
86 *(.ARM.extab.exit.text)
87 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
88 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
89 #ifndef CONFIG_HOTPLUG
90 *(.ARM.exidx.devexit.text)
91 *(.ARM.extab.devexit.text)
99 .text : { /* Real text segment */
100 _text = .; /* Text and read-only data */
101 __exception_text_start = .;
103 __exception_text_end = .;
118 *(.got) /* Global offset table */
119 ARM_CPU_KEEP(PROC_INFO)
124 #ifdef CONFIG_ARM_UNWIND
126 * Stack unwinding tables
130 __start_unwind_idx = .;
132 __stop_unwind_idx = .;
135 __start_unwind_tab = .;
137 __stop_unwind_tab = .;
141 _etext = .; /* End of text and rodata section */
143 #ifdef CONFIG_XIP_KERNEL
144 __data_loc = ALIGN(4); /* location in binary */
145 . = PAGE_OFFSET + TEXT_OFFSET;
147 . = ALIGN(THREAD_SIZE);
151 .data : AT(__data_loc) {
152 _data = .; /* address in memory */
156 * first, the init task union, aligned
157 * to an 8192 byte boundary.
159 INIT_TASK_DATA(THREAD_SIZE)
161 #ifdef CONFIG_XIP_KERNEL
162 . = ALIGN(PAGE_SIZE);
165 . = ALIGN(PAGE_SIZE);
170 CACHELINE_ALIGNED_DATA(32)
174 * The exception fixup table (might need resorting at runtime)
177 __start___ex_table = .;
181 __stop___ex_table = .;
184 * and the usual data section
191 _edata_loc = __data_loc + SIZEOF(.data);
193 #ifdef CONFIG_HAVE_TCM
195 * We align everything to a page boundary so we can
196 * free it after init has commenced and TCM contents have
197 * been copied to its destination.
200 . = ALIGN(PAGE_SIZE);
206 * Link these to the ITCM RAM
207 * Put VMA to the TCM address and LMA to the common RAM
208 * and we'll upload the contents from RAM to TCM and free
209 * the used RAM after that.
211 .text_itcm ITCM_OFFSET : AT(__itcm_start)
221 * Reset the dot pointer, this is needed to create the
222 * relative __dtcm_start below (to be used as extern in code).
224 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
230 /* TODO: add remainder of ITCM as well, that can be used for data! */
231 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
240 /* Reset the dot pointer or the linker gets confused */
241 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
243 /* End marker for freeing TCM copy in linked object */
244 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
245 . = ALIGN(PAGE_SIZE);
254 .comment 0 : { *(.comment) }
256 /* Default discards */
259 #ifndef CONFIG_SMP_ON_UP
267 * These must never be empty
268 * If you have to comment these two assert statements out, your
269 * binutils is too old (for other reasons as well)
271 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
272 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")