]> git.hungrycats.org Git - linux/commit
[PATCH] sort exception tables
authorPaul Mackerras <paulus@samba.org>
Mon, 19 Jan 2004 13:49:29 +0000 (05:49 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 13:49:29 +0000 (05:49 -0800)
commit35b93751d2f184c82be557bbeac4c5cef11e34a1
treef9b6665dc746e4b7b100f2ba879781fc7f1fb403
parentd35e9aba217ea71c1f53dbe4131455aa4335ddf1
[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).
38 files changed:
arch/alpha/mm/extable.c
arch/arm/mm/extable.c
arch/arm26/mm/extable.c
arch/cris/mm/Makefile
arch/cris/mm/extable.c [deleted file]
arch/h8300/mm/Makefile
arch/h8300/mm/extable.c [deleted file]
arch/i386/mm/extable.c
arch/ia64/mm/extable.c
arch/m68k/mm/Makefile
arch/m68k/mm/extable.c [deleted file]
arch/m68knommu/mm/Makefile
arch/m68knommu/mm/extable.c [deleted file]
arch/mips/mm/Makefile
arch/mips/mm/extable.c [deleted file]
arch/parisc/mm/Makefile
arch/parisc/mm/extable.c [deleted file]
arch/ppc/kernel/module.c
arch/ppc/mm/Makefile
arch/ppc/mm/extable.c [deleted file]
arch/ppc64/kernel/module.c
arch/ppc64/kernel/setup.c
arch/ppc64/mm/Makefile
arch/ppc64/mm/extable.c [deleted file]
arch/s390/mm/Makefile
arch/s390/mm/extable.c [deleted file]
arch/sh/mm/extable.c
arch/sparc/mm/extable.c
arch/sparc64/mm/extable.c
arch/x86_64/mm/extable.c
include/asm-ppc/uaccess.h
include/asm-ppc64/uaccess.h
include/linux/module.h
init/main.c
kernel/extable.c
kernel/module.c
lib/Makefile
lib/extable.c [new file with mode: 0644]