blob: 7e0998f7f70fe65d049e599da6e40c9581b1c0fa [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
16__page_offset = 0xc0000000; /* start of area covered by struct pages */
17__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
31 *(.init.text)
32 *(.exit.text)
33 *(.exit.data)
34 *(.exitcall.exit)
35#endif
36 }
37 _einittext = .;
38 .init.data : { *(.init.data) }
39
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
Jeremy Fitzhardingeb6e35902007-05-02 19:27:12 +020060 . = ALIGN(4096);
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 __per_cpu_start = .;
62 .data.percpu : { *(.data.percpu) }
63 __per_cpu_end = .;
64
Jean-Paul Saman67d38222007-02-10 01:44:44 -080065#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 . = ALIGN(4096);
67 __initramfs_start = .;
68 .init.ramfs : { *(.init.ramfs) }
69 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -080070#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
72 . = ALIGN(THREAD_SIZE);
73 __init_end = .;
74
75 /* put sections together that have massive alignment issues */
76 . = ALIGN(THREAD_SIZE);
77 .data.init_task : {
78 /* init task record & stack */
79 *(.data.init_task)
80 }
81
82 .trap : {
83 /* trap table management - read entry-table.S before modifying */
84 . = ALIGN(8192);
85 __trap_tables = .;
86 *(.trap.user)
87 *(.trap.kernel)
88 . = ALIGN(4096);
89 *(.trap.break)
90 }
91
92 . = ALIGN(4096);
93 .data.page_aligned : { *(.data.idt) }
94
95 . = ALIGN(L1_CACHE_BYTES);
96 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
97
98 /* Text and read-only data */
99 . = ALIGN(4);
100 _text = .;
101 _stext = .;
102 .text : {
103 *(
Sam Ravnborg76647092007-05-13 00:31:33 +0200104 .text.start .text.*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105#ifdef CONFIG_DEBUG_INFO
106 .init.text
107 .exit.text
108 .exitcall.exit
109#endif
110 )
Sam Ravnborg76647092007-05-13 00:31:33 +0200111 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 SCHED_TEXT
David Howells41be6ae2006-01-08 01:01:25 -0800113 LOCK_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 *(.fixup)
115 *(.gnu.warning)
116 *(.exitcall.exit)
117 } = 0x9090
118
119 _etext = .; /* End of text section */
120
121 RODATA
122
123 .rodata : {
124 *(.trap.vector)
125
126 /* this clause must not be modified - the ordering and adjacency are imperative */
127 __trap_fixup_tables = .;
128 *(.trap.fixup.user .trap.fixup.kernel)
129
130 }
131
132 . = ALIGN(8); /* Exception table */
133 __start___ex_table = .;
134 __ex_table : { KEEP(*(__ex_table)) }
135 __stop___ex_table = .;
136
137 _sdata = .;
138 .data : { /* Data */
139 *(.data .data.*)
140 *(.exit.data)
141 CONSTRUCTORS
142 }
143
144 _edata = .; /* End of data section */
145
146 /* GP section */
147 . = ALIGN(L1_CACHE_BYTES);
148 _gp = . + 2048;
149 PROVIDE (gp = _gp);
150
151 .sdata : { *(.sdata .sdata.*) }
152
153 /* BSS */
154 . = ALIGN(L1_CACHE_BYTES);
155 __bss_start = .;
156
157 .sbss : { *(.sbss .sbss.*) }
158 .bss : { *(.bss .bss.*) }
159 .bss.stack : { *(.bss) }
160
161 __bss_stop = .;
162 _end = . ;
163 . = ALIGN(PAGE_SIZE);
164 __kernel_image_end = .;
165
166 /* Stabs debugging sections. */
167 .stab 0 : { *(.stab) }
168 .stabstr 0 : { *(.stabstr) }
169 .stab.excl 0 : { *(.stab.excl) }
170 .stab.exclstr 0 : { *(.stab.exclstr) }
171 .stab.index 0 : { *(.stab.index) }
172 .stab.indexstr 0 : { *(.stab.indexstr) }
173
174 .debug_line 0 : { *(.debug_line) }
175 .debug_info 0 : { *(.debug_info) }
176 .debug_abbrev 0 : { *(.debug_abbrev) }
177 .debug_aranges 0 : { *(.debug_aranges) }
178 .debug_frame 0 : { *(.debug_frame) }
179 .debug_pubnames 0 : { *(.debug_pubnames) }
180 .debug_str 0 : { *(.debug_str) }
181 .debug_ranges 0 : { *(.debug_ranges) }
182
183 .comment 0 : { *(.comment) }
184}
185
186__kernel_image_size_no_bss = __bss_start - __kernel_image_start;