Skip to content

Commit

Permalink
extable: Skip sorting if sorted at build time.
Browse files Browse the repository at this point in the history
If the build program sortextable has already sorted the exception
table, don't sort it again.

Signed-off-by: David Daney <david.daney@cavium.com>
Link: http://lkml.kernel.org/r/1334872799-14589-3-git-send-email-ddaney.cavm@gmail.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
David Daney authored and H. Peter Anvin committed Apr 19, 2012
1 parent a79f248 commit d219e2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ DEFINE_MUTEX(text_mutex);
extern struct exception_table_entry __start___ex_table[];
extern struct exception_table_entry __stop___ex_table[];

/* Cleared by build time tools if the table is already sorted. */
u32 __initdata main_extable_sort_needed = 1;

/* Sort the kernel's built-in exception table */
void __init sort_main_extable(void)
{
sort_extable(__start___ex_table, __stop___ex_table);
if (main_extable_sort_needed)
sort_extable(__start___ex_table, __stop___ex_table);
else
pr_notice("__ex_table already sorted, skipping sort\n");
}

/* Given an address, look for it in the exception tables. */
Expand Down

0 comments on commit d219e2e

Please sign in to comment.