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>
17 jiffies = jiffies_64 + 4;
22 #ifdef CONFIG_XIP_KERNEL
23 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
25 . = PAGE_OFFSET + TEXT_OFFSET;
28 .init : { /* Init code and data */
34 __proc_info_begin = .;
37 __arch_info_begin = .;
51 #ifndef CONFIG_XIP_KERNEL
52 __init_begin = _stext;
59 #ifndef CONFIG_XIP_KERNEL
65 * unwind exit sections must be discarded before the rest of the
66 * unwind sections get included.
69 *(.ARM.exidx.exit.text)
70 *(.ARM.extab.exit.text)
71 #ifndef CONFIG_HOTPLUG_CPU
72 *(.ARM.exidx.cpuexit.text)
73 *(.ARM.extab.cpuexit.text)
75 #ifndef CONFIG_HOTPLUG
76 *(.ARM.exidx.devexit.text)
77 *(.ARM.extab.devexit.text)
85 .text : { /* Real text segment */
86 _text = .; /* Text and read-only data */
87 __exception_text_start = .;
89 __exception_text_end = .;
102 *(.got) /* Global offset table */
107 _etext = .; /* End of text and rodata section */
109 #ifdef CONFIG_ARM_UNWIND
111 * Stack unwinding tables
115 __start_unwind_idx = .;
117 __stop_unwind_idx = .;
120 __start_unwind_tab = .;
122 __stop_unwind_tab = .;
126 #ifdef CONFIG_XIP_KERNEL
127 __data_loc = ALIGN(4); /* location in binary */
128 . = PAGE_OFFSET + TEXT_OFFSET;
130 . = ALIGN(THREAD_SIZE);
134 .data : AT(__data_loc) {
135 _data = .; /* address in memory */
139 * first, the init task union, aligned
140 * to an 8192 byte boundary.
142 INIT_TASK_DATA(THREAD_SIZE)
144 #ifdef CONFIG_XIP_KERNEL
145 . = ALIGN(PAGE_SIZE);
148 . = ALIGN(PAGE_SIZE);
153 CACHELINE_ALIGNED_DATA(32)
156 * The exception fixup table (might need resorting at runtime)
159 __start___ex_table = .;
163 __stop___ex_table = .;
166 * and the usual data section
173 _edata_loc = __data_loc + SIZEOF(.data);
175 #ifdef CONFIG_HAVE_TCM
177 * We align everything to a page boundary so we can
178 * free it after init has commenced and TCM contents have
179 * been copied to its destination.
182 . = ALIGN(PAGE_SIZE);
188 * Link these to the ITCM RAM
189 * Put VMA to the TCM address and LMA to the common RAM
190 * and we'll upload the contents from RAM to TCM and free
191 * the used RAM after that.
193 .text_itcm ITCM_OFFSET : AT(__itcm_start)
203 * Reset the dot pointer, this is needed to create the
204 * relative __dtcm_start below (to be used as extern in code).
206 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
212 /* TODO: add remainder of ITCM as well, that can be used for data! */
213 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
222 /* Reset the dot pointer or the linker gets confused */
223 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
225 /* End marker for freeing TCM copy in linked object */
226 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
227 . = ALIGN(PAGE_SIZE);
236 .comment 0 : { *(.comment) }
238 /* Default discards */
243 * These must never be empty
244 * If you have to comment these two assert statements out, your
245 * binutils is too old (for other reasons as well)
247 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
248 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")