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
74 #ifndef CONFIG_XIP_KERNEL
75 __init_begin = _stext;
77 ARM_EXIT_KEEP(EXIT_DATA)
83 #ifndef CONFIG_XIP_KERNEL
89 * unwind exit sections must be discarded before the rest of the
90 * unwind sections get included.
93 *(.ARM.exidx.exit.text)
94 *(.ARM.extab.exit.text)
95 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
96 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
97 #ifndef CONFIG_HOTPLUG
98 *(.ARM.exidx.devexit.text)
99 *(.ARM.extab.devexit.text)
107 .text : { /* Real text segment */
108 _text = .; /* Text and read-only data */
109 __exception_text_start = .;
111 __exception_text_end = .;
126 *(.got) /* Global offset table */
127 ARM_CPU_KEEP(PROC_INFO)
132 #ifdef CONFIG_ARM_UNWIND
134 * Stack unwinding tables
138 __start_unwind_idx = .;
140 __stop_unwind_idx = .;
143 __start_unwind_tab = .;
145 __stop_unwind_tab = .;
149 _etext = .; /* End of text and rodata section */
151 #ifdef CONFIG_XIP_KERNEL
152 __data_loc = ALIGN(4); /* location in binary */
153 . = PAGE_OFFSET + TEXT_OFFSET;
155 . = ALIGN(THREAD_SIZE);
159 .data : AT(__data_loc) {
160 _data = .; /* address in memory */
164 * first, the init task union, aligned
165 * to an 8192 byte boundary.
167 INIT_TASK_DATA(THREAD_SIZE)
169 #ifdef CONFIG_XIP_KERNEL
170 . = ALIGN(PAGE_SIZE);
173 ARM_EXIT_KEEP(EXIT_DATA)
174 . = ALIGN(PAGE_SIZE);
179 CACHELINE_ALIGNED_DATA(32)
183 * The exception fixup table (might need resorting at runtime)
186 __start___ex_table = .;
190 __stop___ex_table = .;
193 * and the usual data section
200 _edata_loc = __data_loc + SIZEOF(.data);
202 #ifdef CONFIG_HAVE_TCM
204 * We align everything to a page boundary so we can
205 * free it after init has commenced and TCM contents have
206 * been copied to its destination.
209 . = ALIGN(PAGE_SIZE);
215 * Link these to the ITCM RAM
216 * Put VMA to the TCM address and LMA to the common RAM
217 * and we'll upload the contents from RAM to TCM and free
218 * the used RAM after that.
220 .text_itcm ITCM_OFFSET : AT(__itcm_start)
230 * Reset the dot pointer, this is needed to create the
231 * relative __dtcm_start below (to be used as extern in code).
233 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
239 /* TODO: add remainder of ITCM as well, that can be used for data! */
240 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
249 /* Reset the dot pointer or the linker gets confused */
250 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
252 /* End marker for freeing TCM copy in linked object */
253 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
254 . = ALIGN(PAGE_SIZE);
265 .comment 0 : { *(.comment) }
267 /* Default discards */
270 #ifndef CONFIG_SMP_ON_UP
278 * These must never be empty
279 * If you have to comment these two assert statements out, your
280 * binutils is too old (for other reasons as well)
282 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
283 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")