aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-10-30 04:38:03 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-10-30 04:38:03 -0400
commit36b13d767ad68713ab498d71c8df78ca788bda63 (patch)
tree30ec454a639e352ab707bc9f1d7758c01fffdc11 /arch
parent69d1ef4caf77da7164d3e392bf0a8057b42cf26e (diff)
sh: linker script tidying.
Some cleanups to the SH linker script. This reorders some of the data sections for more optimal placement, general tabification, and plugging in omitted generic definitions. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/vmlinux.lds.S197
1 files changed, 104 insertions, 93 deletions
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index 081147c401b6..0956fb3681a3 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -1,4 +1,4 @@
1/* $Id: vmlinux.lds.S,v 1.8 2003/05/16 17:18:14 lethal Exp $ 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
4 */ 4 */
@@ -15,113 +15,124 @@ OUTPUT_ARCH(sh)
15ENTRY(_start) 15ENTRY(_start)
16SECTIONS 16SECTIONS
17{ 17{
18 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; 18 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
19 _text = .; /* Text and read-only data */ 19 _text = .; /* Text and read-only data */
20 text = .; /* Text and read-only data */ 20
21 .empty_zero_page : { 21 .empty_zero_page : {
22 *(.empty_zero_page) 22 *(.empty_zero_page)
23 } = 0 23 } = 0
24 .text : { 24
25 *(.text.head) 25 .text : {
26 TEXT_TEXT 26 *(.text.head)
27 SCHED_TEXT 27 TEXT_TEXT
28 LOCK_TEXT 28 SCHED_TEXT
29 *(.fixup) 29 LOCK_TEXT
30 *(.gnu.warning) 30 KPROBES_TEXT
31 *(.fixup)
32 *(.gnu.warning)
31 } = 0x0009 33 } = 0x0009
32 34
33 . = ALIGN(16); /* Exception table */ 35 . = ALIGN(16); /* Exception table */
34 __start___ex_table = .; 36 __start___ex_table = .;
35 __ex_table : { *(__ex_table) } 37 __ex_table : { *(__ex_table) }
36 __stop___ex_table = .; 38 __stop___ex_table = .;
39
40 _etext = .; /* End of text section */
41
42 BUG_TABLE
43 NOTES
44 RO_DATA(PAGE_SIZE)
37 45
38 _etext = .; /* End of text section */ 46 . = ALIGN(THREAD_SIZE);
47 .data : { /* Data */
48 *(.data.init_task)
39 49
40 RODATA 50 . = ALIGN(L1_CACHE_BYTES);
51 *(.data.cacheline_aligned)
41 52
42 BUG_TABLE 53 . = ALIGN(L1_CACHE_BYTES);
54 *(.data.read_mostly)
43 55
44 .data : { /* Data */ 56 . = ALIGN(PAGE_SIZE);
45 DATA_DATA 57 *(.data.page_aligned)
46 CONSTRUCTORS 58
59 __nosave_begin = .;
60 *(.data.nosave)
61 . = ALIGN(PAGE_SIZE);
62 __nosave_end = .;
63
64 DATA_DATA
65 CONSTRUCTORS
47 } 66 }
48 67
49 . = ALIGN(PAGE_SIZE); 68 _edata = .; /* End of data section */
50 .data.page_aligned : { *(.data.page_aligned) }
51 __nosave_begin = .;
52 .data_nosave : { *(.data.nosave) }
53 . = ALIGN(PAGE_SIZE);
54 __nosave_end = .;
55
56 PERCPU(PAGE_SIZE)
57
58 . = ALIGN(L1_CACHE_BYTES);
59 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
60
61 _edata = .; /* End of data section */
62
63 . = ALIGN(THREAD_SIZE); /* init_task */
64 .data.init_task : { *(.data.init_task) }
65
66 . = ALIGN(PAGE_SIZE); /* Init code and data */
67 __init_begin = .;
68 _sinittext = .;
69 .init.text : { *(.init.text) }
70 _einittext = .;
71 .init.data : { *(.init.data) }
72 . = ALIGN(16);
73 __setup_start = .;
74 .init.setup : { *(.init.setup) }
75 __setup_end = .;
76 __initcall_start = .;
77 .initcall.init : {
78 INITCALLS
79 }
80 __initcall_end = .;
81 __con_initcall_start = .;
82 .con_initcall.init : { *(.con_initcall.init) }
83 __con_initcall_end = .;
84 SECURITY_INIT
85
86 /* .exit.text is discarded at runtime, not link time, to deal with
87 references from .rodata */
88 .exit.text : { *(.exit.text) }
89 .exit.data : { *(.exit.data) }
90 69
91#ifdef CONFIG_BLK_DEV_INITRD 70 . = ALIGN(PAGE_SIZE); /* Init code and data */
92 . = ALIGN(PAGE_SIZE); 71 __init_begin = .;
72 _sinittext = .;
73 .init.text : { *(.init.text) }
74 _einittext = .;
75 .init.data : { *(.init.data) }
93 76
94 __initramfs_start = .; 77 . = ALIGN(16);
95 .init.ramfs : { *(.init.ramfs) } 78 __setup_start = .;
96 __initramfs_end = .; 79 .init.setup : { *(.init.setup) }
80 __setup_end = .;
81
82 __initcall_start = .;
83 .initcall.init : {
84 INITCALLS
85 }
86 __initcall_end = .;
87 __con_initcall_start = .;
88 .con_initcall.init : { *(.con_initcall.init) }
89 __con_initcall_end = .;
90
91 SECURITY_INIT
92
93#ifdef CONFIG_BLK_DEV_INITRD
94 . = ALIGN(PAGE_SIZE);
95 __initramfs_start = .;
96 .init.ramfs : { *(.init.ramfs) }
97 __initramfs_end = .;
97#endif 98#endif
98 99
99 . = ALIGN(4);
100 __machvec_start = .;
101 .machvec.init : { *(.machvec.init) }
102 __machvec_end = .;
103
104 . = ALIGN(PAGE_SIZE);
105 .bss : {
106 __init_end = .;
107 __bss_start = .; /* BSS */
108 *(.bss.page_aligned)
109 *(.bss)
110 . = ALIGN(4); 100 . = ALIGN(4);
111 _ebss = .; /* uClinux MTD sucks */ 101 __machvec_start = .;
112 _end = . ; 102 .machvec.init : { *(.machvec.init) }
113 } 103 __machvec_end = .;
114 104
115 /* When something in the kernel is NOT compiled as a module, the 105 PERCPU(PAGE_SIZE)
116 * module cleanup code and data are put into these segments. Both 106
117 * can then be thrown away, as cleanup code is never called unless 107 /*
118 * it's a module. 108 * .exit.text is discarded at runtime, not link time, to deal with
119 */ 109 * references from __bug_table
120 /DISCARD/ : { 110 */
121 *(.exitcall.exit) 111 .exit.text : { *(.exit.text) }
112 .exit.data : { *(.exit.data) }
113
114 . = ALIGN(PAGE_SIZE);
115 .bss : {
116 __init_end = .;
117 __bss_start = .; /* BSS */
118 *(.bss.page_aligned)
119 *(.bss)
120 *(COMMON)
121 . = ALIGN(4);
122 _ebss = .; /* uClinux MTD sucks */
123 _end = . ;
122 } 124 }
123 125
124 STABS_DEBUG 126 /*
127 * When something in the kernel is NOT compiled as a module, the
128 * module cleanup code and data are put into these segments. Both
129 * can then be thrown away, as cleanup code is never called unless
130 * it's a module.
131 */
132 /DISCARD/ : {
133 *(.exitcall.exit)
134 }
125 135
126 DWARF_DEBUG 136 STABS_DEBUG
137 DWARF_DEBUG
127} 138}