aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-05-09 10:33:02 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-09 10:33:02 -0400
commitc3e2586b794b12ffcdf69b4e547030b51e18e6d9 (patch)
treed7a98459db20d5910a4ed9cfdb64f260cf66521c /arch/sh
parent7cd0378ef4c0d7b05e7dcb1daa115b841ffdc31a (diff)
sh: Integrate sh64 bits in vmlinux_32.lds.S.
This adds all of the requisite bits from vmlinux_64.lds.S in to the _32 variant, resulting in a unified and generic linker script that can be shared across both. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/vmlinux_32.lds.S113
1 files changed, 70 insertions, 43 deletions
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
index dd9b2ee1312d..8d97f52ce322 100644
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ b/arch/sh/kernel/vmlinux_32.lds.S
@@ -1,17 +1,23 @@
1/* 1/*
2 * ld script to make SuperH Linux kernel 2 * ld script to make SuperH Linux kernel
3 * Written by Niibe Yutaka 3 * Written by Niibe Yutaka and Paul Mundt
4 */ 4 */
5#include <asm/thread_info.h> 5#ifdef CONFIG_SUPERH64
6#include <asm/cache.h> 6#define LOAD_OFFSET CONFIG_PAGE_OFFSET
7#include <asm-generic/vmlinux.lds.h> 7OUTPUT_ARCH(sh:sh5)
8 8#else
9OUTPUT_ARCH(sh)
9#ifdef CONFIG_CPU_LITTLE_ENDIAN 10#ifdef CONFIG_CPU_LITTLE_ENDIAN
10OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") 11OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
11#else 12#else
12OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") 13OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
13#endif 14#endif
14OUTPUT_ARCH(sh) 15#endif
16
17#include <asm/thread_info.h>
18#include <asm/cache.h>
19#include <asm-generic/vmlinux.lds.h>
20
15ENTRY(_start) 21ENTRY(_start)
16SECTIONS 22SECTIONS
17{ 23{
@@ -24,28 +30,35 @@ SECTIONS
24 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; 30 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
25#endif 31#endif
26 32
27 _text = .; /* Text and read-only data */ 33 .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) {
28
29 .empty_zero_page : {
30 *(.empty_zero_page) 34 *(.empty_zero_page)
31 } = 0 35 } = 0
32 36
33 .text : { 37 .text : AT(ADDR(.text) - LOAD_OFFSET) {
38 _text = .; /* Text and read-only data */
34 HEAD_TEXT 39 HEAD_TEXT
35 TEXT_TEXT 40 TEXT_TEXT
41
42#ifdef CONFIG_SUPERH64
43 *(.text64)
44 *(.text..SHmedia32)
45#endif
46
36 SCHED_TEXT 47 SCHED_TEXT
37 LOCK_TEXT 48 LOCK_TEXT
38 KPROBES_TEXT 49 KPROBES_TEXT
50 IRQENTRY_TEXT
39 *(.fixup) 51 *(.fixup)
40 *(.gnu.warning) 52 *(.gnu.warning)
53 _etext = .; /* End of text section */
41 } = 0x0009 54 } = 0x0009
42 55
43 . = ALIGN(16); /* Exception table */ 56 . = ALIGN(16); /* Exception table */
44 __start___ex_table = .; 57 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
45 __ex_table : { *(__ex_table) } 58 __start___ex_table = .;
46 __stop___ex_table = .; 59 *(__ex_table)
47 60 __stop___ex_table = .;
48 _etext = .; /* End of text section */ 61 }
49 62
50 NOTES 63 NOTES
51 RO_DATA(PAGE_SIZE) 64 RO_DATA(PAGE_SIZE)
@@ -54,13 +67,15 @@ SECTIONS
54 * Code which must be executed uncached and the associated data 67 * Code which must be executed uncached and the associated data
55 */ 68 */
56 . = ALIGN(PAGE_SIZE); 69 . = ALIGN(PAGE_SIZE);
57 __uncached_start = .; 70 .uncached : AT(ADDR(.uncached) - LOAD_OFFSET) {
58 .uncached.text : { *(.uncached.text) } 71 __uncached_start = .;
59 .uncached.data : { *(.uncached.data) } 72 *(.uncached.text)
60 __uncached_end = .; 73 *(.uncached.data)
74 __uncached_end = .;
75 }
61 76
62 . = ALIGN(THREAD_SIZE); 77 . = ALIGN(THREAD_SIZE);
63 .data : { /* Data */ 78 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
64 *(.data.init_task) 79 *(.data.init_task)
65 80
66 . = ALIGN(L1_CACHE_BYTES); 81 . = ALIGN(L1_CACHE_BYTES);
@@ -84,39 +99,51 @@ SECTIONS
84 _edata = .; /* End of data section */ 99 _edata = .; /* End of data section */
85 100
86 . = ALIGN(PAGE_SIZE); /* Init code and data */ 101 . = ALIGN(PAGE_SIZE); /* Init code and data */
87 __init_begin = .; 102 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
88 _sinittext = .; 103 __init_begin = .;
89 .init.text : { INIT_TEXT } 104 _sinittext = .;
90 _einittext = .; 105 INIT_TEXT
91 .init.data : { INIT_DATA } 106 _einittext = .;
107 }
108
109 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { INIT_DATA }
92 110
93 . = ALIGN(16); 111 . = ALIGN(16);
94 __setup_start = .; 112 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
95 .init.setup : { *(.init.setup) } 113 __setup_start = .;
96 __setup_end = .; 114 *(.init.setup)
115 __setup_end = .;
116 }
97 117
98 __initcall_start = .; 118 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
99 .initcall.init : { 119 __initcall_start = .;
100 INITCALLS 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 = .;
101 } 128 }
102 __initcall_end = .;
103 __con_initcall_start = .;
104 .con_initcall.init : { *(.con_initcall.init) }
105 __con_initcall_end = .;
106 129
107 SECURITY_INIT 130 SECURITY_INIT
108 131
109#ifdef CONFIG_BLK_DEV_INITRD 132#ifdef CONFIG_BLK_DEV_INITRD
110 . = ALIGN(PAGE_SIZE); 133 . = ALIGN(PAGE_SIZE);
111 __initramfs_start = .; 134 .init.ramfs : AT(ADDR(.init_ramfs) - LOAD_OFFSET) {
112 .init.ramfs : { *(.init.ramfs) } 135 __initramfs_start = .;
113 __initramfs_end = .; 136 *(.init.ramfs)
137 __initramfs_end = .;
138 }
114#endif 139#endif
115 140
116 . = ALIGN(4); 141 . = ALIGN(4);
117 __machvec_start = .; 142 .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
118 .machvec.init : { *(.machvec.init) } 143 __machvec_start = .;
119 __machvec_end = .; 144 *(.machvec.init)
145 __machvec_end = .;
146 }
120 147
121 PERCPU(PAGE_SIZE) 148 PERCPU(PAGE_SIZE)
122 149
@@ -124,11 +151,11 @@ SECTIONS
124 * .exit.text is discarded at runtime, not link time, to deal with 151 * .exit.text is discarded at runtime, not link time, to deal with
125 * references from __bug_table 152 * references from __bug_table
126 */ 153 */
127 .exit.text : { EXIT_TEXT } 154 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
128 .exit.data : { EXIT_DATA } 155 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
129 156
130 . = ALIGN(PAGE_SIZE); 157 . = ALIGN(PAGE_SIZE);
131 .bss : { 158 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
132 __init_end = .; 159 __init_end = .;
133 __bss_start = .; /* BSS */ 160 __bss_start = .; /* BSS */
134 *(.bss.page_aligned) 161 *(.bss.page_aligned)