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;
42 * unwind exit sections must be discarded before the rest of the
43 * unwind sections get included.
46 *(.ARM.exidx.exit.text)
47 *(.ARM.extab.exit.text)
48 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
49 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
50 #ifndef CONFIG_HOTPLUG
51 *(.ARM.exidx.devexit.text)
52 *(.ARM.extab.devexit.text)
58 #ifndef CONFIG_SMP_ON_UP
63 #ifdef CONFIG_XIP_KERNEL
64 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
66 . = PAGE_OFFSET + TEXT_OFFSET;
72 .text : { /* Real text segment */
73 _stext = .; /* Text and read-only data */
74 __exception_text_start = .;
76 __exception_text_end = .;
89 *(.got) /* Global offset table */
90 ARM_CPU_KEEP(PROC_INFO)
95 #ifdef CONFIG_ARM_UNWIND
97 * Stack unwinding tables
101 __start_unwind_idx = .;
103 __stop_unwind_idx = .;
106 __start_unwind_tab = .;
108 __stop_unwind_tab = .;
112 _etext = .; /* End of text and rodata section */
114 #ifndef CONFIG_XIP_KERNEL
115 . = ALIGN(PAGE_SIZE);
121 ARM_EXIT_KEEP(EXIT_TEXT)
124 ARM_CPU_DISCARD(PROC_INFO)
127 __arch_info_begin = .;
132 __tagtable_begin = .;
136 #ifdef CONFIG_SMP_ON_UP
144 __pv_table_begin = .;
149 #ifndef CONFIG_XIP_KERNEL
158 #ifndef CONFIG_XIP_KERNEL
160 ARM_EXIT_KEEP(EXIT_DATA)
166 #ifdef CONFIG_XIP_KERNEL
167 __data_loc = ALIGN(4); /* location in binary */
168 . = PAGE_OFFSET + TEXT_OFFSET;
171 . = ALIGN(THREAD_SIZE);
175 .data : AT(__data_loc) {
176 _data = .; /* address in memory */
180 * first, the init task union, aligned
181 * to an 8192 byte boundary.
183 INIT_TASK_DATA(THREAD_SIZE)
185 #ifdef CONFIG_XIP_KERNEL
186 . = ALIGN(PAGE_SIZE);
189 ARM_EXIT_KEEP(EXIT_DATA)
190 . = ALIGN(PAGE_SIZE);
195 CACHELINE_ALIGNED_DATA(32)
199 * The exception fixup table (might need resorting at runtime)
202 __start___ex_table = .;
206 __stop___ex_table = .;
209 * and the usual data section
216 _edata_loc = __data_loc + SIZEOF(.data);
218 #ifdef CONFIG_HAVE_TCM
220 * We align everything to a page boundary so we can
221 * free it after init has commenced and TCM contents have
222 * been copied to its destination.
225 . = ALIGN(PAGE_SIZE);
231 * Link these to the ITCM RAM
232 * Put VMA to the TCM address and LMA to the common RAM
233 * and we'll upload the contents from RAM to TCM and free
234 * the used RAM after that.
236 .text_itcm ITCM_OFFSET : AT(__itcm_start)
246 * Reset the dot pointer, this is needed to create the
247 * relative __dtcm_start below (to be used as extern in code).
249 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
255 /* TODO: add remainder of ITCM as well, that can be used for data! */
256 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
265 /* Reset the dot pointer or the linker gets confused */
266 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
268 /* End marker for freeing TCM copy in linked object */
269 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
270 . = ALIGN(PAGE_SIZE);
281 .comment 0 : { *(.comment) }
283 /* Default discards */
288 * These must never be empty
289 * If you have to comment these two assert statements out, your
290 * binutils is too old (for other reasons as well)
292 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
293 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")