Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 7568/1: Sort exception table at compile time

Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.

This allows us to skip the sorting step during boot.

Cc: David Daney <david.daney@cavium.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Stephen Boyd and committed by
Russell King
ee951c63 a68becd1

+11 -10
+1
arch/arm/Kconfig
··· 5 5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 6 6 select ARCH_HAVE_CUSTOM_GPIO_H 7 7 select ARCH_WANT_IPC_PARSE_VERSION 8 + select BUILDTIME_EXTABLE_SORT if MMU 8 9 select CPU_PM if (SUSPEND || CPU_IDLE) 9 10 select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN 10 11 select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
+9 -10
arch/arm/kernel/vmlinux.lds.S
··· 114 114 115 115 RO_DATA(PAGE_SIZE) 116 116 117 + . = ALIGN(4); 118 + __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { 119 + __start___ex_table = .; 120 + #ifdef CONFIG_MMU 121 + *(__ex_table) 122 + #endif 123 + __stop___ex_table = .; 124 + } 125 + 117 126 #ifdef CONFIG_ARM_UNWIND 118 127 /* 119 128 * Stack unwinding tables ··· 227 218 NOSAVE_DATA 228 219 CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) 229 220 READ_MOSTLY_DATA(L1_CACHE_BYTES) 230 - 231 - /* 232 - * The exception fixup table (might need resorting at runtime) 233 - */ 234 - . = ALIGN(4); 235 - __start___ex_table = .; 236 - #ifdef CONFIG_MMU 237 - *(__ex_table) 238 - #endif 239 - __stop___ex_table = .; 240 221 241 222 /* 242 223 * and the usual data section
+1
scripts/sortextable.c
··· 248 248 case EM_S390: 249 249 custom_sort = sort_relative_table; 250 250 break; 251 + case EM_ARM: 251 252 case EM_MIPS: 252 253 break; 253 254 } /* end switch */