linux-mips
[Top] [All Lists]

[PATCH v2 3/5] kbuild/extable: Hook up sortextable into the build system

To: Ralf Baechle <ralf@linux-mips.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org, Linus Torvalds <torvalds@linux-foundation.org>, Michal Marek <mmarek@suse.cz>
Subject: [PATCH v2 3/5] kbuild/extable: Hook up sortextable into the build system.
From: David Daney <ddaney.cavm@gmail.com>
Date: Thu, 19 Apr 2012 14:59:57 -0700
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Andrew Morton <akpm@linux-foundation.org>, David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=1HjJQTzfzV9OCeFFb18RrQzCRwoKNNJLNYB80iw+TLo=; b=ot+TtZ6IJ8w/Dm/oC4AFQj66zWJw7EDunwSWydN7pN4uxug0XIpnX+pXjUx9PK8Mfh c2OkxE4u1ieP6mbncNcVPwNLSYrIuWzaJhAkquTWPrj7GQy7blgiJCC1KZ03D8jesRRk BAkSyztJTFpefYBdNKeWgbsH76oBufUS5PIvkMZh0NAJkMb57ZuhI/8YknB7771zeJl1 +DfvO5Ds6bNyXQ7sAvIWLngDS3AQNzVaKzkxW3hOOP7TCvbz+td6ivd2fxtcXNwhJv5R JQQw0LvcC0UDOYa5IDA3Eswsyb4SqC+oURNSoI0cVzNaWE1DqGzhkOJE6WrXJazWaUgV Ra2g==
In-reply-to: <1334872799-14589-1-git-send-email-ddaney.cavm@gmail.com>
References: <1334872799-14589-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

Define a config variable BUILDTIME_EXTABLE_SORT to control build time
sorting of the kernel's exception table.

Patch Makefile to do the sorting when BUILDTIME_EXTABLE_SORT is
selected.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 Makefile     |   10 ++++++++++
 init/Kconfig |    3 +++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index ae947cc..e3bbca9 100644
--- a/Makefile
+++ b/Makefile
@@ -784,6 +784,10 @@ quiet_cmd_vmlinux_version = GEN     .version
 quiet_cmd_sysmap = SYSMAP
       cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
 
+# Sort exception table at build time
+quiet_cmd_sortextable = SORTEX
+      cmd_sortextable = $(objtree)/scripts/sortextable
+
 # Link of vmlinux
 # If CONFIG_KALLSYMS is set .version is already updated
 # Generate System.map and verify that the content is consistent
@@ -796,6 +800,12 @@ define rule_vmlinux__
        $(call cmd,vmlinux__)
        $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
 
+       $(if $(CONFIG_BUILDTIME_EXTABLE_SORT),                          \
+         $(Q)$(if $($(quiet)cmd_sortextable),                          \
+           echo '  $($(quiet)cmd_sortextable)  vmlinux' &&)            \
+         $(cmd_sortextable)  vmlinux)
+
+
        $(Q)$(if $($(quiet)cmd_sysmap),                                      \
          echo '  $($(quiet)cmd_sysmap)  System.map' &&)                     \
        $(cmd_sysmap) $@ System.map;                                         \
diff --git a/init/Kconfig b/init/Kconfig
index 6cfd71d..92a1296 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -27,6 +27,9 @@ config IRQ_WORK
        bool
        depends on HAVE_IRQ_WORK
 
+config BUILDTIME_EXTABLE_SORT
+       bool
+
 menu "General setup"
 
 config EXPERIMENTAL
-- 
1.7.2.3


<Prev in Thread] Current Thread [Next in Thread>