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)
24 #if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
25 #define ARM_EXIT_KEEP(x) x
27 #define ARM_EXIT_KEEP(x)
36 jiffies = jiffies_64 + 4;
41 #ifdef CONFIG_XIP_KERNEL
42 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
44 . = PAGE_OFFSET + TEXT_OFFSET;
47 .init : { /* Init code and data */
52 ARM_EXIT_KEEP(EXIT_TEXT)
54 ARM_CPU_DISCARD(PROC_INFO)
55 __arch_info_begin = .;
61 #ifdef CONFIG_SMP_ON_UP
78 #ifndef CONFIG_XIP_KERNEL
79 __init_begin = _stext;
81 ARM_EXIT_KEEP(EXIT_DATA)
87 #ifndef CONFIG_XIP_KERNEL
93 * unwind exit sections must be discarded before the rest of the
94 * unwind sections get included.
97 *(.ARM.exidx.exit.text)
98 *(.ARM.extab.exit.text)
99 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
100 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
101 #ifndef CONFIG_HOTPLUG
102 *(.ARM.exidx.devexit.text)
103 *(.ARM.extab.devexit.text)
111 .text : { /* Real text segment */
112 _text = .; /* Text and read-only data */
113 __exception_text_start = .;
115 __exception_text_end = .;
130 *(.got) /* Global offset table */
131 ARM_CPU_KEEP(PROC_INFO)
136 #ifdef CONFIG_ARM_UNWIND
138 * Stack unwinding tables
142 __start_unwind_idx = .;
144 __stop_unwind_idx = .;
147 __start_unwind_tab = .;
149 __stop_unwind_tab = .;
153 _etext = .; /* End of text and rodata section */
155 #ifdef CONFIG_XIP_KERNEL
156 __data_loc = ALIGN(4); /* location in binary */
157 . = PAGE_OFFSET + TEXT_OFFSET;
159 . = ALIGN(THREAD_SIZE);
163 .data : AT(__data_loc) {
164 _data = .; /* address in memory */
168 * first, the init task union, aligned
169 * to an 8192 byte boundary.
171 INIT_TASK_DATA(THREAD_SIZE)
173 #ifdef CONFIG_XIP_KERNEL
174 . = ALIGN(PAGE_SIZE);
177 ARM_EXIT_KEEP(EXIT_DATA)
178 . = ALIGN(PAGE_SIZE);
183 CACHELINE_ALIGNED_DATA(32)
187 * The exception fixup table (might need resorting at runtime)
190 __start___ex_table = .;
194 __stop___ex_table = .;
197 * and the usual data section
204 _edata_loc = __data_loc + SIZEOF(.data);
206 #ifdef CONFIG_HAVE_TCM
208 * We align everything to a page boundary so we can
209 * free it after init has commenced and TCM contents have
210 * been copied to its destination.
213 . = ALIGN(PAGE_SIZE);
219 * Link these to the ITCM RAM
220 * Put VMA to the TCM address and LMA to the common RAM
221 * and we'll upload the contents from RAM to TCM and free
222 * the used RAM after that.
224 .text_itcm ITCM_OFFSET : AT(__itcm_start)
234 * Reset the dot pointer, this is needed to create the
235 * relative __dtcm_start below (to be used as extern in code).
237 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
243 /* TODO: add remainder of ITCM as well, that can be used for data! */
244 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
253 /* Reset the dot pointer or the linker gets confused */
254 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
256 /* End marker for freeing TCM copy in linked object */
257 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
258 . = ALIGN(PAGE_SIZE);
269 .comment 0 : { *(.comment) }
271 /* Default discards */
274 #ifndef CONFIG_SMP_ON_UP
282 * These must never be empty
283 * If you have to comment these two assert statements out, your
284 * binutils is too old (for other reasons as well)
286 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
287 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")