Skip to content

Commit

Permalink
arm64: extable: sort the exception table at build time
Browse files Browse the repository at this point in the history
As is done for other architectures, sort the exception table at
build-time rather than during boot.

Since sortextable appears to be a standalone C program relying on the
host elf.h to provide EM_AARCH64, I've had to add a conditional check in
order to allow cross-compilation on machines that aren't running a
bleeding-edge libc-dev.

Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
wildea01 authored and ctmarinas committed Jun 12, 2013
1 parent 73150c9 commit adace89
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config ARM64
select ARM_AMBA
select ARM_ARCH_TIMER
select ARM_GIC
select BUILDTIME_EXTABLE_SORT
select CLONE_BACKWARDS
select COMMON_CLK
select GENERIC_CLOCKEVENTS
Expand Down
10 changes: 1 addition & 9 deletions arch/arm64/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SECTIONS
}

RO_DATA(PAGE_SIZE)

EXCEPTION_TABLE(8)
_etext = .; /* End of text and rodata section */

. = ALIGN(PAGE_SIZE);
Expand Down Expand Up @@ -98,14 +98,6 @@ SECTIONS
CACHELINE_ALIGNED_DATA(64)
READ_MOSTLY_DATA(64)

/*
* The exception fixup table (might need resorting at runtime)
*/
. = ALIGN(32);
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;

/*
* and the usual data section
*/
Expand Down
5 changes: 5 additions & 0 deletions scripts/sortextable.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include <tools/be_byteshift.h>
#include <tools/le_byteshift.h>

#ifndef EM_AARCH64
#define EM_AARCH64 183
#endif

static int fd_map; /* File descriptor for file being modified. */
static int mmap_failed; /* Boolean flag. */
static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
Expand Down Expand Up @@ -249,6 +253,7 @@ do_file(char const *const fname)
custom_sort = sort_relative_table;
break;
case EM_ARM:
case EM_AARCH64:
case EM_MIPS:
break;
} /* end switch */
Expand Down

0 comments on commit adace89

Please sign in to comment.