blob: 0220d8a838a780dcfe79121ab13b6617da05632b [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>
6#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#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{
Paul Mundte7f93a32006-09-27 17:19:13 +090018 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 _text = .; /* Text and read-only data */
20 text = .; /* Text and read-only data */
21 .empty_zero_page : {
22 *(.empty_zero_page)
23 } = 0
24 .text : {
25 *(.text)
26 SCHED_TEXT
27 LOCK_TEXT
28 *(.fixup)
29 *(.gnu.warning)
30 } = 0x0009
31
32 . = ALIGN(16); /* Exception table */
33 __start___ex_table = .;
34 __ex_table : { *(__ex_table) }
35 __stop___ex_table = .;
36
37 RODATA
38
39 _etext = .; /* End of text section */
40
41 .data : { /* Data */
42 *(.data)
43
44 /* Align the initial ramdisk image (INITRD) on page boundaries. */
Paul Mundtd153ea82006-09-27 18:20:16 +090045 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 __rd_start = .;
47 *(.initrd)
Paul Mundtd153ea82006-09-27 18:20:16 +090048 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 __rd_end = .;
50
51 CONSTRUCTORS
52 }
53
Paul Mundtd153ea82006-09-27 18:20:16 +090054 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 .data.page_aligned : { *(.data.idt) }
56
57 . = ALIGN(32);
58 __per_cpu_start = .;
59 .data.percpu : { *(.data.percpu) }
60 __per_cpu_end = .;
61 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
62
63 _edata = .; /* End of data section */
64
Paul Mundtd153ea82006-09-27 18:20:16 +090065 . = ALIGN(THREAD_SIZE); /* init_task */
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 .data.init_task : { *(.data.init_task) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Paul Mundtd153ea82006-09-27 18:20:16 +090068 . = ALIGN(PAGE_SIZE); /* Init code and data */
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 __init_begin = .;
70 _sinittext = .;
71 .init.text : { *(.init.text) }
72 _einittext = .;
73 .init.data : { *(.init.data) }
74 . = ALIGN(16);
75 __setup_start = .;
76 .init.setup : { *(.init.setup) }
77 __setup_end = .;
78 __initcall_start = .;
79 .initcall.init : {
80 *(.initcall1.init)
81 *(.initcall2.init)
82 *(.initcall3.init)
83 *(.initcall4.init)
84 *(.initcall5.init)
85 *(.initcall6.init)
86 *(.initcall7.init)
87 }
88 __initcall_end = .;
89 __con_initcall_start = .;
90 .con_initcall.init : { *(.con_initcall.init) }
91 __con_initcall_end = .;
92 SECURITY_INIT
93 __initramfs_start = .;
94 .init.ramfs : { *(.init.ramfs) }
95 __initramfs_end = .;
96 __machvec_start = .;
97 .init.machvec : { *(.init.machvec) }
98 __machvec_end = .;
Paul Mundtd153ea82006-09-27 18:20:16 +090099 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 __init_end = .;
101
102 . = ALIGN(4);
103 __bss_start = .; /* BSS */
104 .bss : { *(.bss) }
105
106 . = ALIGN(4);
107 _end = . ;
108
109 /* When something in the kernel is NOT compiled as a module, the
110 * module cleanup code and data are put into these segments. Both
111 * can then be thrown away, as cleanup code is never called unless
112 * it's a module.
113 */
114 /DISCARD/ : {
115 *(.exit.text)
116 *(.exit.data)
117 *(.exitcall.exit)
118 }
119
120 /* Stabs debugging sections. */
121 .stab 0 : { *(.stab) }
122 .stabstr 0 : { *(.stabstr) }
123 .stab.excl 0 : { *(.stab.excl) }
124 .stab.exclstr 0 : { *(.stab.exclstr) }
125 .stab.index 0 : { *(.stab.index) }
126 .stab.indexstr 0 : { *(.stab.indexstr) }
127 .comment 0 : { *(.comment) }
128 /* DWARF debug sections.
129 Symbols in the DWARF debugging section are relative to the beginning
130 of the section so we begin .debug at 0. */
131 /* DWARF 1 */
132 .debug 0 : { *(.debug) }
133 .line 0 : { *(.line) }
134 /* GNU DWARF 1 extensions */
135 .debug_srcinfo 0 : { *(.debug_srcinfo) }
136 .debug_sfnames 0 : { *(.debug_sfnames) }
137 /* DWARF 1.1 and DWARF 2 */
138 .debug_aranges 0 : { *(.debug_aranges) }
139 .debug_pubnames 0 : { *(.debug_pubnames) }
140 /* DWARF 2 */
141 .debug_info 0 : { *(.debug_info) }
142 .debug_abbrev 0 : { *(.debug_abbrev) }
143 .debug_line 0 : { *(.debug_line) }
144 .debug_frame 0 : { *(.debug_frame) }
145 .debug_str 0 : { *(.debug_str) }
146 .debug_loc 0 : { *(.debug_loc) }
147 .debug_macinfo 0 : { *(.debug_macinfo) }
148 /* SGI/MIPS DWARF 2 extensions */
149 .debug_weaknames 0 : { *(.debug_weaknames) }
150 .debug_funcnames 0 : { *(.debug_funcnames) }
151 .debug_typenames 0 : { *(.debug_typenames) }
152 .debug_varnames 0 : { *(.debug_varnames) }
153 /* These must appear regardless of . */
154}