blob: 50c69c18dced77a3473c3d006d0fd6a065932741 [file] [log] [blame]
Paul Mundt49e6c3e2007-11-11 17:58:11 +09001/*
2 * ld script to make SuperH Linux kernel
3 * Written by Niibe Yutaka
4 */
5#include <asm/thread_info.h>
6#include <asm/cache.h>
7#include <asm-generic/vmlinux.lds.h>
8
9#ifdef CONFIG_CPU_LITTLE_ENDIAN
10OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
11#else
12OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
13#endif
14OUTPUT_ARCH(sh)
15ENTRY(_start)
16SECTIONS
17{
18 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
19 _text = .; /* Text and read-only data */
20
21 .empty_zero_page : {
22 *(.empty_zero_page)
23 } = 0
24
25 .text : {
26 *(.text.head)
27 TEXT_TEXT
28 SCHED_TEXT
29 LOCK_TEXT
30 KPROBES_TEXT
31 *(.fixup)
32 *(.gnu.warning)
33 } = 0x0009
34
35 . = ALIGN(16); /* Exception table */
36 __start___ex_table = .;
37 __ex_table : { *(__ex_table) }
38 __stop___ex_table = .;
39
40 _etext = .; /* End of text section */
41
42 BUG_TABLE
43 NOTES
44 RO_DATA(PAGE_SIZE)
45
Stuart Menefycbaa1182007-11-30 17:06:36 +090046 /*
47 * Code which must be executed uncached and the associated data
48 */
49 . = ALIGN(PAGE_SIZE);
50 __uncached_start = .;
51 .uncached.text : { *(.uncached.text) }
52 .uncached.data : { *(.uncached.data) }
53 __uncached_end = .;
54
Paul Mundt49e6c3e2007-11-11 17:58:11 +090055 . = ALIGN(THREAD_SIZE);
56 .data : { /* Data */
57 *(.data.init_task)
58
59 . = ALIGN(L1_CACHE_BYTES);
60 *(.data.cacheline_aligned)
61
62 . = ALIGN(L1_CACHE_BYTES);
63 *(.data.read_mostly)
64
65 . = ALIGN(PAGE_SIZE);
66 *(.data.page_aligned)
67
68 __nosave_begin = .;
69 *(.data.nosave)
70 . = ALIGN(PAGE_SIZE);
71 __nosave_end = .;
72
73 DATA_DATA
74 CONSTRUCTORS
75 }
76
77 _edata = .; /* End of data section */
78
79 . = ALIGN(PAGE_SIZE); /* Init code and data */
80 __init_begin = .;
81 _sinittext = .;
82 .init.text : { *(.init.text) }
83 _einittext = .;
84 .init.data : { *(.init.data) }
85
86 . = ALIGN(16);
87 __setup_start = .;
88 .init.setup : { *(.init.setup) }
89 __setup_end = .;
90
91 __initcall_start = .;
92 .initcall.init : {
93 INITCALLS
94 }
95 __initcall_end = .;
96 __con_initcall_start = .;
97 .con_initcall.init : { *(.con_initcall.init) }
98 __con_initcall_end = .;
99
100 SECURITY_INIT
101
102#ifdef CONFIG_BLK_DEV_INITRD
103 . = ALIGN(PAGE_SIZE);
104 __initramfs_start = .;
105 .init.ramfs : { *(.init.ramfs) }
106 __initramfs_end = .;
107#endif
108
109 . = ALIGN(4);
110 __machvec_start = .;
111 .machvec.init : { *(.machvec.init) }
112 __machvec_end = .;
113
114 PERCPU(PAGE_SIZE)
115
116 /*
117 * .exit.text is discarded at runtime, not link time, to deal with
118 * references from __bug_table
119 */
120 .exit.text : { *(.exit.text) }
121 .exit.data : { *(.exit.data) }
122
123 . = ALIGN(PAGE_SIZE);
124 .bss : {
125 __init_end = .;
126 __bss_start = .; /* BSS */
127 *(.bss.page_aligned)
128 *(.bss)
129 *(COMMON)
130 . = ALIGN(4);
131 _ebss = .; /* uClinux MTD sucks */
132 _end = . ;
133 }
134
135 /*
136 * When something in the kernel is NOT compiled as a module, the
137 * module cleanup code and data are put into these segments. Both
138 * can then be thrown away, as cleanup code is never called unless
139 * it's a module.
140 */
141 /DISCARD/ : {
142 *(.exitcall.exit)
143 }
144
145 STABS_DEBUG
146 DWARF_DEBUG
147}