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;
69 .init : { /* Init code and data */
74 ARM_EXIT_KEEP(EXIT_TEXT)
76 ARM_CPU_DISCARD(PROC_INFO)
77 __arch_info_begin = .;
83 #ifdef CONFIG_SMP_ON_UP
100 #ifndef CONFIG_XIP_KERNEL
101 __init_begin = _stext;
103 ARM_EXIT_KEEP(EXIT_DATA)
109 #ifndef CONFIG_XIP_KERNEL
110 . = ALIGN(PAGE_SIZE);
114 .text : { /* Real text segment */
115 _text = .; /* Text and read-only data */
116 __exception_text_start = .;
118 __exception_text_end = .;
133 *(.got) /* Global offset table */
134 ARM_CPU_KEEP(PROC_INFO)
139 #ifdef CONFIG_ARM_UNWIND
141 * Stack unwinding tables
145 __start_unwind_idx = .;
147 __stop_unwind_idx = .;
150 __start_unwind_tab = .;
152 __stop_unwind_tab = .;
156 _etext = .; /* End of text and rodata section */
158 #ifdef CONFIG_XIP_KERNEL
159 __data_loc = ALIGN(4); /* location in binary */
160 . = PAGE_OFFSET + TEXT_OFFSET;
162 . = ALIGN(THREAD_SIZE);
166 .data : AT(__data_loc) {
167 _data = .; /* address in memory */
171 * first, the init task union, aligned
172 * to an 8192 byte boundary.
174 INIT_TASK_DATA(THREAD_SIZE)
176 #ifdef CONFIG_XIP_KERNEL
177 . = ALIGN(PAGE_SIZE);
180 ARM_EXIT_KEEP(EXIT_DATA)
181 . = ALIGN(PAGE_SIZE);
186 CACHELINE_ALIGNED_DATA(32)
190 * The exception fixup table (might need resorting at runtime)
193 __start___ex_table = .;
197 __stop___ex_table = .;
200 * and the usual data section
207 _edata_loc = __data_loc + SIZEOF(.data);
209 #ifdef CONFIG_HAVE_TCM
211 * We align everything to a page boundary so we can
212 * free it after init has commenced and TCM contents have
213 * been copied to its destination.
216 . = ALIGN(PAGE_SIZE);
222 * Link these to the ITCM RAM
223 * Put VMA to the TCM address and LMA to the common RAM
224 * and we'll upload the contents from RAM to TCM and free
225 * the used RAM after that.
227 .text_itcm ITCM_OFFSET : AT(__itcm_start)
237 * Reset the dot pointer, this is needed to create the
238 * relative __dtcm_start below (to be used as extern in code).
240 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
246 /* TODO: add remainder of ITCM as well, that can be used for data! */
247 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
256 /* Reset the dot pointer or the linker gets confused */
257 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
259 /* End marker for freeing TCM copy in linked object */
260 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
261 . = ALIGN(PAGE_SIZE);
272 .comment 0 : { *(.comment) }
274 /* Default discards */
279 * These must never be empty
280 * If you have to comment these two assert statements out, your
281 * binutils is too old (for other reasons as well)
283 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
284 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")