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
26 #define ARM_EXIT_DISCARD(x)
28 #define ARM_EXIT_KEEP(x)
29 #define ARM_EXIT_DISCARD(x) x
38 jiffies = jiffies_64 + 4;
44 * XXX: The linker does not define how output sections are
45 * assigned to input sections when there are multiple statements
46 * matching the same input section name. There is no documented
49 * unwind exit sections must be discarded before the rest of the
50 * unwind sections get included.
53 *(.ARM.exidx.exit.text)
54 *(.ARM.extab.exit.text)
55 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
56 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
57 ARM_EXIT_DISCARD(EXIT_TEXT)
58 ARM_EXIT_DISCARD(EXIT_DATA)
60 #ifndef CONFIG_HOTPLUG
61 *(.ARM.exidx.devexit.text)
62 *(.ARM.extab.devexit.text)
68 #ifndef CONFIG_SMP_ON_UP
75 #ifdef CONFIG_XIP_KERNEL
76 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
78 . = PAGE_OFFSET + TEXT_OFFSET;
84 .text : { /* Real text segment */
85 _stext = .; /* Text and read-only data */
86 __exception_text_start = .;
88 __exception_text_end = .;
101 *(.got) /* Global offset table */
102 ARM_CPU_KEEP(PROC_INFO)
107 #ifdef CONFIG_ARM_UNWIND
109 * Stack unwinding tables
113 __start_unwind_idx = .;
115 __stop_unwind_idx = .;
118 __start_unwind_tab = .;
120 __stop_unwind_tab = .;
124 _etext = .; /* End of text and rodata section */
126 #ifndef CONFIG_XIP_KERNEL
127 . = ALIGN(PAGE_SIZE);
133 ARM_EXIT_KEEP(EXIT_TEXT)
136 ARM_CPU_DISCARD(PROC_INFO)
139 __arch_info_begin = .;
144 __tagtable_begin = .;
148 #ifdef CONFIG_SMP_ON_UP
156 __pv_table_begin = .;
161 #ifndef CONFIG_XIP_KERNEL
170 #ifndef CONFIG_XIP_KERNEL
172 ARM_EXIT_KEEP(EXIT_DATA)
178 #ifdef CONFIG_XIP_KERNEL
179 __data_loc = ALIGN(4); /* location in binary */
180 . = PAGE_OFFSET + TEXT_OFFSET;
183 . = ALIGN(THREAD_SIZE);
187 .data : AT(__data_loc) {
188 _data = .; /* address in memory */
192 * first, the init task union, aligned
193 * to an 8192 byte boundary.
195 INIT_TASK_DATA(THREAD_SIZE)
197 #ifdef CONFIG_XIP_KERNEL
198 . = ALIGN(PAGE_SIZE);
201 ARM_EXIT_KEEP(EXIT_DATA)
202 . = ALIGN(PAGE_SIZE);
207 CACHELINE_ALIGNED_DATA(32)
211 * The exception fixup table (might need resorting at runtime)
214 __start___ex_table = .;
218 __stop___ex_table = .;
221 * and the usual data section
228 _edata_loc = __data_loc + SIZEOF(.data);
230 #ifdef CONFIG_HAVE_TCM
232 * We align everything to a page boundary so we can
233 * free it after init has commenced and TCM contents have
234 * been copied to its destination.
237 . = ALIGN(PAGE_SIZE);
243 * Link these to the ITCM RAM
244 * Put VMA to the TCM address and LMA to the common RAM
245 * and we'll upload the contents from RAM to TCM and free
246 * the used RAM after that.
248 .text_itcm ITCM_OFFSET : AT(__itcm_start)
258 * Reset the dot pointer, this is needed to create the
259 * relative __dtcm_start below (to be used as extern in code).
261 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
267 /* TODO: add remainder of ITCM as well, that can be used for data! */
268 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
277 /* Reset the dot pointer or the linker gets confused */
278 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
280 /* End marker for freeing TCM copy in linked object */
281 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
282 . = ALIGN(PAGE_SIZE);
293 .comment 0 : { *(.comment) }
297 * These must never be empty
298 * If you have to comment these two assert statements out, your
299 * binutils is too old (for other reasons as well)
301 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
302 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")