diff options
author | Mike Frysinger <michael.frysinger@analog.com> | 2007-06-11 05:27:05 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-06-11 05:27:05 -0400 |
commit | de6a9520d4c799ce2079c59457b06251367e67b6 (patch) | |
tree | a7725822967ea0a946eb1f75745832664747b210 /arch/blackfin | |
parent | 43a3188ea348c41a197a754164ff96cc48124d85 (diff) |
Blackfin arch: redo our linker script a bit
- we can start taking advantages of defines in asm-generic/vmlinux.lds.h
- move our L1 relocated sections into init so it gets freed after relocation
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/kernel/vmlinux.lds.S | 167 |
1 files changed, 56 insertions, 111 deletions
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 19b853af4d7e..1ef1e36b3957 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S | |||
@@ -7,7 +7,7 @@ | |||
7 | * Description: Master linker script for blackfin architecture | 7 | * Description: Master linker script for blackfin architecture |
8 | * | 8 | * |
9 | * Modified: | 9 | * Modified: |
10 | * Copyright 2004-2006 Analog Devices Inc. | 10 | * Copyright 2004-2007 Analog Devices Inc. |
11 | * | 11 | * |
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
13 | * | 13 | * |
@@ -32,98 +32,54 @@ | |||
32 | #include <asm-generic/vmlinux.lds.h> | 32 | #include <asm-generic/vmlinux.lds.h> |
33 | #include <asm/mem_map.h> | 33 | #include <asm/mem_map.h> |
34 | 34 | ||
35 | |||
36 | OUTPUT_FORMAT("elf32-bfin") | 35 | OUTPUT_FORMAT("elf32-bfin") |
37 | ENTRY(__start) | 36 | ENTRY(__start) |
38 | _jiffies = _jiffies_64; | 37 | _jiffies = _jiffies_64; |
39 | 38 | ||
40 | MEMORY | ||
41 | { | ||
42 | ram : ORIGIN = CONFIG_BOOT_LOAD, LENGTH = (CONFIG_MEM_SIZE * 1024 * 1024) - (CONFIG_BOOT_LOAD) | ||
43 | l1_data_a : ORIGIN = L1_DATA_A_START, LENGTH = L1_DATA_A_LENGTH | ||
44 | l1_data_b : ORIGIN = L1_DATA_B_START, LENGTH = L1_DATA_B_LENGTH | ||
45 | l1_code : ORIGIN = L1_CODE_START, LENGTH = L1_CODE_LENGTH | ||
46 | l1_scratch : ORIGIN = L1_SCRATCH_START, LENGTH = L1_SCRATCH_LENGTH | ||
47 | } | ||
48 | |||
49 | SECTIONS | 39 | SECTIONS |
50 | { | 40 | { |
51 | . = CONFIG_BOOT_LOAD; | 41 | . = CONFIG_BOOT_LOAD; |
52 | |||
53 | .text : | 42 | .text : |
54 | { | 43 | { |
55 | __text = .; | 44 | __text = .; |
56 | _text = .; | 45 | _text = .; |
57 | __stext = .; | 46 | __stext = .; |
58 | TEXT_TEXT | 47 | TEXT_TEXT |
59 | SCHED_TEXT | 48 | SCHED_TEXT |
49 | LOCK_TEXT | ||
60 | *(.text.lock) | 50 | *(.text.lock) |
51 | *(.fixup) | ||
52 | |||
61 | . = ALIGN(16); | 53 | . = ALIGN(16); |
62 | ___start___ex_table = .; | 54 | ___start___ex_table = .; |
63 | *(__ex_table) | 55 | *(__ex_table) |
64 | ___stop___ex_table = .; | 56 | ___stop___ex_table = .; |
65 | |||
66 | *($code) | ||
67 | *(.rodata) | ||
68 | *(.rodata.*) | ||
69 | *(__vermagic) /* Kernel version magic */ | ||
70 | *(.rodata1) | ||
71 | *(.fixup) | ||
72 | *(.spinlock.text) | ||
73 | 57 | ||
74 | /* Kernel symbol table: Normal symbols */ | ||
75 | . = ALIGN(4); | 58 | . = ALIGN(4); |
76 | ___start___ksymtab = .; | ||
77 | *(__ksymtab) | ||
78 | ___stop___ksymtab = .; | ||
79 | |||
80 | /* Kernel symbol table: GPL-only symbols */ | ||
81 | ___start___ksymtab_gpl = .; | ||
82 | *(__ksymtab_gpl) | ||
83 | ___stop___ksymtab_gpl = .; | ||
84 | |||
85 | /* Kernel symbol table: Normal unused symbols */ \ | ||
86 | ___start___ksymtab_unused = .; | ||
87 | *(__ksymtab_unused) | ||
88 | ___stop___ksymtab_unused = .; | ||
89 | |||
90 | /* Kernel symbol table: GPL-only unused symbols */ | ||
91 | ___start___ksymtab_unused_gpl = .; | ||
92 | *(__ksymtab_unused_gpl) | ||
93 | ___stop___ksymtab_unused_gpl = .; | ||
94 | |||
95 | |||
96 | /* Kernel symbol table: GPL-future symbols */ | ||
97 | ___start___ksymtab_gpl_future = .; | ||
98 | *(__ksymtab_gpl_future) | ||
99 | ___stop___ksymtab_gpl_future = .; | ||
100 | |||
101 | /* Kernel symbol table: Normal symbols */ | ||
102 | ___start___kcrctab = .; | ||
103 | *(__kcrctab) | ||
104 | ___stop___kcrctab = .; | ||
105 | |||
106 | /* Kernel symbol table: GPL-only symbols */ | ||
107 | ___start___kcrctab_gpl = .; | ||
108 | *(__kcrctab_gpl) | ||
109 | ___stop___kcrctab_gpl = .; | ||
110 | |||
111 | /* Kernel symbol table: GPL-future symbols */ | ||
112 | ___start___kcrctab_gpl_future = .; | ||
113 | *(__kcrctab_gpl_future) | ||
114 | ___stop___kcrctab_gpl_future = .; | ||
115 | |||
116 | /* Kernel symbol table: strings */ | ||
117 | *(__ksymtab_strings) | ||
118 | |||
119 | . = ALIGN(4); | ||
120 | __etext = .; | 59 | __etext = .; |
121 | } > ram | 60 | } |
61 | |||
62 | RODATA | ||
63 | |||
64 | .data : | ||
65 | { | ||
66 | __sdata = .; | ||
67 | . = ALIGN(0x2000); | ||
68 | *(.data.init_task) | ||
69 | DATA_DATA | ||
70 | CONSTRUCTORS | ||
71 | |||
72 | . = ALIGN(32); | ||
73 | *(.data.cacheline_aligned) | ||
74 | |||
75 | . = ALIGN(0x2000); | ||
76 | __edata = .; | ||
77 | } | ||
122 | 78 | ||
79 | ___init_begin = .; | ||
123 | .init : | 80 | .init : |
124 | { | 81 | { |
125 | . = ALIGN(4096); | 82 | . = ALIGN(4096); |
126 | ___init_begin = .; | ||
127 | __sinittext = .; | 83 | __sinittext = .; |
128 | *(.init.text) | 84 | *(.init.text) |
129 | __einittext = .; | 85 | __einittext = .; |
@@ -149,39 +105,39 @@ SECTIONS | |||
149 | *(.init.ramfs) | 105 | *(.init.ramfs) |
150 | ___initramfs_end = .; | 106 | ___initramfs_end = .; |
151 | . = ALIGN(4); | 107 | . = ALIGN(4); |
152 | ___init_end = .; | 108 | } |
153 | } > ram | ||
154 | 109 | ||
155 | __l1_lma_start = .; | 110 | __l1_lma_start = .; |
156 | 111 | ||
157 | .text_l1 : | 112 | .text_l1 L1_CODE_START : AT(LOADADDR(.init) + SIZEOF(.init)) |
158 | { | 113 | { |
159 | . = ALIGN(4); | 114 | . = ALIGN(4); |
160 | __stext_l1 = .; | 115 | __stext_l1 = .; |
161 | *(.l1.text) | 116 | *(.l1.text) |
162 | 117 | ||
163 | . = ALIGN(4); | 118 | . = ALIGN(4); |
164 | __etext_l1 = .; | 119 | __etext_l1 = .; |
165 | } > l1_code AT > ram | 120 | } |
166 | 121 | ||
167 | .data_l1 : | 122 | .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) |
168 | { | 123 | { |
169 | . = ALIGN(4); | 124 | . = ALIGN(4); |
170 | __sdata_l1 = .; | 125 | __sdata_l1 = .; |
171 | *(.l1.data) | 126 | *(.l1.data) |
172 | __edata_l1 = .; | 127 | __edata_l1 = .; |
173 | 128 | ||
174 | . = ALIGN(4); | 129 | . = ALIGN(4); |
175 | __sbss_l1 = .; | 130 | __sbss_l1 = .; |
176 | *(.l1.bss) | 131 | *(.l1.bss) |
177 | 132 | ||
178 | . = ALIGN(32); | 133 | . = ALIGN(32); |
179 | *(.data_l1.cacheline_aligned) | 134 | *(.data_l1.cacheline_aligned) |
180 | 135 | ||
181 | . = ALIGN(4); | 136 | . = ALIGN(4); |
182 | __ebss_l1 = .; | 137 | __ebss_l1 = .; |
183 | } > l1_data_a AT > ram | 138 | } |
184 | .data_b_l1 : | 139 | |
140 | .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) | ||
185 | { | 141 | { |
186 | . = ALIGN(4); | 142 | . = ALIGN(4); |
187 | __sdata_b_l1 = .; | 143 | __sdata_b_l1 = .; |
@@ -194,36 +150,25 @@ SECTIONS | |||
194 | 150 | ||
195 | . = ALIGN(4); | 151 | . = ALIGN(4); |
196 | __ebss_b_l1 = .; | 152 | __ebss_b_l1 = .; |
197 | } > l1_data_b AT > ram | 153 | } |
198 | 154 | ||
199 | .data : | 155 | ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); |
200 | { | ||
201 | __sdata = .; | ||
202 | . = ALIGN(0x2000); | ||
203 | *(.data.init_task) | ||
204 | DATA_DATA | ||
205 | 156 | ||
206 | . = ALIGN(32); | 157 | .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) : |
207 | *(.data.cacheline_aligned) | ||
208 | |||
209 | . = ALIGN(0x2000); | ||
210 | __edata = .; | ||
211 | } > ram | ||
212 | |||
213 | /DISCARD/ : { /* Exit code and data*/ | ||
214 | *(.exit.text) | ||
215 | *(.exit.data) | ||
216 | *(.exitcall.exit) | ||
217 | } > ram | ||
218 | |||
219 | .bss : | ||
220 | { | 158 | { |
221 | . = ALIGN(4); | 159 | . = ALIGN(4); |
222 | ___bss_start = .; | 160 | ___bss_start = .; |
223 | *(.bss) | 161 | *(.bss) |
224 | *(COMMON) | 162 | *(COMMON) |
225 | . = ALIGN(4); | 163 | . = ALIGN(4); |
226 | ___bss_stop = .; | 164 | ___bss_stop = .; |
227 | __end = . ; | 165 | __end = .; |
228 | } > ram | 166 | } |
167 | |||
168 | /DISCARD/ : | ||
169 | { | ||
170 | *(.exit.text) | ||
171 | *(.exit.data) | ||
172 | *(.exitcall.exit) | ||
173 | } | ||
229 | } | 174 | } |