Merge branch 'avr32-arch' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoe...
[linux-2.6] / arch / mn10300 / kernel / vmlinux.lds.S
1 /* 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>
14 #include <asm/page.h>
15
16 OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin")
17 OUTPUT_ARCH(mn10300)
18 ENTRY(_start)
19 jiffies = jiffies_64;
20 #ifndef CONFIG_MN10300_CURRENT_IN_E2
21 current = __current;
22 #endif
23 SECTIONS
24 {
25   . = CONFIG_KERNEL_TEXT_ADDRESS;
26   /* read-only */
27   _stext = .;
28   _text = .;                    /* Text and read-only data */
29   .text : {
30         HEAD_TEXT
31         TEXT_TEXT
32         SCHED_TEXT
33         LOCK_TEXT
34         KPROBES_TEXT
35         *(.fixup)
36         *(.gnu.warning)
37         } = 0xcb
38
39   _etext = .;                   /* End of text section */
40
41   . = ALIGN(16);                /* Exception table */
42   __start___ex_table = .;
43   __ex_table : { *(__ex_table) }
44   __stop___ex_table = .;
45
46   BUG_TABLE
47
48   RODATA
49
50   /* writeable */
51   .data : {                     /* Data */
52         DATA_DATA
53         CONSTRUCTORS
54         }
55
56   . = ALIGN(PAGE_SIZE);
57   __nosave_begin = .;
58   .data_nosave : { *(.data.nosave) }
59   . = ALIGN(PAGE_SIZE);
60   __nosave_end = .;
61
62   . = ALIGN(PAGE_SIZE);
63   .data.page_aligned : { *(.data.idt) }
64
65   . = ALIGN(32);
66   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
67
68   /* rarely changed data like cpu maps */
69   . = ALIGN(32);
70   .data.read_mostly : AT(ADDR(.data.read_mostly)) {
71         *(.data.read_mostly)
72         _edata = .;             /* End of data section */
73   }
74
75   . = ALIGN(THREAD_SIZE);       /* init_task */
76   .data.init_task : { *(.data.init_task) }
77
78   /* might get freed after init */
79   . = ALIGN(PAGE_SIZE);
80   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
81         __smp_locks = .;
82         *(.smp_locks)
83         __smp_locks_end = .;
84   }
85
86   /* will be freed after init */
87   . = ALIGN(PAGE_SIZE);         /* Init code and data */
88   __init_begin = .;
89   .init.text : {
90         _sinittext = .;
91         *(.init.text)
92         _einittext = .;
93   }
94   .init.data : { *(.init.data) }
95   . = ALIGN(16);
96   __setup_start = .;
97   .setup.init : { KEEP(*(.init.setup)) }
98   __setup_end = .;
99
100   __initcall_start = .;
101   .initcall.init : {
102         INITCALLS
103   }
104   __initcall_end = .;
105   __con_initcall_start = .;
106   .con_initcall.init : { *(.con_initcall.init) }
107   __con_initcall_end = .;
108
109   SECURITY_INIT
110   . = ALIGN(4);
111   __alt_instructions = .;
112   .altinstructions : { *(.altinstructions) }
113   __alt_instructions_end = .;
114  .altinstr_replacement : { *(.altinstr_replacement) }
115   /* .exit.text is discard at runtime, not link time, to deal with references
116      from .altinstructions and .eh_frame */
117   .exit.text : { *(.exit.text) }
118   .exit.data : { *(.exit.data) }
119
120 #ifdef CONFIG_BLK_DEV_INITRD
121   . = ALIGN(PAGE_SIZE);
122   __initramfs_start = .;
123   .init.ramfs : { *(.init.ramfs) }
124   __initramfs_end = .;
125 #endif
126
127   PERCPU(32)
128   . = ALIGN(PAGE_SIZE);
129   __init_end = .;
130   /* freed after init ends here */
131
132   __bss_start = .;              /* BSS */
133   .bss : {
134         *(.bss.page_aligned)
135         *(.bss)
136   }
137   . = ALIGN(4);
138   __bss_stop = .;
139
140   _end = . ;
141
142   /* This is where the kernel creates the early boot page tables */
143   . = ALIGN(PAGE_SIZE);
144   pg0 = .;
145
146   /* Sections to be discarded */
147   /DISCARD/ : {
148         *(.exitcall.exit)
149         }
150
151   STABS_DEBUG
152
153   DWARF_DEBUG
154 }