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
28 #define ARM_EXIT_KEEP(x)
37 jiffies = jiffies_64 + 4;
43 * unwind exit sections must be discarded before the rest of the
44 * unwind sections get included.
47 *(.ARM.exidx.exit.text)
48 *(.ARM.extab.exit.text)
49 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
50 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
51 #ifndef CONFIG_HOTPLUG
52 *(.ARM.exidx.devexit.text)
53 *(.ARM.extab.devexit.text)
59 #ifndef CONFIG_SMP_ON_UP
64 #ifdef CONFIG_XIP_KERNEL
65 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
67 . = PAGE_OFFSET + TEXT_OFFSET;
73 .text : { /* Real text segment */
74 _stext = .; /* Text and read-only data */
75 __exception_text_start = .;
77 __exception_text_end = .;
90 *(.got) /* Global offset table */
91 ARM_CPU_KEEP(PROC_INFO)
96 #ifdef CONFIG_ARM_UNWIND
98 * Stack unwinding tables
102 __start_unwind_idx = .;
104 __stop_unwind_idx = .;
107 __start_unwind_tab = .;
109 __stop_unwind_tab = .;
113 _etext = .; /* End of text and rodata section */
115 #ifndef CONFIG_XIP_KERNEL
116 . = ALIGN(PAGE_SIZE);
122 ARM_EXIT_KEEP(EXIT_TEXT)
125 ARM_CPU_DISCARD(PROC_INFO)
128 __arch_info_begin = .;
133 __tagtable_begin = .;
137 #ifdef CONFIG_SMP_ON_UP
145 __pv_table_begin = .;
150 #ifndef CONFIG_XIP_KERNEL
159 #ifndef CONFIG_XIP_KERNEL
161 ARM_EXIT_KEEP(EXIT_DATA)
167 #ifdef CONFIG_XIP_KERNEL
168 __data_loc = ALIGN(4); /* location in binary */
169 . = PAGE_OFFSET + TEXT_OFFSET;
172 . = ALIGN(THREAD_SIZE);
176 .data : AT(__data_loc) {
177 _data = .; /* address in memory */
181 * first, the init task union, aligned
182 * to an 8192 byte boundary.
184 INIT_TASK_DATA(THREAD_SIZE)
186 #ifdef CONFIG_XIP_KERNEL
187 . = ALIGN(PAGE_SIZE);
190 ARM_EXIT_KEEP(EXIT_DATA)
191 . = ALIGN(PAGE_SIZE);
196 CACHELINE_ALIGNED_DATA(32)
200 * The exception fixup table (might need resorting at runtime)
203 __start___ex_table = .;
207 __stop___ex_table = .;
210 * and the usual data section
217 _edata_loc = __data_loc + SIZEOF(.data);
219 #ifdef CONFIG_HAVE_TCM
221 * We align everything to a page boundary so we can
222 * free it after init has commenced and TCM contents have
223 * been copied to its destination.
226 . = ALIGN(PAGE_SIZE);
232 * Link these to the ITCM RAM
233 * Put VMA to the TCM address and LMA to the common RAM
234 * and we'll upload the contents from RAM to TCM and free
235 * the used RAM after that.
237 .text_itcm ITCM_OFFSET : AT(__itcm_start)
247 * Reset the dot pointer, this is needed to create the
248 * relative __dtcm_start below (to be used as extern in code).
250 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
256 /* TODO: add remainder of ITCM as well, that can be used for data! */
257 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
266 /* Reset the dot pointer or the linker gets confused */
267 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
269 /* End marker for freeing TCM copy in linked object */
270 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
271 . = ALIGN(PAGE_SIZE);
282 .comment 0 : { *(.comment) }
284 /* Default discards */
289 * These must never be empty
290 * If you have to comment these two assert statements out, your
291 * binutils is too old (for other reasons as well)
293 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
294 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")