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 = .;
43 #ifdef CONFIG_SMP_ON_UP
56 #ifndef CONFIG_XIP_KERNEL
57 __init_begin = _stext;
64 #ifndef CONFIG_XIP_KERNEL
70 * unwind exit sections must be discarded before the rest of the
71 * unwind sections get included.
74 *(.ARM.exidx.exit.text)
75 *(.ARM.extab.exit.text)
76 #ifndef CONFIG_HOTPLUG_CPU
77 *(.ARM.exidx.cpuexit.text)
78 *(.ARM.extab.cpuexit.text)
80 #ifndef CONFIG_HOTPLUG
81 *(.ARM.exidx.devexit.text)
82 *(.ARM.extab.devexit.text)
90 .text : { /* Real text segment */
91 _text = .; /* Text and read-only data */
92 __exception_text_start = .;
94 __exception_text_end = .;
107 *(.got) /* Global offset table */
112 #ifdef CONFIG_ARM_UNWIND
114 * Stack unwinding tables
118 __start_unwind_idx = .;
120 __stop_unwind_idx = .;
123 __start_unwind_tab = .;
125 __stop_unwind_tab = .;
129 _etext = .; /* End of text and rodata section */
131 #ifdef CONFIG_XIP_KERNEL
132 __data_loc = ALIGN(4); /* location in binary */
133 . = PAGE_OFFSET + TEXT_OFFSET;
135 . = ALIGN(THREAD_SIZE);
139 .data : AT(__data_loc) {
140 _data = .; /* address in memory */
144 * first, the init task union, aligned
145 * to an 8192 byte boundary.
147 INIT_TASK_DATA(THREAD_SIZE)
149 #ifdef CONFIG_XIP_KERNEL
150 . = ALIGN(PAGE_SIZE);
153 . = ALIGN(PAGE_SIZE);
158 CACHELINE_ALIGNED_DATA(32)
161 * The exception fixup table (might need resorting at runtime)
164 __start___ex_table = .;
168 __stop___ex_table = .;
171 * and the usual data section
178 _edata_loc = __data_loc + SIZEOF(.data);
180 #ifdef CONFIG_HAVE_TCM
182 * We align everything to a page boundary so we can
183 * free it after init has commenced and TCM contents have
184 * been copied to its destination.
187 . = ALIGN(PAGE_SIZE);
193 * Link these to the ITCM RAM
194 * Put VMA to the TCM address and LMA to the common RAM
195 * and we'll upload the contents from RAM to TCM and free
196 * the used RAM after that.
198 .text_itcm ITCM_OFFSET : AT(__itcm_start)
208 * Reset the dot pointer, this is needed to create the
209 * relative __dtcm_start below (to be used as extern in code).
211 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
217 /* TODO: add remainder of ITCM as well, that can be used for data! */
218 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
227 /* Reset the dot pointer or the linker gets confused */
228 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
230 /* End marker for freeing TCM copy in linked object */
231 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
232 . = ALIGN(PAGE_SIZE);
241 .comment 0 : { *(.comment) }
243 /* Default discards */
246 #ifndef CONFIG_SMP_ON_UP
254 * These must never be empty
255 * If you have to comment these two assert statements out, your
256 * binutils is too old (for other reasons as well)
258 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
259 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")