Commit 6eb10bc9e2deab06630261cd05c4cb1e9a60e980

Authored by Nelson Elhage
Committed by Ralf Baechle
1 parent a0b54e256d

MIPS: Clean up linker script using new linker script macros.

This patch results in fewer output sections and in some data being
reordered, but should have no functional impact.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Showing 1 changed file with 8 additions and 78 deletions Side-by-side Diff

arch/mips/kernel/vmlinux.lds.S
... ... @@ -43,13 +43,7 @@
43 43 } :text = 0
44 44 _etext = .; /* End of text section */
45 45  
46   - /* Exception table */
47   - . = ALIGN(16);
48   - __ex_table : {
49   - __start___ex_table = .;
50   - *(__ex_table)
51   - __stop___ex_table = .;
52   - }
  46 + EXCEPTION_TABLE(16)
53 47  
54 48 /* Exception table for data bus errors */
55 49 __dbe_table : {
56 50  
... ... @@ -66,20 +60,10 @@
66 60 /* writeable */
67 61 .data : { /* Data */
68 62 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
69   - /*
70   - * This ALIGN is needed as a workaround for a bug a
71   - * gcc bug upto 4.1 which limits the maximum alignment
72   - * to at most 32kB and results in the following
73   - * warning:
74   - *
75   - * CC arch/mips/kernel/init_task.o
76   - * arch/mips/kernel/init_task.c:30: warning: alignment
77   - * of ‘init_thread_union’ is greater than maximum
78   - * object file alignment. Using 32768
79   - */
80   - . = ALIGN(PAGE_SIZE);
81   - *(.data.init_task)
82 63  
  64 + INIT_TASK_DATA(PAGE_SIZE)
  65 + NOSAVE_DATA
  66 + CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
83 67 DATA_DATA
84 68 CONSTRUCTORS
85 69 }
86 70  
87 71  
... ... @@ -96,52 +80,14 @@
96 80 .sdata : {
97 81 *(.sdata)
98 82 }
99   -
100   - . = ALIGN(PAGE_SIZE);
101   - .data_nosave : {
102   - __nosave_begin = .;
103   - *(.data.nosave)
104   - }
105   - . = ALIGN(PAGE_SIZE);
106   - __nosave_end = .;
107   -
108   - . = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
109   - .data.cacheline_aligned : {
110   - *(.data.cacheline_aligned)
111   - }
112 83 _edata = .; /* End of data section */
113 84  
114 85 /* will be freed after init */
115 86 . = ALIGN(PAGE_SIZE); /* Init code and data */
116 87 __init_begin = .;
117   - .init.text : {
118   - _sinittext = .;
119   - INIT_TEXT
120   - _einittext = .;
121   - }
122   - .init.data : {
123   - INIT_DATA
124   - }
125   - . = ALIGN(16);
126   - .init.setup : {
127   - __setup_start = .;
128   - *(.init.setup)
129   - __setup_end = .;
130   - }
  88 + INIT_TEXT_SECTION(PAGE_SIZE)
  89 + INIT_DATA_SECTION(16)
131 90  
132   - .initcall.init : {
133   - __initcall_start = .;
134   - INITCALLS
135   - __initcall_end = .;
136   - }
137   -
138   - .con_initcall.init : {
139   - __con_initcall_start = .;
140   - *(.con_initcall.init)
141   - __con_initcall_end = .;
142   - }
143   - SECURITY_INIT
144   -
145 91 /* .exit.text is discarded at runtime, not link time, to deal with
146 92 * references from .rodata
147 93 */
148 94  
... ... @@ -151,29 +97,13 @@
151 97 .exit.data : {
152 98 EXIT_DATA
153 99 }
154   -#if defined(CONFIG_BLK_DEV_INITRD)
155   - . = ALIGN(PAGE_SIZE);
156   - .init.ramfs : {
157   - __initramfs_start = .;
158   - *(.init.ramfs)
159   - __initramfs_end = .;
160   - }
161   -#endif
  100 +
162 101 PERCPU(PAGE_SIZE)
163 102 . = ALIGN(PAGE_SIZE);
164 103 __init_end = .;
165 104 /* freed after init ends here */
166 105  
167   - __bss_start = .; /* BSS */
168   - .sbss : {
169   - *(.sbss)
170   - *(.scommon)
171   - }
172   - .bss : {
173   - *(.bss)
174   - *(COMMON)
175   - }
176   - __bss_stop = .;
  106 + BSS_SECTION(0, 0, 0)
177 107  
178 108 _end = . ;
179 109