blob: 2b254e88595c76e15c233290e0f1339f04e5a621 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* 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>
4 */
5
6#include <asm-generic/vmlinux.lds.h>
7#include <linux/config.h>
Russell King4f7a1812005-05-05 13:11:00 +01008#include <asm/thread_info.h>
Nicolas Pitre37d07b72005-10-29 21:44:56 +01009#include <asm/memory.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11OUTPUT_ARCH(arm)
12ENTRY(stext)
Nicolas Pitre37d07b72005-10-29 21:44:56 +010013
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#ifndef __ARMEB__
15jiffies = jiffies_64;
16#else
17jiffies = jiffies_64 + 4;
18#endif
Nicolas Pitre37d07b72005-10-29 21:44:56 +010019
Linus Torvalds1da177e2005-04-16 15:20:36 -070020SECTIONS
21{
Russell King9d4f13e2006-01-03 17:28:33 +000022#ifdef CONFIG_XIP_KERNEL
23 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
24#else
25 . = PAGE_OFFSET + TEXT_OFFSET;
26#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 .init : { /* Init code and data */
28 _stext = .;
29 _sinittext = .;
30 *(.init.text)
31 _einittext = .;
32 __proc_info_begin = .;
Ben Dooks02b7dd12005-09-20 16:35:03 +010033 *(.proc.info.init)
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 __proc_info_end = .;
35 __arch_info_begin = .;
Ben Dooks9d0fd1e2005-09-20 16:45:20 +010036 *(.arch.info.init)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 __arch_info_end = .;
38 __tagtable_begin = .;
Ben Dooks95060572005-09-20 16:20:49 +010039 *(.taglist.init)
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 __tagtable_end = .;
41 . = ALIGN(16);
42 __setup_start = .;
43 *(.init.setup)
44 __setup_end = .;
45 __early_begin = .;
Ben Dooksbfe68152005-09-20 16:25:12 +010046 *(.early_param.init)
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 __early_end = .;
48 __initcall_start = .;
49 *(.initcall1.init)
50 *(.initcall2.init)
51 *(.initcall3.init)
52 *(.initcall4.init)
53 *(.initcall5.init)
54 *(.initcall6.init)
55 *(.initcall7.init)
56 __initcall_end = .;
57 __con_initcall_start = .;
58 *(.con_initcall.init)
59 __con_initcall_end = .;
60 __security_initcall_start = .;
61 *(.security_initcall.init)
62 __security_initcall_end = .;
63 . = ALIGN(32);
64 __initramfs_start = .;
65 usr/built-in.o(.init.ramfs)
66 __initramfs_end = .;
67 . = ALIGN(64);
68 __per_cpu_start = .;
69 *(.data.percpu)
70 __per_cpu_end = .;
71#ifndef CONFIG_XIP_KERNEL
72 __init_begin = _stext;
73 *(.init.data)
74 . = ALIGN(4096);
75 __init_end = .;
76#endif
77 }
78
79 /DISCARD/ : { /* Exit code and data */
80 *(.exit.text)
81 *(.exit.data)
82 *(.exitcall.exit)
83 }
84
85 .text : { /* Real text segment */
86 _text = .; /* Text and read-only data */
87 *(.text)
88 SCHED_TEXT
89 LOCK_TEXT
90 *(.fixup)
91 *(.gnu.warning)
92 *(.rodata)
93 *(.rodata.*)
94 *(.glue_7)
95 *(.glue_7t)
96 *(.got) /* Global offset table */
97 }
98
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 RODATA
100
101 _etext = .; /* End of text and rodata section */
102
103#ifdef CONFIG_XIP_KERNEL
104 __data_loc = ALIGN(4); /* location in binary */
Russell King9d4f13e2006-01-03 17:28:33 +0000105 . = PAGE_OFFSET + TEXT_OFFSET;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106#else
Russell King4f7a1812005-05-05 13:11:00 +0100107 . = ALIGN(THREAD_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 __data_loc = .;
109#endif
110
111 .data : AT(__data_loc) {
112 __data_start = .; /* address in memory */
113
114 /*
115 * first, the init task union, aligned
116 * to an 8192 byte boundary.
117 */
118 *(.init.task)
119
120#ifdef CONFIG_XIP_KERNEL
121 . = ALIGN(4096);
122 __init_begin = .;
123 *(.init.data)
124 . = ALIGN(4096);
125 __init_end = .;
126#endif
127
128 . = ALIGN(4096);
129 __nosave_begin = .;
130 *(.data.nosave)
131 . = ALIGN(4096);
132 __nosave_end = .;
133
134 /*
135 * then the cacheline aligned data
136 */
137 . = ALIGN(32);
138 *(.data.cacheline_aligned)
139
140 /*
Nicolas Pitre13b1f642005-10-13 22:04:37 +0100141 * The exception fixup table (might need resorting at runtime)
142 */
143 . = ALIGN(32);
144 __start___ex_table = .;
145 *(__ex_table)
146 __stop___ex_table = .;
147
148 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 * and the usual data section
150 */
151 *(.data)
152 CONSTRUCTORS
153
154 _edata = .;
155 }
156
157 .bss : {
158 __bss_start = .; /* BSS */
159 *(.bss)
160 *(COMMON)
161 _end = .;
162 }
163 /* Stabs debugging sections. */
164 .stab 0 : { *(.stab) }
165 .stabstr 0 : { *(.stabstr) }
166 .stab.excl 0 : { *(.stab.excl) }
167 .stab.exclstr 0 : { *(.stab.exclstr) }
168 .stab.index 0 : { *(.stab.index) }
169 .stab.indexstr 0 : { *(.stab.indexstr) }
170 .comment 0 : { *(.comment) }
171}
172
Russell King728f5c02005-11-17 16:43:14 +0000173/*
174 * These must never be empty
175 * If you have to comment these two assert statements out, your
176 * binutils is too old (for other reasons as well)
177 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
179ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")