Skip to content

Commit ee951c6

Browse files
bebarinoRussell King
authored andcommitted
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>
1 parent a68becd commit ee951c6

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config ARM
55
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
66
select ARCH_HAVE_CUSTOM_GPIO_H
77
select ARCH_WANT_IPC_PARSE_VERSION
8+
select BUILDTIME_EXTABLE_SORT if MMU
89
select CPU_PM if (SUSPEND || CPU_IDLE)
910
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
1011
select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ SECTIONS
114114

115115
RO_DATA(PAGE_SIZE)
116116

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+
117126
#ifdef CONFIG_ARM_UNWIND
118127
/*
119128
* Stack unwinding tables
@@ -219,16 +228,6 @@ SECTIONS
219228
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
220229
READ_MOSTLY_DATA(L1_CACHE_BYTES)
221230

222-
/*
223-
* The exception fixup table (might need resorting at runtime)
224-
*/
225-
. = ALIGN(4);
226-
__start___ex_table = .;
227-
#ifdef CONFIG_MMU
228-
*(__ex_table)
229-
#endif
230-
__stop___ex_table = .;
231-
232231
/*
233232
* and the usual data section
234233
*/

‎scripts/sortextable.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ do_file(char const *const fname)
248248
case EM_S390:
249249
custom_sort = sort_relative_table;
250250
break;
251+
case EM_ARM:
251252
case EM_MIPS:
252253
break;
253254
} /* end switch */

0 commit comments

Comments
 (0)