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 defined(CONFIG_GENERIC_BUG)
26 #define ARM_EXIT_KEEP(x) x
27 #define ARM_EXIT_DISCARD(x)
29 #define ARM_EXIT_KEEP(x)
30 #define ARM_EXIT_DISCARD(x) x
39 jiffies = jiffies_64 + 4;
45 * XXX: The linker does not define how output sections are
46 * assigned to input sections when there are multiple statements
47 * matching the same input section name. There is no documented
50 * unwind exit sections must be discarded before the rest of the
51 * unwind sections get included.
54 *(.ARM.exidx.exit.text)
55 *(.ARM.extab.exit.text)
56 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
57 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
58 ARM_EXIT_DISCARD(EXIT_TEXT)
59 ARM_EXIT_DISCARD(EXIT_DATA)
61 #ifndef CONFIG_HOTPLUG
62 *(.ARM.exidx.devexit.text)
63 *(.ARM.extab.devexit.text)
69 #ifndef CONFIG_SMP_ON_UP
76 #ifdef CONFIG_XIP_KERNEL
77 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
79 . = PAGE_OFFSET + TEXT_OFFSET;
85 .text : { /* Real text segment */
86 _stext = .; /* Text and read-only data */
87 __exception_text_start = .;
89 __exception_text_end = .;
102 *(.got) /* Global offset table */
103 ARM_CPU_KEEP(PROC_INFO)
108 #ifdef CONFIG_ARM_UNWIND
110 * Stack unwinding tables
114 __start_unwind_idx = .;
116 __stop_unwind_idx = .;
119 __start_unwind_tab = .;
121 __stop_unwind_tab = .;
125 _etext = .; /* End of text and rodata section */
127 #ifndef CONFIG_XIP_KERNEL
128 . = ALIGN(PAGE_SIZE);
134 ARM_EXIT_KEEP(EXIT_TEXT)
137 ARM_CPU_DISCARD(PROC_INFO)
140 __arch_info_begin = .;
145 __tagtable_begin = .;
149 #ifdef CONFIG_SMP_ON_UP
157 __pv_table_begin = .;
162 #ifndef CONFIG_XIP_KERNEL
171 #ifndef CONFIG_XIP_KERNEL
173 ARM_EXIT_KEEP(EXIT_DATA)
179 #ifdef CONFIG_XIP_KERNEL
180 __data_loc = ALIGN(4); /* location in binary */
181 . = PAGE_OFFSET + TEXT_OFFSET;
184 . = ALIGN(THREAD_SIZE);
188 .data : AT(__data_loc) {
189 _data = .; /* address in memory */
193 * first, the init task union, aligned
194 * to an 8192 byte boundary.
196 INIT_TASK_DATA(THREAD_SIZE)
198 #ifdef CONFIG_XIP_KERNEL
199 . = ALIGN(PAGE_SIZE);
202 ARM_EXIT_KEEP(EXIT_DATA)
203 . = ALIGN(PAGE_SIZE);
208 CACHELINE_ALIGNED_DATA(32)
212 * The exception fixup table (might need resorting at runtime)
215 __start___ex_table = .;
219 __stop___ex_table = .;
222 * and the usual data section
229 _edata_loc = __data_loc + SIZEOF(.data);
231 #ifdef CONFIG_HAVE_TCM
233 * We align everything to a page boundary so we can
234 * free it after init has commenced and TCM contents have
235 * been copied to its destination.
238 . = ALIGN(PAGE_SIZE);
244 * Link these to the ITCM RAM
245 * Put VMA to the TCM address and LMA to the common RAM
246 * and we'll upload the contents from RAM to TCM and free
247 * the used RAM after that.
249 .text_itcm ITCM_OFFSET : AT(__itcm_start)
259 * Reset the dot pointer, this is needed to create the
260 * relative __dtcm_start below (to be used as extern in code).
262 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
268 /* TODO: add remainder of ITCM as well, that can be used for data! */
269 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
278 /* Reset the dot pointer or the linker gets confused */
279 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
281 /* End marker for freeing TCM copy in linked object */
282 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
283 . = ALIGN(PAGE_SIZE);
294 .comment 0 : { *(.comment) }
298 * These must never be empty
299 * If you have to comment these two assert statements out, your
300 * binutils is too old (for other reasons as well)
302 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
303 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")