diff options
| author | Paul Mackerras <paulus@samba.org> | 2004-01-19 05:49:29 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-19 05:49:29 -0800 |
| commit | 35b93751d2f184c82be557bbeac4c5cef11e34a1 (patch) | |
| tree | f9b6665dc746e4b7b100f2ba879781fc7f1fb403 /init | |
| parent | d35e9aba217ea71c1f53dbe4131455aa4335ddf1 (diff) | |
[PATCH] sort exception tables
This patch arranges for the exception tables to be sorted on most
architectures. It sorts the main kernel exception table on startup
and the module exception tables when they get loaded. The main table
is sorted reasonably early - just after kmem_cache_init - but that
could be moved even earlier if necessary.
There is now a lib/extable.c which includes the sort_extable()
function from arch/ppc/mm/extable.c and the search_extable() function
from arch/i386/mm/extable.c, which had been copied to many
architectures. On many architectures, arch/$(ARCH)/mm/extable.c
became empty and so I have removed it.
There are four architectures which do things differently from i386:
alpha, ia64, sparc and sparc64. Alpha and ia64 store the offset from
the offset from the exception table entry to the instruction, and
sparc and sparc64 have range entries in the table. For those
architectures I have added empty sort_extable functions. The
maintainers for those architectures can implement something better if
they care to. As it is they are no worse off than before.
Although it is a moderately sizable patch, it ends up with a net
reduction of 377 lines in the size of the kernel source. :)
I have tested this on x86 and ppc with a module that uses __get_user
in an init function, deliberately laid out to get the exception table
out of order, and it works (whereas it oopsed without this patch).
Diffstat (limited to 'init')
| -rw-r--r-- | init/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c index 4c26b3769e80..a02aa14fdcd5 100644 --- a/init/main.c +++ b/init/main.c @@ -435,6 +435,7 @@ asmlinkage void __init start_kernel(void) page_address_init(); mem_init(); kmem_cache_init(); + sort_main_extable(); if (late_time_init) late_time_init(); calibrate_delay(); |
