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 = .;
55 #ifndef CONFIG_XIP_KERNEL
56 __init_begin = _stext;
63 #ifndef CONFIG_XIP_KERNEL
69 * unwind exit sections must be discarded before the rest of the
70 * unwind sections get included.
73 *(.ARM.exidx.exit.text)
74 *(.ARM.extab.exit.text)
75 #ifndef CONFIG_HOTPLUG_CPU
76 *(.ARM.exidx.cpuexit.text)
77 *(.ARM.extab.cpuexit.text)
79 #ifndef CONFIG_HOTPLUG
80 *(.ARM.exidx.devexit.text)
81 *(.ARM.extab.devexit.text)
89 .text : { /* Real text segment */
90 _text = .; /* Text and read-only data */
91 __exception_text_start = .;
93 __exception_text_end = .;
106 *(.got) /* Global offset table */
111 _etext = .; /* End of text and rodata section */
113 #ifdef CONFIG_ARM_UNWIND
115 * Stack unwinding tables
119 __start_unwind_idx = .;
121 __stop_unwind_idx = .;
124 __start_unwind_tab = .;
126 __stop_unwind_tab = .;
130 #ifdef CONFIG_XIP_KERNEL
131 __data_loc = ALIGN(4); /* location in binary */
132 . = PAGE_OFFSET + TEXT_OFFSET;
134 . = ALIGN(THREAD_SIZE);
138 .data : AT(__data_loc) {
139 _data = .; /* address in memory */
143 * first, the init task union, aligned
144 * to an 8192 byte boundary.
146 INIT_TASK_DATA(THREAD_SIZE)
148 #ifdef CONFIG_XIP_KERNEL
149 . = ALIGN(PAGE_SIZE);
152 . = ALIGN(PAGE_SIZE);
157 CACHELINE_ALIGNED_DATA(32)
160 * The exception fixup table (might need resorting at runtime)
163 __start___ex_table = .;
167 __stop___ex_table = .;
170 * and the usual data section
177 _edata_loc = __data_loc + SIZEOF(.data);
179 #ifdef CONFIG_HAVE_TCM
181 * We align everything to a page boundary so we can
182 * free it after init has commenced and TCM contents have
183 * been copied to its destination.
186 . = ALIGN(PAGE_SIZE);
192 * Link these to the ITCM RAM
193 * Put VMA to the TCM address and LMA to the common RAM
194 * and we'll upload the contents from RAM to TCM and free
195 * the used RAM after that.
197 .text_itcm ITCM_OFFSET : AT(__itcm_start)
207 * Reset the dot pointer, this is needed to create the
208 * relative __dtcm_start below (to be used as extern in code).
210 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
216 /* TODO: add remainder of ITCM as well, that can be used for data! */
217 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
226 /* Reset the dot pointer or the linker gets confused */
227 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
229 /* End marker for freeing TCM copy in linked object */
230 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
231 . = ALIGN(PAGE_SIZE);
240 .comment 0 : { *(.comment) }
242 /* Default discards */
247 * These must never be empty
248 * If you have to comment these two assert statements out, your
249 * binutils is too old (for other reasons as well)
251 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
252 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")