1 /* Modified by Broadcom Corp. Portions Copyright (c) Broadcom Corp, 2012. */
2 /* ld script to make ARM Linux kernel
3 * taken from the i386 version by Russell King
4 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
7 #include <asm-generic/vmlinux.lds.h>
8 #include <asm/thread_info.h>
9 #include <asm/memory.h>
18 jiffies = jiffies_64 + 4;
23 #ifdef CONFIG_XIP_KERNEL
24 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
26 . = PAGE_OFFSET + TEXT_OFFSET;
29 .init : { /* Init code and data */
35 __proc_info_begin = .;
38 __arch_info_begin = .;
52 #ifndef CONFIG_XIP_KERNEL
53 __init_begin = _stext;
60 #ifndef CONFIG_XIP_KERNEL
66 * unwind exit sections must be discarded before the rest of the
67 * unwind sections get included.
70 *(.ARM.exidx.exit.text)
71 *(.ARM.extab.exit.text)
72 #ifndef CONFIG_HOTPLUG_CPU
73 *(.ARM.exidx.cpuexit.text)
74 *(.ARM.extab.cpuexit.text)
76 #ifndef CONFIG_HOTPLUG
77 *(.ARM.exidx.devexit.text)
78 *(.ARM.extab.devexit.text)
86 .text : { /* Real text segment */
87 _text = .; /* Text and read-only data */
88 __exception_text_start = .;
90 __exception_text_end = .;
103 *(.got) /* Global offset table */
107 __fastpath_begin = .;
108 .text.fastpath : { *(.text.fastpath) }
113 _etext = .; /* End of text and rodata section */
115 #ifdef CONFIG_ARM_UNWIND
117 * Stack unwinding tables
121 __start_unwind_idx = .;
123 __stop_unwind_idx = .;
126 __start_unwind_tab = .;
128 __stop_unwind_tab = .;
132 #ifdef CONFIG_XIP_KERNEL
133 __data_loc = ALIGN(4); /* location in binary */
134 . = PAGE_OFFSET + TEXT_OFFSET;
136 . = ALIGN(THREAD_SIZE);
140 .data : AT(__data_loc) {
141 _data = .; /* address in memory */
145 * first, the init task union, aligned
146 * to an 8192 byte boundary.
148 INIT_TASK_DATA(THREAD_SIZE)
150 #ifdef CONFIG_XIP_KERNEL
151 . = ALIGN(PAGE_SIZE);
154 . = ALIGN(PAGE_SIZE);
159 CACHELINE_ALIGNED_DATA(32)
162 * The exception fixup table (might need resorting at runtime)
165 __start___ex_table = .;
169 __stop___ex_table = .;
172 * and the usual data section
179 _edata_loc = __data_loc + SIZEOF(.data);
181 #ifdef CONFIG_HAVE_TCM
183 * We align everything to a page boundary so we can
184 * free it after init has commenced and TCM contents have
185 * been copied to its destination.
188 . = ALIGN(PAGE_SIZE);
194 * Link these to the ITCM RAM
195 * Put VMA to the TCM address and LMA to the common RAM
196 * and we'll upload the contents from RAM to TCM and free
197 * the used RAM after that.
199 .text_itcm ITCM_OFFSET : AT(__itcm_start)
209 * Reset the dot pointer, this is needed to create the
210 * relative __dtcm_start below (to be used as extern in code).
212 . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
218 /* TODO: add remainder of ITCM as well, that can be used for data! */
219 .data_dtcm DTCM_OFFSET : AT(__dtcm_start)
228 /* Reset the dot pointer or the linker gets confused */
229 . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
231 /* End marker for freeing TCM copy in linked object */
232 .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
233 . = ALIGN(PAGE_SIZE);
242 .comment 0 : { *(.comment) }
244 /* Default discards */
249 * These must never be empty
250 * If you have to comment these two assert statements out, your
251 * binutils is too old (for other reasons as well)
253 ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
254 ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")