blob: b8259668f7dcfb8b11c4fbcc2c05050d80263921 [file] [log] [blame]
David Howellsb920de12008-02-08 04:19:31 -08001/* MN10300 Main kernel linker script
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#define __VMLINUX_LDS__
12#include <asm-generic/vmlinux.lds.h>
13#include <asm/thread_info.h>
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000014#include <asm/page.h>
David Howellsb920de12008-02-08 04:19:31 -080015
16OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin")
17OUTPUT_ARCH(mn10300)
18ENTRY(_start)
19jiffies = jiffies_64;
20#ifndef CONFIG_MN10300_CURRENT_IN_E2
21current = __current;
22#endif
23SECTIONS
24{
25 . = CONFIG_KERNEL_TEXT_ADDRESS;
26 /* read-only */
27 _stext = .;
28 _text = .; /* Text and read-only data */
29 .text : {
30 *(
31 .text.head
32 .text
33 )
34 TEXT_TEXT
35 SCHED_TEXT
36 LOCK_TEXT
37 KPROBES_TEXT
38 *(.fixup)
39 *(.gnu.warning)
40 } = 0xcb
41
42 _etext = .; /* End of text section */
43
44 . = ALIGN(16); /* Exception table */
45 __start___ex_table = .;
46 __ex_table : { *(__ex_table) }
47 __stop___ex_table = .;
48
49 BUG_TABLE
50
51 RODATA
52
53 /* writeable */
54 .data : { /* Data */
55 DATA_DATA
56 CONSTRUCTORS
57 }
58
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000059 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080060 __nosave_begin = .;
61 .data_nosave : { *(.data.nosave) }
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000062 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080063 __nosave_end = .;
64
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000065 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080066 .data.page_aligned : { *(.data.idt) }
67
68 . = ALIGN(32);
69 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
70
71 /* rarely changed data like cpu maps */
72 . = ALIGN(32);
73 .data.read_mostly : AT(ADDR(.data.read_mostly)) {
74 *(.data.read_mostly)
75 _edata = .; /* End of data section */
76 }
77
78 . = ALIGN(THREAD_SIZE); /* init_task */
79 .data.init_task : { *(.data.init_task) }
80
81 /* might get freed after init */
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000082 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080083 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
84 __smp_locks = .;
85 *(.smp_locks)
86 __smp_locks_end = .;
87 }
88
89 /* will be freed after init */
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000090 . = ALIGN(PAGE_SIZE); /* Init code and data */
David Howellsb920de12008-02-08 04:19:31 -080091 __init_begin = .;
92 .init.text : {
93 _sinittext = .;
94 *(.init.text)
95 _einittext = .;
96 }
97 .init.data : { *(.init.data) }
98 . = ALIGN(16);
99 __setup_start = .;
100 .setup.init : { KEEP(*(.init.setup)) }
101 __setup_end = .;
102
103 __initcall_start = .;
104 .initcall.init : {
105 INITCALLS
106 }
107 __initcall_end = .;
108 __con_initcall_start = .;
109 .con_initcall.init : { *(.con_initcall.init) }
110 __con_initcall_end = .;
111
112 SECURITY_INIT
113 . = ALIGN(4);
114 __alt_instructions = .;
115 .altinstructions : { *(.altinstructions) }
116 __alt_instructions_end = .;
117 .altinstr_replacement : { *(.altinstr_replacement) }
118 /* .exit.text is discard at runtime, not link time, to deal with references
119 from .altinstructions and .eh_frame */
120 .exit.text : { *(.exit.text) }
121 .exit.data : { *(.exit.data) }
122
123#ifdef CONFIG_BLK_DEV_INITRD
Cyrill Gorcunovcb328982008-12-10 12:43:19 +0000124 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -0800125 __initramfs_start = .;
126 .init.ramfs : { *(.init.ramfs) }
127 __initramfs_end = .;
128#endif
129
Cyrill Gorcunovcb328982008-12-10 12:43:19 +0000130 PERCPU(32)
131 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -0800132 __init_end = .;
133 /* freed after init ends here */
134
135 __bss_start = .; /* BSS */
136 .bss : {
137 *(.bss.page_aligned)
138 *(.bss)
139 }
140 . = ALIGN(4);
141 __bss_stop = .;
142
143 _end = . ;
144
145 /* This is where the kernel creates the early boot page tables */
Cyrill Gorcunovcb328982008-12-10 12:43:19 +0000146 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -0800147 pg0 = .;
148
149 /* Sections to be discarded */
150 /DISCARD/ : {
151 *(.exitcall.exit)
152 }
153
154 STABS_DEBUG
155
156 DWARF_DEBUG
157}