blob: 5eb9309181865a15343d39934af2bf282ef57c94 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* $Id: vmlinux.lds.S,v 1.8 2003/05/16 17:18:14 lethal Exp $
2 * ld script to make SuperH Linux kernel
3 * Written by Niibe Yutaka
4 */
Paul Mundtd153ea82006-09-27 18:20:16 +09005#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include <asm-generic/vmlinux.lds.h>
7
8#ifdef CONFIG_CPU_LITTLE_ENDIAN
9OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
10#else
11OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
12#endif
13OUTPUT_ARCH(sh)
14ENTRY(_start)
15SECTIONS
16{
Paul Mundte7f93a32006-09-27 17:19:13 +090017 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 _text = .; /* Text and read-only data */
19 text = .; /* Text and read-only data */
20 .empty_zero_page : {
21 *(.empty_zero_page)
22 } = 0
23 .text : {
24 *(.text)
25 SCHED_TEXT
26 LOCK_TEXT
27 *(.fixup)
28 *(.gnu.warning)
29 } = 0x0009
30
31 . = ALIGN(16); /* Exception table */
32 __start___ex_table = .;
33 __ex_table : { *(__ex_table) }
34 __stop___ex_table = .;
35
36 RODATA
37
38 _etext = .; /* End of text section */
39
40 .data : { /* Data */
41 *(.data)
42
43 /* Align the initial ramdisk image (INITRD) on page boundaries. */
Paul Mundtd153ea82006-09-27 18:20:16 +090044 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 __rd_start = .;
46 *(.initrd)
Paul Mundtd153ea82006-09-27 18:20:16 +090047 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 __rd_end = .;
49
50 CONSTRUCTORS
51 }
52
Paul Mundtd153ea82006-09-27 18:20:16 +090053 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 .data.page_aligned : { *(.data.idt) }
55
56 . = ALIGN(32);
57 __per_cpu_start = .;
58 .data.percpu : { *(.data.percpu) }
59 __per_cpu_end = .;
60 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
61
62 _edata = .; /* End of data section */
63
Paul Mundtd153ea82006-09-27 18:20:16 +090064 . = ALIGN(THREAD_SIZE); /* init_task */
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 .data.init_task : { *(.data.init_task) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Paul Mundtd153ea82006-09-27 18:20:16 +090067 . = ALIGN(PAGE_SIZE); /* Init code and data */
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 __init_begin = .;
69 _sinittext = .;
70 .init.text : { *(.init.text) }
71 _einittext = .;
72 .init.data : { *(.init.data) }
73 . = ALIGN(16);
74 __setup_start = .;
75 .init.setup : { *(.init.setup) }
76 __setup_end = .;
77 __initcall_start = .;
78 .initcall.init : {
79 *(.initcall1.init)
80 *(.initcall2.init)
81 *(.initcall3.init)
82 *(.initcall4.init)
83 *(.initcall5.init)
84 *(.initcall6.init)
85 *(.initcall7.init)
86 }
87 __initcall_end = .;
88 __con_initcall_start = .;
89 .con_initcall.init : { *(.con_initcall.init) }
90 __con_initcall_end = .;
91 SECURITY_INIT
92 __initramfs_start = .;
93 .init.ramfs : { *(.init.ramfs) }
94 __initramfs_end = .;
95 __machvec_start = .;
96 .init.machvec : { *(.init.machvec) }
97 __machvec_end = .;
Paul Mundtd153ea82006-09-27 18:20:16 +090098 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 __init_end = .;
100
101 . = ALIGN(4);
102 __bss_start = .; /* BSS */
103 .bss : { *(.bss) }
104
105 . = ALIGN(4);
106 _end = . ;
107
108 /* When something in the kernel is NOT compiled as a module, the
109 * module cleanup code and data are put into these segments. Both
110 * can then be thrown away, as cleanup code is never called unless
111 * it's a module.
112 */
113 /DISCARD/ : {
114 *(.exit.text)
115 *(.exit.data)
116 *(.exitcall.exit)
117 }
118
119 /* Stabs debugging sections. */
120 .stab 0 : { *(.stab) }
121 .stabstr 0 : { *(.stabstr) }
122 .stab.excl 0 : { *(.stab.excl) }
123 .stab.exclstr 0 : { *(.stab.exclstr) }
124 .stab.index 0 : { *(.stab.index) }
125 .stab.indexstr 0 : { *(.stab.indexstr) }
126 .comment 0 : { *(.comment) }
127 /* DWARF debug sections.
128 Symbols in the DWARF debugging section are relative to the beginning
129 of the section so we begin .debug at 0. */
130 /* DWARF 1 */
131 .debug 0 : { *(.debug) }
132 .line 0 : { *(.line) }
133 /* GNU DWARF 1 extensions */
134 .debug_srcinfo 0 : { *(.debug_srcinfo) }
135 .debug_sfnames 0 : { *(.debug_sfnames) }
136 /* DWARF 1.1 and DWARF 2 */
137 .debug_aranges 0 : { *(.debug_aranges) }
138 .debug_pubnames 0 : { *(.debug_pubnames) }
139 /* DWARF 2 */
140 .debug_info 0 : { *(.debug_info) }
141 .debug_abbrev 0 : { *(.debug_abbrev) }
142 .debug_line 0 : { *(.debug_line) }
143 .debug_frame 0 : { *(.debug_frame) }
144 .debug_str 0 : { *(.debug_str) }
145 .debug_loc 0 : { *(.debug_loc) }
146 .debug_macinfo 0 : { *(.debug_macinfo) }
147 /* SGI/MIPS DWARF 2 extensions */
148 .debug_weaknames 0 : { *(.debug_weaknames) }
149 .debug_funcnames 0 : { *(.debug_funcnames) }
150 .debug_typenames 0 : { *(.debug_typenames) }
151 .debug_varnames 0 : { *(.debug_varnames) }
152 /* These must appear regardless of . */
153}