Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bebarino authored and Russell King committed Nov 4, 2012
1 parent a68becd commit ee951c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Expand Up @@ -5,6 +5,7 @@ config ARM
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select ARCH_HAVE_CUSTOM_GPIO_H select ARCH_HAVE_CUSTOM_GPIO_H
select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IPC_PARSE_VERSION
select BUILDTIME_EXTABLE_SORT if MMU
select CPU_PM if (SUSPEND || CPU_IDLE) select CPU_PM if (SUSPEND || CPU_IDLE)
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI) select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
Expand Down
19 changes: 9 additions & 10 deletions arch/arm/kernel/vmlinux.lds.S
Expand Up @@ -114,6 +114,15 @@ SECTIONS


RO_DATA(PAGE_SIZE) RO_DATA(PAGE_SIZE)


. = ALIGN(4);
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
#ifdef CONFIG_MMU
*(__ex_table)
#endif
__stop___ex_table = .;
}

#ifdef CONFIG_ARM_UNWIND #ifdef CONFIG_ARM_UNWIND
/* /*
* Stack unwinding tables * Stack unwinding tables
Expand Down Expand Up @@ -219,16 +228,6 @@ SECTIONS
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
READ_MOSTLY_DATA(L1_CACHE_BYTES) READ_MOSTLY_DATA(L1_CACHE_BYTES)


/*
* The exception fixup table (might need resorting at runtime)
*/
. = ALIGN(4);
__start___ex_table = .;
#ifdef CONFIG_MMU
*(__ex_table)
#endif
__stop___ex_table = .;

/* /*
* and the usual data section * and the usual data section
*/ */
Expand Down
1 change: 1 addition & 0 deletions scripts/sortextable.c
Expand Up @@ -248,6 +248,7 @@ do_file(char const *const fname)
case EM_S390: case EM_S390:
custom_sort = sort_relative_table; custom_sort = sort_relative_table;
break; break;
case EM_ARM:
case EM_MIPS: case EM_MIPS:
break; break;
} /* end switch */ } /* end switch */
Expand Down

0 comments on commit ee951c6

Please sign in to comment.