Skip to content

Commit 39df888

Browse files
author
Russell King
committed
ARM: vmlinux.lds: move discarded sections to beginning
Rather than scattering the discarded sections throughout the linker file, move them to the start. Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Tested-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 3002b41 commit 39df888

1 file changed

Lines changed: 22 additions & 25 deletions

File tree

‎arch/arm/kernel/vmlinux.lds.S‎

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ jiffies = jiffies_64 + 4;
3838

3939
SECTIONS
4040
{
41+
/*
42+
* unwind exit sections must be discarded before the rest of the
43+
* unwind sections get included.
44+
*/
45+
/DISCARD/ : {
46+
*(.ARM.exidx.exit.text)
47+
*(.ARM.extab.exit.text)
48+
ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
49+
ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
50+
#ifndef CONFIG_HOTPLUG
51+
*(.ARM.exidx.devexit.text)
52+
*(.ARM.extab.devexit.text)
53+
#endif
54+
#ifndef CONFIG_MMU
55+
*(.fixup)
56+
*(__ex_table)
57+
#endif
58+
#ifndef CONFIG_SMP_ON_UP
59+
*(.alt.smp.init)
60+
#endif
61+
}
62+
4163
#ifdef CONFIG_XIP_KERNEL
4264
. = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
4365
#else
@@ -89,25 +111,6 @@ SECTIONS
89111
__init_end = .;
90112
#endif
91113

92-
/*
93-
* unwind exit sections must be discarded before the rest of the
94-
* unwind sections get included.
95-
*/
96-
/DISCARD/ : {
97-
*(.ARM.exidx.exit.text)
98-
*(.ARM.extab.exit.text)
99-
ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
100-
ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
101-
#ifndef CONFIG_HOTPLUG
102-
*(.ARM.exidx.devexit.text)
103-
*(.ARM.extab.devexit.text)
104-
#endif
105-
#ifndef CONFIG_MMU
106-
*(.fixup)
107-
*(__ex_table)
108-
#endif
109-
}
110-
111114
.text : { /* Real text segment */
112115
_text = .; /* Text and read-only data */
113116
__exception_text_start = .;
@@ -270,12 +273,6 @@ SECTIONS
270273

271274
/* Default discards */
272275
DISCARDS
273-
274-
#ifndef CONFIG_SMP_ON_UP
275-
/DISCARD/ : {
276-
*(.alt.smp.init)
277-
}
278-
#endif
279276
}
280277

281278
/*

0 commit comments

Comments
 (0)