blob: 17725a55aed8cecc0ba3405f33e0ecdd235f081b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* ld script to make FRV Linux kernel
2 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3 */
4OUTPUT_FORMAT("elf32-frv", "elf32-frv", "elf32-frv")
5OUTPUT_ARCH(frv)
6ENTRY(_start)
7
8#include <asm-generic/vmlinux.lds.h>
9#include <asm/processor.h>
10#include <asm/page.h>
11#include <asm/cache.h>
12#include <asm/thread_info.h>
13
14jiffies = jiffies_64 + 4;
15
David Howells70382202008-02-04 22:29:53 -080016__page_offset = CONFIG_PAGE_OFFSET; /* start of area covered by struct pages */
Linus Torvalds1da177e2005-04-16 15:20:36 -070017__kernel_image_start = __page_offset; /* address at which kernel image resides */
18
19SECTIONS
20{
21 . = __kernel_image_start;
22
23 /* discardable initialisation code and data */
24 . = ALIGN(PAGE_SIZE); /* Init code and data */
25 __init_begin = .;
26
27 _sinittext = .;
28 .init.text : {
29 *(.text.head)
30#ifndef CONFIG_DEBUG_INFO
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010031 INIT_TEXT
32 EXIT_TEXT
33 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 *(.exitcall.exit)
35#endif
36 }
37 _einittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010038 .init.data : { INIT_DATA }
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
40 . = ALIGN(8);
41 __setup_start = .;
42 .setup.init : { KEEP(*(.init.setup)) }
43 __setup_end = .;
44
45 __initcall_start = .;
46 .initcall.init : {
Andrew Morton61ce1ef2006-10-27 11:41:44 -070047 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 }
49 __initcall_end = .;
50 __con_initcall_start = .;
51 .con_initcall.init : { *(.con_initcall.init) }
52 __con_initcall_end = .;
53 SECURITY_INIT
54 . = ALIGN(4);
55 __alt_instructions = .;
56 .altinstructions : { *(.altinstructions) }
57 __alt_instructions_end = .;
58 .altinstr_replacement : { *(.altinstr_replacement) }
59
Fenghua Yu5fb7dc32007-07-19 01:48:12 -070060 PERCPU(4096)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Jean-Paul Saman67d38222007-02-10 01:44:44 -080062#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 . = ALIGN(4096);
64 __initramfs_start = .;
65 .init.ramfs : { *(.init.ramfs) }
66 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -080067#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69 . = ALIGN(THREAD_SIZE);
70 __init_end = .;
71
72 /* put sections together that have massive alignment issues */
73 . = ALIGN(THREAD_SIZE);
74 .data.init_task : {
75 /* init task record & stack */
76 *(.data.init_task)
77 }
78
David Howells3c835672007-11-28 16:22:05 -080079 . = ALIGN(4096);
80 .data.page_aligned : { *(.data.idt) }
81
82 . = ALIGN(L1_CACHE_BYTES);
83 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 .trap : {
86 /* trap table management - read entry-table.S before modifying */
87 . = ALIGN(8192);
88 __trap_tables = .;
89 *(.trap.user)
90 *(.trap.kernel)
91 . = ALIGN(4096);
92 *(.trap.break)
93 }
94
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 /* Text and read-only data */
96 . = ALIGN(4);
97 _text = .;
98 _stext = .;
99 .text : {
David Howells3c835672007-11-28 16:22:05 -0800100 *(.text.start)
101 *(.text.entry)
102 *(.text.break)
103 *(.text.tlbmiss)
Sam Ravnborg76647092007-05-13 00:31:33 +0200104 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 SCHED_TEXT
David Howells41be6ae2006-01-08 01:01:25 -0800106 LOCK_TEXT
David Howells3c835672007-11-28 16:22:05 -0800107#ifdef CONFIG_DEBUG_INFO
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100108 INIT_TEXT
109 EXIT_TEXT
David Howellsd897d2b2008-02-13 16:10:08 +0000110 *(.exitcall.exit)
David Howells3c835672007-11-28 16:22:05 -0800111#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 *(.fixup)
113 *(.gnu.warning)
114 *(.exitcall.exit)
115 } = 0x9090
116
117 _etext = .; /* End of text section */
118
119 RODATA
120
121 .rodata : {
122 *(.trap.vector)
123
124 /* this clause must not be modified - the ordering and adjacency are imperative */
125 __trap_fixup_tables = .;
126 *(.trap.fixup.user .trap.fixup.kernel)
127
128 }
129
130 . = ALIGN(8); /* Exception table */
131 __start___ex_table = .;
132 __ex_table : { KEEP(*(__ex_table)) }
133 __stop___ex_table = .;
134
135 _sdata = .;
136 .data : { /* Data */
Sam Ravnborgca967252007-05-17 13:38:44 +0200137 DATA_DATA
138 *(.data.*)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100139 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 CONSTRUCTORS
141 }
142
143 _edata = .; /* End of data section */
144
145 /* GP section */
146 . = ALIGN(L1_CACHE_BYTES);
147 _gp = . + 2048;
148 PROVIDE (gp = _gp);
149
150 .sdata : { *(.sdata .sdata.*) }
151
152 /* BSS */
153 . = ALIGN(L1_CACHE_BYTES);
154 __bss_start = .;
155
156 .sbss : { *(.sbss .sbss.*) }
157 .bss : { *(.bss .bss.*) }
158 .bss.stack : { *(.bss) }
159
160 __bss_stop = .;
161 _end = . ;
162 . = ALIGN(PAGE_SIZE);
163 __kernel_image_end = .;
164
165 /* Stabs debugging sections. */
166 .stab 0 : { *(.stab) }
167 .stabstr 0 : { *(.stabstr) }
168 .stab.excl 0 : { *(.stab.excl) }
169 .stab.exclstr 0 : { *(.stab.exclstr) }
170 .stab.index 0 : { *(.stab.index) }
171 .stab.indexstr 0 : { *(.stab.indexstr) }
172
173 .debug_line 0 : { *(.debug_line) }
174 .debug_info 0 : { *(.debug_info) }
175 .debug_abbrev 0 : { *(.debug_abbrev) }
176 .debug_aranges 0 : { *(.debug_aranges) }
177 .debug_frame 0 : { *(.debug_frame) }
178 .debug_pubnames 0 : { *(.debug_pubnames) }
179 .debug_str 0 : { *(.debug_str) }
180 .debug_ranges 0 : { *(.debug_ranges) }
181
182 .comment 0 : { *(.comment) }
183}
184
185__kernel_image_size_no_bss = __bss_start - __kernel_image_start;