aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/kernel/vmlinux.lds.S182
-rw-r--r--arch/sh/kernel/vmlinux_32.lds.S181
-rw-r--r--arch/sh/kernel/vmlinux_64.lds.S163
3 files changed, 179 insertions, 347 deletions
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index d7d4991f32af..8d97f52ce322 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -1,5 +1,181 @@
1#ifdef CONFIG_SUPERH32 1/*
2# include "vmlinux_32.lds.S" 2 * ld script to make SuperH Linux kernel
3 * Written by Niibe Yutaka and Paul Mundt
4 */
5#ifdef CONFIG_SUPERH64
6#define LOAD_OFFSET CONFIG_PAGE_OFFSET
7OUTPUT_ARCH(sh:sh5)
3#else 8#else
4# include "vmlinux_64.lds.S" 9OUTPUT_ARCH(sh)
10#ifdef CONFIG_CPU_LITTLE_ENDIAN
11OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
12#else
13OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
14#endif
15#endif
16
17#include <asm/thread_info.h>
18#include <asm/cache.h>
19#include <asm-generic/vmlinux.lds.h>
20
21ENTRY(_start)
22SECTIONS
23{
24#ifdef CONFIG_PMB_FIXED
25 . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) +
26 CONFIG_ZERO_PAGE_OFFSET;
27#elif defined(CONFIG_32BIT)
28 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
29#else
30 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
31#endif
32
33 .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) {
34 *(.empty_zero_page)
35 } = 0
36
37 .text : AT(ADDR(.text) - LOAD_OFFSET) {
38 _text = .; /* Text and read-only data */
39 HEAD_TEXT
40 TEXT_TEXT
41
42#ifdef CONFIG_SUPERH64
43 *(.text64)
44 *(.text..SHmedia32)
45#endif
46
47 SCHED_TEXT
48 LOCK_TEXT
49 KPROBES_TEXT
50 IRQENTRY_TEXT
51 *(.fixup)
52 *(.gnu.warning)
53 _etext = .; /* End of text section */
54 } = 0x0009
55
56 . = ALIGN(16); /* Exception table */
57 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
58 __start___ex_table = .;
59 *(__ex_table)
60 __stop___ex_table = .;
61 }
62
63 NOTES
64 RO_DATA(PAGE_SIZE)
65
66 /*
67 * Code which must be executed uncached and the associated data
68 */
69 . = ALIGN(PAGE_SIZE);
70 .uncached : AT(ADDR(.uncached) - LOAD_OFFSET) {
71 __uncached_start = .;
72 *(.uncached.text)
73 *(.uncached.data)
74 __uncached_end = .;
75 }
76
77 . = ALIGN(THREAD_SIZE);
78 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
79 *(.data.init_task)
80
81 . = ALIGN(L1_CACHE_BYTES);
82 *(.data.cacheline_aligned)
83
84 . = ALIGN(L1_CACHE_BYTES);
85 *(.data.read_mostly)
86
87 . = ALIGN(PAGE_SIZE);
88 *(.data.page_aligned)
89
90 __nosave_begin = .;
91 *(.data.nosave)
92 . = ALIGN(PAGE_SIZE);
93 __nosave_end = .;
94
95 DATA_DATA
96 CONSTRUCTORS
97 }
98
99 _edata = .; /* End of data section */
100
101 . = ALIGN(PAGE_SIZE); /* Init code and data */
102 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
103 __init_begin = .;
104 _sinittext = .;
105 INIT_TEXT
106 _einittext = .;
107 }
108
109 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { INIT_DATA }
110
111 . = ALIGN(16);
112 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
113 __setup_start = .;
114 *(.init.setup)
115 __setup_end = .;
116 }
117
118 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
119 __initcall_start = .;
120 INITCALLS
121 __initcall_end = .;
122 }
123
124 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
125 __con_initcall_start = .;
126 *(.con_initcall.init)
127 __con_initcall_end = .;
128 }
129
130 SECURITY_INIT
131
132#ifdef CONFIG_BLK_DEV_INITRD
133 . = ALIGN(PAGE_SIZE);
134 .init.ramfs : AT(ADDR(.init_ramfs) - LOAD_OFFSET) {
135 __initramfs_start = .;
136 *(.init.ramfs)
137 __initramfs_end = .;
138 }
5#endif 139#endif
140
141 . = ALIGN(4);
142 .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
143 __machvec_start = .;
144 *(.machvec.init)
145 __machvec_end = .;
146 }
147
148 PERCPU(PAGE_SIZE)
149
150 /*
151 * .exit.text is discarded at runtime, not link time, to deal with
152 * references from __bug_table
153 */
154 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
155 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
156
157 . = ALIGN(PAGE_SIZE);
158 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
159 __init_end = .;
160 __bss_start = .; /* BSS */
161 *(.bss.page_aligned)
162 *(.bss)
163 *(COMMON)
164 . = ALIGN(4);
165 _ebss = .; /* uClinux MTD sucks */
166 _end = . ;
167 }
168
169 /*
170 * When something in the kernel is NOT compiled as a module, the
171 * module cleanup code and data are put into these segments. Both
172 * can then be thrown away, as cleanup code is never called unless
173 * it's a module.
174 */
175 /DISCARD/ : {
176 *(.exitcall.exit)
177 }
178
179 STABS_DEBUG
180 DWARF_DEBUG
181}
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
deleted file mode 100644
index 8d97f52ce322..000000000000
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * ld script to make SuperH Linux kernel
3 * Written by Niibe Yutaka and Paul Mundt
4 */
5#ifdef CONFIG_SUPERH64
6#define LOAD_OFFSET CONFIG_PAGE_OFFSET
7OUTPUT_ARCH(sh:sh5)
8#else
9OUTPUT_ARCH(sh)
10#ifdef CONFIG_CPU_LITTLE_ENDIAN
11OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
12#else
13OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
14#endif
15#endif
16
17#include <asm/thread_info.h>
18#include <asm/cache.h>
19#include <asm-generic/vmlinux.lds.h>
20
21ENTRY(_start)
22SECTIONS
23{
24#ifdef CONFIG_PMB_FIXED
25 . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) +
26 CONFIG_ZERO_PAGE_OFFSET;
27#elif defined(CONFIG_32BIT)
28 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
29#else
30 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
31#endif
32
33 .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) {
34 *(.empty_zero_page)
35 } = 0
36
37 .text : AT(ADDR(.text) - LOAD_OFFSET) {
38 _text = .; /* Text and read-only data */
39 HEAD_TEXT
40 TEXT_TEXT
41
42#ifdef CONFIG_SUPERH64
43 *(.text64)
44 *(.text..SHmedia32)
45#endif
46
47 SCHED_TEXT
48 LOCK_TEXT
49 KPROBES_TEXT
50 IRQENTRY_TEXT
51 *(.fixup)
52 *(.gnu.warning)
53 _etext = .; /* End of text section */
54 } = 0x0009
55
56 . = ALIGN(16); /* Exception table */
57 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
58 __start___ex_table = .;
59 *(__ex_table)
60 __stop___ex_table = .;
61 }
62
63 NOTES
64 RO_DATA(PAGE_SIZE)
65
66 /*
67 * Code which must be executed uncached and the associated data
68 */
69 . = ALIGN(PAGE_SIZE);
70 .uncached : AT(ADDR(.uncached) - LOAD_OFFSET) {
71 __uncached_start = .;
72 *(.uncached.text)
73 *(.uncached.data)
74 __uncached_end = .;
75 }
76
77 . = ALIGN(THREAD_SIZE);
78 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
79 *(.data.init_task)
80
81 . = ALIGN(L1_CACHE_BYTES);
82 *(.data.cacheline_aligned)
83
84 . = ALIGN(L1_CACHE_BYTES);
85 *(.data.read_mostly)
86
87 . = ALIGN(PAGE_SIZE);
88 *(.data.page_aligned)
89
90 __nosave_begin = .;
91 *(.data.nosave)
92 . = ALIGN(PAGE_SIZE);
93 __nosave_end = .;
94
95 DATA_DATA
96 CONSTRUCTORS
97 }
98
99 _edata = .; /* End of data section */
100
101 . = ALIGN(PAGE_SIZE); /* Init code and data */
102 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
103 __init_begin = .;
104 _sinittext = .;
105 INIT_TEXT
106 _einittext = .;
107 }
108
109 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { INIT_DATA }
110
111 . = ALIGN(16);
112 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
113 __setup_start = .;
114 *(.init.setup)
115 __setup_end = .;
116 }
117
118 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
119 __initcall_start = .;
120 INITCALLS
121 __initcall_end = .;
122 }
123
124 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
125 __con_initcall_start = .;
126 *(.con_initcall.init)
127 __con_initcall_end = .;
128 }
129
130 SECURITY_INIT
131
132#ifdef CONFIG_BLK_DEV_INITRD
133 . = ALIGN(PAGE_SIZE);
134 .init.ramfs : AT(ADDR(.init_ramfs) - LOAD_OFFSET) {
135 __initramfs_start = .;
136 *(.init.ramfs)
137 __initramfs_end = .;
138 }
139#endif
140
141 . = ALIGN(4);
142 .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
143 __machvec_start = .;
144 *(.machvec.init)
145 __machvec_end = .;
146 }
147
148 PERCPU(PAGE_SIZE)
149
150 /*
151 * .exit.text is discarded at runtime, not link time, to deal with
152 * references from __bug_table
153 */
154 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
155 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
156
157 . = ALIGN(PAGE_SIZE);
158 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
159 __init_end = .;
160 __bss_start = .; /* BSS */
161 *(.bss.page_aligned)
162 *(.bss)
163 *(COMMON)
164 . = ALIGN(4);
165 _ebss = .; /* uClinux MTD sucks */
166 _end = . ;
167 }
168
169 /*
170 * When something in the kernel is NOT compiled as a module, the
171 * module cleanup code and data are put into these segments. Both
172 * can then be thrown away, as cleanup code is never called unless
173 * it's a module.
174 */
175 /DISCARD/ : {
176 *(.exitcall.exit)
177 }
178
179 STABS_DEBUG
180 DWARF_DEBUG
181}
diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S
deleted file mode 100644
index 69664460c688..000000000000
--- a/arch/sh/kernel/vmlinux_64.lds.S
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2 * ld script to make SH64 Linux kernel
3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 *
6 * benedict.gaster@superh.com: 2nd May 2002
7 * Add definition of empty_zero_page to be the first page of kernel image.
8 *
9 * benedict.gaster@superh.com: 3rd May 2002
10 * Added support for ramdisk, removing statically linked romfs at the
11 * same time.
12 *
13 * lethal@linux-sh.org: 9th May 2003
14 * Kill off GLOBAL_NAME() usage and other CDC-isms.
15 *
16 * lethal@linux-sh.org: 19th May 2003
17 * Remove support for ancient toolchains.
18 *
19 * This file is subject to the terms and conditions of the GNU General Public
20 * License. See the file "COPYING" in the main directory of this archive
21 * for more details.
22 */
23#include <asm/page.h>
24#include <asm/cache.h>
25#include <asm/thread_info.h>
26
27#define LOAD_OFFSET CONFIG_PAGE_OFFSET
28#include <asm-generic/vmlinux.lds.h>
29
30OUTPUT_ARCH(sh:sh5)
31
32#define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET)
33
34ENTRY(__start)
35SECTIONS
36{
37 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE;
38 _text = .; /* Text and read-only data */
39
40 .empty_zero_page : C_PHYS(.empty_zero_page) {
41 *(.empty_zero_page)
42 } = 0
43
44 .text : C_PHYS(.text) {
45 HEAD_TEXT
46 TEXT_TEXT
47 *(.text64)
48 *(.text..SHmedia32)
49 SCHED_TEXT
50 LOCK_TEXT
51 KPROBES_TEXT
52 *(.fixup)
53 *(.gnu.warning)
54#ifdef CONFIG_CPU_LITTLE_ENDIAN
55 } = 0x6ff0fff0
56#else
57 } = 0xf0fff06f
58#endif
59
60 /* We likely want __ex_table to be Cache Line aligned */
61 . = ALIGN(L1_CACHE_BYTES); /* Exception table */
62 __start___ex_table = .;
63 __ex_table : C_PHYS(__ex_table) { *(__ex_table) }
64 __stop___ex_table = .;
65
66 _etext = .; /* End of text section */
67
68 NOTES
69 RO_DATA(PAGE_SIZE)
70
71 . = ALIGN(THREAD_SIZE);
72 .data : C_PHYS(.data) { /* Data */
73 *(.data.init_task)
74
75 . = ALIGN(L1_CACHE_BYTES);
76 *(.data.cacheline_aligned)
77
78 . = ALIGN(L1_CACHE_BYTES);
79 *(.data.read_mostly)
80
81 . = ALIGN(PAGE_SIZE);
82 *(.data.page_aligned)
83
84 __nosave_begin = .;
85 *(.data.nosave)
86 . = ALIGN(PAGE_SIZE);
87 __nosave_end = .;
88
89 DATA_DATA
90 CONSTRUCTORS
91 }
92
93 _edata = .; /* End of data section */
94
95 . = ALIGN(PAGE_SIZE); /* Init code and data */
96 __init_begin = .;
97 _sinittext = .;
98 .init.text : C_PHYS(.init.text) { INIT_TEXT }
99 _einittext = .;
100 .init.data : C_PHYS(.init.data) { INIT_DATA }
101 . = ALIGN(L1_CACHE_BYTES); /* Better if Cache Line aligned */
102 __setup_start = .;
103 .init.setup : C_PHYS(.init.setup) { *(.init.setup) }
104 __setup_end = .;
105 __initcall_start = .;
106 .initcall.init : C_PHYS(.initcall.init) {
107 INITCALLS
108 }
109 __initcall_end = .;
110 __con_initcall_start = .;
111 .con_initcall.init : C_PHYS(.con_initcall.init) {
112 *(.con_initcall.init)
113 }
114 __con_initcall_end = .;
115
116 SECURITY_INIT
117
118#ifdef CONFIG_BLK_DEV_INITRD
119 . = ALIGN(PAGE_SIZE);
120 __initramfs_start = .;
121 .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) }
122 __initramfs_end = .;
123#endif
124
125 . = ALIGN(8);
126 __machvec_start = .;
127 .machvec.init : C_PHYS(.machvec.init) { *(.machvec.init) }
128 __machvec_end = .;
129
130 PERCPU(PAGE_SIZE)
131
132 /*
133 * .exit.text is discarded at runtime, not link time, to deal with
134 * references from __bug_table
135 */
136 .exit.text : C_PHYS(.exit.text) { EXIT_TEXT }
137 .exit.data : C_PHYS(.exit.data) { EXIT_DATA }
138
139 . = ALIGN(PAGE_SIZE);
140 .bss : C_PHYS(.bss) {
141 __init_end = .;
142 __bss_start = .; /* BSS */
143 *(.bss.page_aligned)
144 *(.bss)
145 *(COMMON)
146 . = ALIGN(4);
147 _ebss = .; /* uClinux MTD sucks */
148 _end = . ;
149 }
150
151 /*
152 * When something in the kernel is NOT compiled as a module, the
153 * module cleanup code and data are put into these segments. Both
154 * can then be thrown away, as cleanup code is never called unless
155 * it's a module.
156 */
157 /DISCARD/ : {
158 *(.exitcall.exit)
159 }
160
161 STABS_DEBUG
162 DWARF_DEBUG
163}