blob: 3d16d6ef47e1f31cdadefbb836cf66baff97df87 [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 : {
Paul Mundt339547b2007-07-20 17:40:03 +090025 *(.text.head)
Sam Ravnborg76647092007-05-13 00:31:33 +020026 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 SCHED_TEXT
28 LOCK_TEXT
29 *(.fixup)
30 *(.gnu.warning)
31 } = 0x0009
32
33 . = ALIGN(16); /* Exception table */
34 __start___ex_table = .;
35 __ex_table : { *(__ex_table) }
36 __stop___ex_table = .;
37
Paul Mundtfa691512007-03-08 19:41:21 +090038 _etext = .; /* End of text section */
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 RODATA
41
Paul Mundtfa691512007-03-08 19:41:21 +090042 BUG_TABLE
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
44 .data : { /* Data */
Sam Ravnborgca967252007-05-17 13:38:44 +020045 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
47 /* Align the initial ramdisk image (INITRD) on page boundaries. */
Paul Mundtd153ea82006-09-27 18:20:16 +090048 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 __rd_start = .;
50 *(.initrd)
Paul Mundtd153ea82006-09-27 18:20:16 +090051 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 __rd_end = .;
53
54 CONSTRUCTORS
55 }
56
Paul Mundtd153ea82006-09-27 18:20:16 +090057 . = ALIGN(PAGE_SIZE);
Paul Mundtf668f552006-12-12 08:50:36 +090058 .data.page_aligned : { *(.data.page_aligned) }
Paul Mundtfa691512007-03-08 19:41:21 +090059 __nosave_begin = .;
60 .data_nosave : { *(.data.nosave) }
61 . = ALIGN(PAGE_SIZE);
62 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Fenghua Yu5fb7dc32007-07-19 01:48:12 -070064 PERCPU(PAGE_SIZE)
Paul Mundt34973372007-10-09 15:20:53 +090065
66 . = ALIGN(L1_CACHE_BYTES);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 .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
Paul Mundt34973372007-10-09 15:20:53 +090095 . = ALIGN(PAGE_SIZE);
96
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 __initramfs_start = .;
98 .init.ramfs : { *(.init.ramfs) }
99 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800100#endif
101
Takashi YOSHII3a3c60f2007-05-23 12:34:13 +0900102 . = ALIGN(4);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 __machvec_start = .;
Paul Mundt9655ad02007-05-14 15:59:09 +0900104 .machvec.init : { *(.machvec.init) }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 __machvec_end = .;
Paul Mundt9655ad02007-05-14 15:59:09 +0900106
Paul Mundtd153ea82006-09-27 18:20:16 +0900107 . = ALIGN(PAGE_SIZE);
Paul Mundte1811272007-07-12 10:40:36 +0900108 .bss : {
109 __init_end = .;
110 __bss_start = .; /* BSS */
111 *(.bss.page_aligned)
112 *(.bss)
113 . = ALIGN(4);
Paul Mundt1f91bbb2007-09-24 18:11:27 +0900114 _ebss = .; /* uClinux MTD sucks */
Paul Mundte1811272007-07-12 10:40:36 +0900115 _end = . ;
116 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117
118 /* When something in the kernel is NOT compiled as a module, the
119 * module cleanup code and data are put into these segments. Both
120 * can then be thrown away, as cleanup code is never called unless
121 * it's a module.
122 */
123 /DISCARD/ : {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124 *(.exitcall.exit)
125 }
126
Paul Mundtfa691512007-03-08 19:41:21 +0900127 STABS_DEBUG
128
129 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130}