kbuild/extable: Hook up sortextable into the build system.
authorDavid Daney <david.daney@cavium.com>
Thu, 19 Apr 2012 21:59:57 +0000 (14:59 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Thu, 19 Apr 2012 22:06:56 +0000 (15:06 -0700)
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>
Link: http://lkml.kernel.org/r/1334872799-14589-4-git-send-email-ddaney.cavm@gmail.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Makefile
init/Kconfig

index f6578f47e21e663402bfb2e401fbf8394024750a..622c918abff887f1a8ab27981cf6a90d25421dfd 100644 (file)
--- 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;                                         \
index 6cfd71d064637a0335677e7e2f7d73d941c50fe4..92a1296ba9fa4121dae2c0b468d0105528e530b3 100644 (file)
@@ -27,6 +27,9 @@ config IRQ_WORK
        bool
        depends on HAVE_IRQ_WORK
 
+config BUILDTIME_EXTABLE_SORT
+       bool
+
 menu "General setup"
 
 config EXPERIMENTAL