blob: 2367869d21410639ccc82beddfc0c802adbf4617 [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>
Paul Mundt87e29ca2007-03-01 15:56:31 +09006#include <asm/cache.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 : {
Sam Ravnborg76647092007-05-13 00:31:33 +020025 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 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
Paul Mundtfa691512007-03-08 19:41:21 +090037 _etext = .; /* End of text section */
38
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 RODATA
40
Paul Mundtfa691512007-03-08 19:41:21 +090041 BUG_TABLE
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43 .data : { /* Data */
44 *(.data)
45
46 /* Align the initial ramdisk image (INITRD) on page boundaries. */
Paul Mundtd153ea82006-09-27 18:20:16 +090047 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 __rd_start = .;
49 *(.initrd)
Paul Mundtd153ea82006-09-27 18:20:16 +090050 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 __rd_end = .;
52
53 CONSTRUCTORS
54 }
55
Paul Mundtd153ea82006-09-27 18:20:16 +090056 . = ALIGN(PAGE_SIZE);
Paul Mundtf668f552006-12-12 08:50:36 +090057 .data.page_aligned : { *(.data.page_aligned) }
Paul Mundtfa691512007-03-08 19:41:21 +090058 __nosave_begin = .;
59 .data_nosave : { *(.data.nosave) }
60 . = ALIGN(PAGE_SIZE);
61 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Jeremy Fitzhardingeb6e35902007-05-02 19:27:12 +020063 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 __per_cpu_start = .;
65 .data.percpu : { *(.data.percpu) }
66 __per_cpu_end = .;
67 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
68
69 _edata = .; /* End of data section */
70
Paul Mundtd153ea82006-09-27 18:20:16 +090071 . = ALIGN(THREAD_SIZE); /* init_task */
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 .data.init_task : { *(.data.init_task) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Paul Mundtd153ea82006-09-27 18:20:16 +090074 . = ALIGN(PAGE_SIZE); /* Init code and data */
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 __init_begin = .;
76 _sinittext = .;
77 .init.text : { *(.init.text) }
78 _einittext = .;
79 .init.data : { *(.init.data) }
80 . = ALIGN(16);
81 __setup_start = .;
82 .init.setup : { *(.init.setup) }
83 __setup_end = .;
84 __initcall_start = .;
85 .initcall.init : {
Andrew Morton61ce1ef2006-10-27 11:41:44 -070086 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -070087 }
88 __initcall_end = .;
89 __con_initcall_start = .;
90 .con_initcall.init : { *(.con_initcall.init) }
91 __con_initcall_end = .;
92 SECURITY_INIT
Jean-Paul Saman67d38222007-02-10 01:44:44 -080093
94#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 __initramfs_start = .;
96 .init.ramfs : { *(.init.ramfs) }
97 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -080098#endif
99
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 __machvec_start = .;
101 .init.machvec : { *(.init.machvec) }
102 __machvec_end = .;
Paul Mundtd153ea82006-09-27 18:20:16 +0900103 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 __init_end = .;
105
106 . = ALIGN(4);
107 __bss_start = .; /* BSS */
108 .bss : { *(.bss) }
109
110 . = ALIGN(4);
111 _end = . ;
112
113 /* When something in the kernel is NOT compiled as a module, the
114 * module cleanup code and data are put into these segments. Both
115 * can then be thrown away, as cleanup code is never called unless
116 * it's a module.
117 */
118 /DISCARD/ : {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 *(.exitcall.exit)
120 }
121
Paul Mundtfa691512007-03-08 19:41:21 +0900122 STABS_DEBUG
123
124 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125}