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) = .;
18 VMLINUX_SYMBOL(__idmap_text_start) = .; \
20 VMLINUX_SYMBOL(__idmap_text_end) = .;
22 #ifdef CONFIG_HOTPLUG_CPU
23 #define ARM_CPU_DISCARD(x)
24 #define ARM_CPU_KEEP(x) x
26 #define ARM_CPU_DISCARD(x) x
27 #define ARM_CPU_KEEP(x)
30 #if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \
31 defined(CONFIG_GENERIC_BUG)
32 #define ARM_EXIT_KEEP(x) x
33 #define ARM_EXIT_DISCARD(x)
35 #define ARM_EXIT_KEEP(x)
36 #define ARM_EXIT_DISCARD(x) x
45 jiffies = jiffies_64 + 4;
51 * XXX: The linker does not define how output sections are
52 * assigned to input sections when there are multiple statements
53 * matching the same input section name. There is no documented
56 * unwind exit sections must be discarded before the rest of the
57 * unwind sections get included.
60 *(.ARM.exidx.exit.text)
61 *(.ARM.extab.exit.text)
62 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
63 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
64 ARM_EXIT_DISCARD(EXIT_TEXT)
65 ARM_EXIT_DISCARD(EXIT_DATA)
67 #ifndef CONFIG_HOTPLUG
68 *(.ARM.exidx.devexit.text)
69 *(.ARM.extab.devexit.text)
75 #ifndef CONFIG_SMP_ON_UP
82 #ifdef CONFIG_XIP_KERNEL
83 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
85 . = PAGE_OFFSET + TEXT_OFFSET;
91 .text : { /* Real text segment */
92 _stext = .; /* Text and read-only data */
93 __exception_text_start = .;
95 __exception_text_end = .;
109 *(.got) /* Global offset table */
110 ARM_CPU_KEEP(PROC_INFO)
115 #ifdef CONFIG_ARM_UNWIND
117 * Stack unwinding tables
121 __start_unwind_idx = .;
123 __stop_unwind_idx = .;
126 __start_unwind_tab = .;
128 __stop_unwind_tab = .;
132 _etext = .; /* End of text and rodata section */
134 #ifndef CONFIG_XIP_KERNEL
135 . = ALIGN(PAGE_SIZE);
141 ARM_EXIT_KEEP(EXIT_TEXT)
144 ARM_CPU_DISCARD(PROC_INFO)
147 __arch_info_begin = .;
152 __tagtable_begin = .;
156 #ifdef CONFIG_SMP_ON_UP
164 __pv_table_begin = .;
169 #ifndef CONFIG_XIP_KERNEL
178 #ifndef CONFIG_XIP_KERNEL
180 ARM_EXIT_KEEP(EXIT_DATA)
186 #ifdef CONFIG_XIP_KERNEL
187 __data_loc = ALIGN(4); /* location in binary */
188 . = PAGE_OFFSET + TEXT_OFFSET;
191 . = ALIGN(THREAD_SIZE);
195 .data : AT(__data_loc) {
196 _data = .; /* address in memory */
200 * first, the init task union, aligned
201 * to an 8192 byte boundary.
203 INIT_TASK_DATA(THREAD_SIZE)
205 #ifdef CONFIG_XIP_KERNEL
206 . = ALIGN(PAGE_SIZE);
209 ARM_EXIT_KEEP(EXIT_DATA)
210 . = ALIGN(PAGE_SIZE);
215 CACHELINE_ALIGNED_DATA(32)
219 * The exception fixup table (might need resorting at runtime)
222 __start___ex_table = .;
226 __stop___ex_table = .;
229 * and the usual data section
236 _edata_loc = __data_loc + SIZEOF(.data);
238 #ifdef CONFIG_HAVE_TCM
240 * We align everything to a page boundary so we can
241 * free it after init has commenced and TCM contents have
242 * been copied to its destination.
245 . = ALIGN(PAGE_SIZE);
251 * Link these to the ITCM RAM
252 * Put VMA to the TCM address and LMA to the common RAM
253 * and we'll upload the contents from RAM to TCM and free
254 * the used RAM after that.
256 .text_itcm ITCM_OFFSET : AT(__itcm_start)
266 * Reset the dot pointer, this is needed to create the
267 * relative __dtcm_start below (to be used as extern in code).
269 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
275 /* TODO: add remainder of ITCM as well, that can be used for data! */
276 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
285 /* Reset the dot pointer or the linker gets confused */
286 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
288 /* End marker for freeing TCM copy in linked object */
289 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
290 . = ALIGN(PAGE_SIZE);
301 .comment 0 : { *(.comment) }
305 * These must never be empty
306 * If you have to comment these two assert statements out, your
307 * binutils is too old (for other reasons as well)
309 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
310 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")