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