* [PATCH v2] arm64: extable: sort the exception table at build time
@ 2013-05-22 18:03 Will Deacon
2013-05-30 15:27 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Will Deacon @ 2013-05-22 18:03 UTC (permalink / raw)
To: catalin.marinas
Cc: linux-kernel, linux-arm-kernel, david.daney, sam, Will Deacon
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 <will.deacon@arm.com>
---
arch/arm64/Kconfig | 1 +
arch/arm64/kernel/vmlinux.lds.S | 10 +---------
scripts/sortextable.c | 5 +++++
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 56b3f6d..c3e3a17 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -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
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 3fae2be..5e06a17 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -56,7 +56,7 @@ SECTIONS
}
RO_DATA(PAGE_SIZE)
-
+ EXCEPTION_TABLE(8)
_etext = .; /* End of text and rodata section */
. = ALIGN(PAGE_SIZE);
@@ -99,14 +99,6 @@ SECTIONS
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
*/
DATA_DATA
diff --git a/scripts/sortextable.c b/scripts/sortextable.c
index 1f10e89..f9ce116 100644
--- a/scripts/sortextable.c
+++ b/scripts/sortextable.c
@@ -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 */
@@ -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 */
--
1.8.2.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] arm64: extable: sort the exception table at build time
2013-05-22 18:03 [PATCH v2] arm64: extable: sort the exception table at build time Will Deacon
@ 2013-05-30 15:27 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2013-05-30 15:27 UTC (permalink / raw)
To: Catalin Marinas
Cc: linux-kernel, linux-arm-kernel, david.daney, sam, heiko.carstens
On Wed, May 22, 2013 at 07:03:32PM +0100, Will Deacon wrote:
> 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 <will.deacon@arm.com>
> ---
> arch/arm64/Kconfig | 1 +
> arch/arm64/kernel/vmlinux.lds.S | 10 +---------
> scripts/sortextable.c | 5 +++++
> 3 files changed, 7 insertions(+), 9 deletions(-)
[...]
> diff --git a/scripts/sortextable.c b/scripts/sortextable.c
> index 1f10e89..f9ce116 100644
> --- a/scripts/sortextable.c
> +++ b/scripts/sortextable.c
> @@ -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 */
> @@ -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 */
Any chance I can have an ack for this part of the patch please? Then we can
take it through the arm64 tree.
Cheers,
Will
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-30 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22 18:03 [PATCH v2] arm64: extable: sort the exception table at build time Will Deacon
2013-05-30 15:27 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®