Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 1 | /* ld script for sparc32/sparc64 kernel */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | |
3 | #include <asm-generic/vmlinux.lds.h> | ||||
Sam Ravnborg | b74e34d | 2008-12-27 00:34:41 -0800 | [diff] [blame] | 4 | |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 5 | #include <asm/page.h> |
Sam Ravnborg | b74e34d | 2008-12-27 00:34:41 -0800 | [diff] [blame] | 6 | #include <asm/thread_info.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 8 | #ifdef CONFIG_SPARC32 |
9 | #define INITIAL_ADDRESS 0x10000 + SIZEOF_HEADERS | ||||
10 | #define TEXTSTART 0xf0004000 | ||||
11 | |||||
12 | #define SMP_CACHE_BYTES_SHIFT 5 | ||||
13 | |||||
14 | #else | ||||
15 | #define SMP_CACHE_BYTES_SHIFT 6 | ||||
16 | #define INITIAL_ADDRESS 0x4000 | ||||
17 | #define TEXTSTART 0x0000000000404000 | ||||
18 | |||||
19 | #endif | ||||
20 | |||||
21 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) | ||||
22 | |||||
23 | #ifdef CONFIG_SPARC32 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") |
25 | OUTPUT_ARCH(sparc) | ||||
26 | ENTRY(_start) | ||||
27 | jiffies = jiffies_64 + 4; | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 28 | #else |
29 | /* sparc64 */ | ||||
30 | OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc") | ||||
31 | OUTPUT_ARCH(sparc:v9a) | ||||
32 | ENTRY(_start) | ||||
33 | jiffies = jiffies_64; | ||||
34 | #endif | ||||
35 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | SECTIONS |
37 | { | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 38 | /* swapper_low_pmd_dir is sparc64 only */ |
39 | swapper_low_pmd_dir = 0x0000000000402000; | ||||
40 | . = INITIAL_ADDRESS; | ||||
41 | .text TEXTSTART : | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 42 | { |
43 | _text = .; | ||||
Al Viro | 5bac287 | 2008-11-22 17:36:04 +0000 | [diff] [blame] | 44 | *(.text.head) |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 45 | TEXT_TEXT |
46 | SCHED_TEXT | ||||
47 | LOCK_TEXT | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 48 | KPROBES_TEXT |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 49 | *(.gnu.warning) |
50 | } = 0 | ||||
51 | _etext = .; | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 52 | |
53 | RO_DATA(PAGE_SIZE) | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 54 | .data : { |
55 | DATA_DATA | ||||
56 | CONSTRUCTORS | ||||
57 | } | ||||
58 | .data1 : { | ||||
59 | *(.data1) | ||||
60 | } | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 61 | . = ALIGN(SMP_CACHE_BYTES); |
62 | .data.cacheline_aligned : { | ||||
63 | *(.data.cacheline_aligned) | ||||
64 | } | ||||
65 | . = ALIGN(SMP_CACHE_BYTES); | ||||
66 | .data.read_mostly : { | ||||
67 | *(.data.read_mostly) | ||||
68 | } | ||||
Sam Ravnborg | b74e34d | 2008-12-27 00:34:41 -0800 | [diff] [blame] | 69 | /* End of data section */ |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 70 | _edata = .; |
Sam Ravnborg | b74e34d | 2008-12-27 00:34:41 -0800 | [diff] [blame] | 71 | |
72 | /* init_task */ | ||||
73 | . = ALIGN(THREAD_SIZE); | ||||
74 | .data.init_task : { | ||||
75 | *(.data.init_task) | ||||
76 | } | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 77 | .fixup : { |
78 | __start___fixup = .; | ||||
79 | *(.fixup) | ||||
80 | __stop___fixup = .; | ||||
81 | } | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 82 | . = ALIGN(16); |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 83 | __ex_table : { |
84 | __start___ex_table = .; | ||||
85 | *(__ex_table) | ||||
86 | __stop___ex_table = .; | ||||
87 | } | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 88 | NOTES |
89 | |||||
90 | . = ALIGN(PAGE_SIZE); | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 91 | .init.text : { |
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 92 | __init_begin = .; |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 93 | _sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 94 | INIT_TEXT |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 95 | _einittext = .; |
96 | } | ||||
97 | __init_text_end = .; | ||||
98 | .init.data : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 99 | INIT_DATA |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 100 | } |
101 | . = ALIGN(16); | ||||
102 | .init.setup : { | ||||
103 | __setup_start = .; | ||||
104 | *(.init.setup) | ||||
105 | __setup_end = .; | ||||
106 | } | ||||
107 | .initcall.init : { | ||||
108 | __initcall_start = .; | ||||
109 | INITCALLS | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 110 | __initcall_end = .; |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 111 | } |
112 | .con_initcall.init : { | ||||
113 | __con_initcall_start = .; | ||||
114 | *(.con_initcall.init) | ||||
115 | __con_initcall_end = .; | ||||
116 | } | ||||
117 | SECURITY_INIT | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 118 | |
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 119 | . = ALIGN(4); |
120 | .tsb_ldquad_phys_patch : { | ||||
121 | __tsb_ldquad_phys_patch = .; | ||||
122 | *(.tsb_ldquad_phys_patch) | ||||
123 | __tsb_ldquad_phys_patch_end = .; | ||||
124 | } | ||||
125 | |||||
126 | .tsb_phys_patch : { | ||||
127 | __tsb_phys_patch = .; | ||||
128 | *(.tsb_phys_patch) | ||||
129 | __tsb_phys_patch_end = .; | ||||
130 | } | ||||
131 | |||||
132 | .cpuid_patch : { | ||||
133 | __cpuid_patch = .; | ||||
134 | *(.cpuid_patch) | ||||
135 | __cpuid_patch_end = .; | ||||
136 | } | ||||
137 | |||||
138 | .sun4v_1insn_patch : { | ||||
139 | __sun4v_1insn_patch = .; | ||||
140 | *(.sun4v_1insn_patch) | ||||
141 | __sun4v_1insn_patch_end = .; | ||||
142 | } | ||||
143 | .sun4v_2insn_patch : { | ||||
144 | __sun4v_2insn_patch = .; | ||||
145 | *(.sun4v_2insn_patch) | ||||
146 | __sun4v_2insn_patch_end = .; | ||||
147 | } | ||||
148 | |||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 149 | #ifdef CONFIG_BLK_DEV_INITRD |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 150 | . = ALIGN(PAGE_SIZE); |
151 | .init.ramfs : { | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 152 | __initramfs_start = .; |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 153 | *(.init.ramfs) |
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 154 | __initramfs_end = .; |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 155 | } |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 156 | #endif |
157 | |||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 158 | PERCPU(PAGE_SIZE) |
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 159 | |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 160 | . = ALIGN(PAGE_SIZE); |
161 | __init_end = .; | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 162 | __bss_start = .; |
163 | .sbss : { | ||||
164 | *(.sbss) | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 165 | *(.scommon) |
166 | } | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 167 | .bss : { |
168 | *(.dynbss) | ||||
169 | *(.bss) | ||||
170 | *(COMMON) | ||||
171 | } | ||||
172 | _end = . ; | ||||
Sam Ravnborg | 1b1fbbc | 2008-11-29 21:44:32 -0800 | [diff] [blame] | 173 | |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 174 | /DISCARD/ : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 175 | EXIT_TEXT |
176 | EXIT_DATA | ||||
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 177 | *(.exitcall.exit) |
178 | } | ||||
David S. Miller | d5784b5 | 2005-12-28 13:22:54 -0800 | [diff] [blame] | 179 | |
Sam Ravnborg | bcbe40e | 2007-09-17 19:02:30 -0700 | [diff] [blame] | 180 | STABS_DEBUG |
181 | DWARF_DEBUG | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | } |