[linux] 04/04: Fix exported symbol versions

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Dec 2 00:21:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 54d0756a3379b15ef993cd9d241d84f22395176a
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Fri Dec 2 00:19:09 2016 +0000

    Fix exported symbol versions
    
    - Revert upstream changes moving exports to assembly sources
    - [x86] kbuild: enable modversions for symbols exported from assembly
    - Revert "Fix subtle CONFIG_MODVERSIONS problems"
    
    This leaves powerpc and x86 as the only kernel architectures that
    export symbols from assembly, and <asm/asm-prototypes.h> for those
    two appear to define prototypes for all the functions that are used.
---
 debian/changelog                                   |    4 +
 ...rt-fix-subtle-config_modversions-problems.patch |   60 +
 ...-alpha-move-exports-to-actual-definitions.patch |  949 ++++++++++++++
 .../revert-ia64-move-exports-to-definitions.patch  |  643 +++++++++
 .../revert-m68k-move-exports-to-definitions.patch  |  254 ++++
 .../revert-sparc-move-exports-to-definitions.patch | 1377 ++++++++++++++++++++
 ...enable-modversions-for-symbols-exported-f.patch |   59 +
 debian/patches/series                              |    9 +
 8 files changed, 3355 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 20b6cec..9f284d8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,10 @@ linux (4.9~rc7-1~exp1) UNRELEASED; urgency=medium
   [ Ben Hutchings ]
   * linux-headers-common: Make these packages architecture-independent by
     including headers for all architectures that we build a kernel for
+  * Fix exported symbol versions:
+    - Revert upstream changes moving exports to assembly sources
+    - [x86] kbuild: enable modversions for symbols exported from assembly
+    - Revert "Fix subtle CONFIG_MODVERSIONS problems"
 
  -- Uwe Kleine-König <ukleinek at debian.org>  Thu, 17 Nov 2016 09:55:16 +0100
 
diff --git a/debian/patches/bugfix/all/revert-fix-subtle-config_modversions-problems.patch b/debian/patches/bugfix/all/revert-fix-subtle-config_modversions-problems.patch
new file mode 100644
index 0000000..edcdccc
--- /dev/null
+++ b/debian/patches/bugfix/all/revert-fix-subtle-config_modversions-problems.patch
@@ -0,0 +1,60 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Fri, 2 Dec 2016 00:07:04 +0000
+Subject: Revert "Fix subtle CONFIG_MODVERSIONS problems"
+
+This reverts commit cd3caefb4663e3811d37cc2afad3cce642d60061.
+
+On Fri, 2016-11-25 at 10:01 -0800, Linus Torvalds wrote:
+[...]
+> > What else do people *actually* use it for? Preventing mismatched modules
+> > when .git version is not attached and release version of the kernel has
+> > not been bumped. Is that it?
+> 
+> It used to be very useful for avoiding loading stale modules and then
+> wasting days on debugging something that wasn't the case when you had
+> forgotten to do "make modules_install". Change some subtle internal
+> ABI issue (add/remove a parameter, whatever) and it would really help.
+> 
+> These days, for me, LOCALVERSION_AUTO and module signing are what I
+> personally tend to use.
+>
+> The modversions stuff may just be too painful to bother with. Very few
+> people probably use it, and the ones that do likely don't have any
+> overriding reason why.
+[...]
+
+Debian has some strong reasons:
+
+1. Changing the release string requires any out-of-tree modules to be
+upgraded (at least rebuilt) on end-user systems.  So we try to avoid
+doing that during the lifetime of a stable release, i.e. we don't let
+the release string change.  Also, the release string is reflected in
+package names (e.g. linux-image-4.8.0-1-amd64), and introducing new
+package names requires manual approval by the Debian archive team.
+
+2. We want to allow ABI breaks for "internal" symbols used only by in-
+tree modules, as those breaks will be resolved by rebooting to complete
+the upgrade.  But we need a run-time check to prevent loading an
+incompatible module before the reboot.
+
+3. So far as I can see, module signing doesn't work for a distribution
+kernel with out-of-tree modules as there has to be a trust path from a
+built-in certificate to the module signing certificate.  So signature
+enforcement will have to be disabled on systems that use out-of-tree
+modules, thus it's not a substitute for modversions.
+---
+ init/Kconfig | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index c4fbc1e55c25..34407f15e6d3 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -1945,7 +1945,6 @@ config MODULE_FORCE_UNLOAD
+ 
+ config MODVERSIONS
+ 	bool "Module versioning support"
+-	depends on BROKEN
+ 	help
+ 	  Usually, you have to use modules compiled with your kernel.
+ 	  Saying Y here makes it sometimes possible to use modules
diff --git a/debian/patches/bugfix/alpha/revert-alpha-move-exports-to-actual-definitions.patch b/debian/patches/bugfix/alpha/revert-alpha-move-exports-to-actual-definitions.patch
new file mode 100644
index 0000000..aec9cb5
--- /dev/null
+++ b/debian/patches/bugfix/alpha/revert-alpha-move-exports-to-actual-definitions.patch
@@ -0,0 +1,949 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 1 Dec 2016 23:14:46 +0000
+Subject: Revert "alpha: move exports to actual definitions"
+Forwarded: not-needed
+
+This reverts commit 00fc0e0dda6286407f3854cd71a125f519a5689c because
+symbols exported from assembly don't automatically get modversions (ABI
+hashes).
+---
+ arch/alpha/include/asm/Kbuild        |   1 -
+ arch/alpha/kernel/Makefile           |   2 +-
+ arch/alpha/kernel/alpha_ksyms.c      | 102 +++++++++++++++++++++++++++++++++++
+ arch/alpha/kernel/machvec_impl.h     |   6 +--
+ arch/alpha/kernel/setup.c            |   1 -
+ arch/alpha/lib/callback_srm.S        |   5 --
+ arch/alpha/lib/checksum.c            |   3 --
+ arch/alpha/lib/clear_page.S          |   3 +-
+ arch/alpha/lib/clear_user.S          |   2 -
+ arch/alpha/lib/copy_page.S           |   3 +-
+ arch/alpha/lib/copy_user.S           |   3 --
+ arch/alpha/lib/csum_ipv6_magic.S     |   2 -
+ arch/alpha/lib/csum_partial_copy.c   |   2 -
+ arch/alpha/lib/dec_and_lock.c        |   2 -
+ arch/alpha/lib/divide.S              |   3 --
+ arch/alpha/lib/ev6-clear_page.S      |   3 +-
+ arch/alpha/lib/ev6-clear_user.S      |   3 +-
+ arch/alpha/lib/ev6-copy_page.S       |   3 +-
+ arch/alpha/lib/ev6-copy_user.S       |   3 +-
+ arch/alpha/lib/ev6-csum_ipv6_magic.S |   2 -
+ arch/alpha/lib/ev6-divide.S          |   3 --
+ arch/alpha/lib/ev6-memchr.S          |   3 +-
+ arch/alpha/lib/ev6-memcpy.S          |   3 +-
+ arch/alpha/lib/ev6-memset.S          |   7 +--
+ arch/alpha/lib/ev67-strcat.S         |   3 +-
+ arch/alpha/lib/ev67-strchr.S         |   3 +-
+ arch/alpha/lib/ev67-strlen.S         |   3 +-
+ arch/alpha/lib/ev67-strncat.S        |   3 +-
+ arch/alpha/lib/ev67-strrchr.S        |   3 +-
+ arch/alpha/lib/fpreg.c               |   7 ---
+ arch/alpha/lib/memchr.S              |   3 +-
+ arch/alpha/lib/memcpy.c              |   5 +-
+ arch/alpha/lib/memmove.S             |   3 +-
+ arch/alpha/lib/memset.S              |   7 +--
+ arch/alpha/lib/strcat.S              |   2 -
+ arch/alpha/lib/strchr.S              |   3 +-
+ arch/alpha/lib/strcpy.S              |   3 +-
+ arch/alpha/lib/strlen.S              |   3 +-
+ arch/alpha/lib/strncat.S             |   3 +-
+ arch/alpha/lib/strncpy.S             |   3 +-
+ arch/alpha/lib/strrchr.S             |   3 +-
+ 41 files changed, 131 insertions(+), 99 deletions(-)
+ create mode 100644 arch/alpha/kernel/alpha_ksyms.c
+
+diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
+index bf8475ce85ee..ffd9cf5ec8c4 100644
+--- a/arch/alpha/include/asm/Kbuild
++++ b/arch/alpha/include/asm/Kbuild
+@@ -3,7 +3,6 @@
+ generic-y += clkdev.h
+ generic-y += cputime.h
+ generic-y += exec.h
+-generic-y += export.h
+ generic-y += irq_work.h
+ generic-y += mcs_spinlock.h
+ generic-y += mm-arch-hooks.h
+diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
+index 8ce13d7a2ad3..3ecac0106c8a 100644
+--- a/arch/alpha/kernel/Makefile
++++ b/arch/alpha/kernel/Makefile
+@@ -8,7 +8,7 @@ ccflags-y	:= -Wno-sign-compare
+ 
+ obj-y    := entry.o traps.o process.o osf_sys.o irq.o \
+ 	    irq_alpha.o signal.o setup.o ptrace.o time.o \
+-	    systbls.o err_common.o io.o
++	    alpha_ksyms.o systbls.o err_common.o io.o
+ 
+ obj-$(CONFIG_VGA_HOSE)	+= console.o
+ obj-$(CONFIG_SMP)	+= smp.o
+diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
+new file mode 100644
+index 000000000000..f4c7ab6f43b0
+--- /dev/null
++++ b/arch/alpha/kernel/alpha_ksyms.c
+@@ -0,0 +1,102 @@
++/*
++ * linux/arch/alpha/kernel/alpha_ksyms.c
++ *
++ * Export the alpha-specific functions that are needed for loadable
++ * modules.
++ */
++
++#include <linux/module.h>
++#include <asm/console.h>
++#include <asm/uaccess.h>
++#include <asm/checksum.h>
++#include <asm/fpu.h>
++#include <asm/machvec.h>
++
++#include <linux/syscalls.h>
++
++/* these are C runtime functions with special calling conventions: */
++extern void __divl (void);
++extern void __reml (void);
++extern void __divq (void);
++extern void __remq (void);
++extern void __divlu (void);
++extern void __remlu (void);
++extern void __divqu (void);
++extern void __remqu (void);
++
++EXPORT_SYMBOL(alpha_mv);
++EXPORT_SYMBOL(callback_getenv);
++EXPORT_SYMBOL(callback_setenv);
++EXPORT_SYMBOL(callback_save_env);
++
++/* platform dependent support */
++EXPORT_SYMBOL(strcat);
++EXPORT_SYMBOL(strcpy);
++EXPORT_SYMBOL(strlen);
++EXPORT_SYMBOL(strncpy);
++EXPORT_SYMBOL(strncat);
++EXPORT_SYMBOL(strchr);
++EXPORT_SYMBOL(strrchr);
++EXPORT_SYMBOL(memmove);
++EXPORT_SYMBOL(__memcpy);
++EXPORT_SYMBOL(__memset);
++EXPORT_SYMBOL(___memset);
++EXPORT_SYMBOL(__memsetw);
++EXPORT_SYMBOL(__constant_c_memset);
++EXPORT_SYMBOL(copy_page);
++EXPORT_SYMBOL(clear_page);
++
++EXPORT_SYMBOL(alpha_read_fp_reg);
++EXPORT_SYMBOL(alpha_read_fp_reg_s);
++EXPORT_SYMBOL(alpha_write_fp_reg);
++EXPORT_SYMBOL(alpha_write_fp_reg_s);
++
++/* Networking helper routines. */
++EXPORT_SYMBOL(csum_tcpudp_magic);
++EXPORT_SYMBOL(ip_compute_csum);
++EXPORT_SYMBOL(ip_fast_csum);
++EXPORT_SYMBOL(csum_partial_copy_nocheck);
++EXPORT_SYMBOL(csum_partial_copy_from_user);
++EXPORT_SYMBOL(csum_ipv6_magic);
++
++#ifdef CONFIG_MATHEMU_MODULE
++extern long (*alpha_fp_emul_imprecise)(struct pt_regs *, unsigned long);
++extern long (*alpha_fp_emul) (unsigned long pc);
++EXPORT_SYMBOL(alpha_fp_emul_imprecise);
++EXPORT_SYMBOL(alpha_fp_emul);
++#endif
++
++/*
++ * The following are specially called from the uaccess assembly stubs.
++ */
++EXPORT_SYMBOL(__copy_user);
++EXPORT_SYMBOL(__do_clear_user);
++
++/* 
++ * SMP-specific symbols.
++ */
++
++#ifdef CONFIG_SMP
++EXPORT_SYMBOL(_atomic_dec_and_lock);
++#endif /* CONFIG_SMP */
++
++/*
++ * The following are special because they're not called
++ * explicitly (the C compiler or assembler generates them in
++ * response to division operations).  Fortunately, their
++ * interface isn't gonna change any time soon now, so it's OK
++ * to leave it out of version control.
++ */
++# undef memcpy
++# undef memset
++EXPORT_SYMBOL(__divl);
++EXPORT_SYMBOL(__divlu);
++EXPORT_SYMBOL(__divq);
++EXPORT_SYMBOL(__divqu);
++EXPORT_SYMBOL(__reml);
++EXPORT_SYMBOL(__remlu);
++EXPORT_SYMBOL(__remq);
++EXPORT_SYMBOL(__remqu);
++EXPORT_SYMBOL(memcpy);
++EXPORT_SYMBOL(memset);
++EXPORT_SYMBOL(memchr);
+diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
+index b7d69604b6d2..d3398f6ab74c 100644
+--- a/arch/alpha/kernel/machvec_impl.h
++++ b/arch/alpha/kernel/machvec_impl.h
+@@ -144,11 +144,9 @@
+    else beforehand.  Fine.  We'll do it ourselves.  */
+ #if 0
+ #define ALIAS_MV(system) \
+-  struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv"))); \
+-  EXPORT_SYMBOL(alpha_mv);
++  struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv")));
+ #else
+ #define ALIAS_MV(system) \
+-  asm(".global alpha_mv\nalpha_mv = " #system "_mv"); \
+-  EXPORT_SYMBOL(alpha_mv);
++  asm(".global alpha_mv\nalpha_mv = " #system "_mv");
+ #endif
+ #endif /* GENERIC */
+diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
+index 4811e54069fc..b20af76f12c1 100644
+--- a/arch/alpha/kernel/setup.c
++++ b/arch/alpha/kernel/setup.c
+@@ -115,7 +115,6 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE;
+ 
+ #ifdef CONFIG_ALPHA_GENERIC
+ struct alpha_machine_vector alpha_mv;
+-EXPORT_SYMBOL(alpha_mv);
+ #endif
+ 
+ #ifndef alpha_using_srm
+diff --git a/arch/alpha/lib/callback_srm.S b/arch/alpha/lib/callback_srm.S
+index 6093addc931a..8804bec2c644 100644
+--- a/arch/alpha/lib/callback_srm.S
++++ b/arch/alpha/lib/callback_srm.S
+@@ -3,7 +3,6 @@
+  */
+ 
+ #include <asm/console.h>
+-#include <asm/export.h>
+ 
+ .text
+ #define HWRPB_CRB_OFFSET 0xc0
+@@ -93,10 +92,6 @@ CALLBACK(reset_env, CCB_RESET_ENV, 4)
+ CALLBACK(save_env, CCB_SAVE_ENV, 1)
+ CALLBACK(pswitch, CCB_PSWITCH, 3)
+ CALLBACK(bios_emul, CCB_BIOS_EMUL, 5)
+-
+-EXPORT_SYMBOL(callback_getenv)
+-EXPORT_SYMBOL(callback_setenv)
+-EXPORT_SYMBOL(callback_save_env)
+ 	
+ .data
+ __alpha_using_srm:		# For use by bootpheader
+diff --git a/arch/alpha/lib/checksum.c b/arch/alpha/lib/checksum.c
+index b57f8007db14..377f9e34eb97 100644
+--- a/arch/alpha/lib/checksum.c
++++ b/arch/alpha/lib/checksum.c
+@@ -48,7 +48,6 @@ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
+ 		(__force u64)saddr + (__force u64)daddr +
+ 		(__force u64)sum + ((len + proto) << 8));
+ }
+-EXPORT_SYMBOL(csum_tcpudp_magic);
+ 
+ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
+ 			  __u32 len, __u8 proto, __wsum sum)
+@@ -145,7 +144,6 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
+ {
+ 	return (__force __sum16)~do_csum(iph,ihl*4);
+ }
+-EXPORT_SYMBOL(ip_fast_csum);
+ 
+ /*
+  * computes the checksum of a memory block at buff, length len,
+@@ -180,4 +178,3 @@ __sum16 ip_compute_csum(const void *buff, int len)
+ {
+ 	return (__force __sum16)~from64to16(do_csum(buff,len));
+ }
+-EXPORT_SYMBOL(ip_compute_csum);
+diff --git a/arch/alpha/lib/clear_page.S b/arch/alpha/lib/clear_page.S
+index 263d7393c0e7..a221ae266e29 100644
+--- a/arch/alpha/lib/clear_page.S
++++ b/arch/alpha/lib/clear_page.S
+@@ -3,7 +3,7 @@
+  *
+  * Zero an entire page.
+  */
+-#include <asm/export.h>
++
+ 	.text
+ 	.align 4
+ 	.global clear_page
+@@ -37,4 +37,3 @@ clear_page:
+ 	nop
+ 
+ 	.end clear_page
+-	EXPORT_SYMBOL(clear_page)
+diff --git a/arch/alpha/lib/clear_user.S b/arch/alpha/lib/clear_user.S
+index bf5b931866ba..8860316c1957 100644
+--- a/arch/alpha/lib/clear_user.S
++++ b/arch/alpha/lib/clear_user.S
+@@ -24,7 +24,6 @@
+  * Clobbers:
+  *	$1,$2,$3,$4,$5,$6
+  */
+-#include <asm/export.h>
+ 
+ /* Allow an exception for an insn; exit if we get one.  */
+ #define EX(x,y...)			\
+@@ -112,4 +111,3 @@ $exception:
+ 	ret	$31, ($28), 1	# .. e1 :
+ 
+ 	.end __do_clear_user
+-	EXPORT_SYMBOL(__do_clear_user)
+diff --git a/arch/alpha/lib/copy_page.S b/arch/alpha/lib/copy_page.S
+index 2ee0bd0508c5..9f3b97459cc6 100644
+--- a/arch/alpha/lib/copy_page.S
++++ b/arch/alpha/lib/copy_page.S
+@@ -3,7 +3,7 @@
+  *
+  * Copy an entire page.
+  */
+-#include <asm/export.h>
++
+ 	.text
+ 	.align 4
+ 	.global copy_page
+@@ -47,4 +47,3 @@ copy_page:
+ 	nop
+ 
+ 	.end copy_page
+-	EXPORT_SYMBOL(copy_page)
+diff --git a/arch/alpha/lib/copy_user.S b/arch/alpha/lib/copy_user.S
+index 509f62b65311..ac9c3766ba8c 100644
+--- a/arch/alpha/lib/copy_user.S
++++ b/arch/alpha/lib/copy_user.S
+@@ -26,8 +26,6 @@
+  *	$1,$2,$3,$4,$5,$6,$7
+  */
+ 
+-#include <asm/export.h>
+-
+ /* Allow an exception for an insn; exit if we get one.  */
+ #define EXI(x,y...)			\
+ 	99: x,##y;			\
+@@ -131,4 +129,3 @@ $exitout:
+ 	ret $31,($28),1
+ 
+ 	.end __copy_user
+-EXPORT_SYMBOL(__copy_user)
+diff --git a/arch/alpha/lib/csum_ipv6_magic.S b/arch/alpha/lib/csum_ipv6_magic.S
+index e74b4544b0cc..2c2acb96deb6 100644
+--- a/arch/alpha/lib/csum_ipv6_magic.S
++++ b/arch/alpha/lib/csum_ipv6_magic.S
+@@ -12,7 +12,6 @@
+  * added by Ivan Kokshaysky <ink at jurassic.park.msu.ru>
+  */
+ 
+-#include <asm/export.h>
+ 	.globl csum_ipv6_magic
+ 	.align 4
+ 	.ent csum_ipv6_magic
+@@ -114,4 +113,3 @@ csum_ipv6_magic:
+ 	ret			# .. e1 :
+ 
+ 	.end csum_ipv6_magic
+-	EXPORT_SYMBOL(csum_ipv6_magic)
+diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
+index b4ff3b683bcd..5675dca8dbb1 100644
+--- a/arch/alpha/lib/csum_partial_copy.c
++++ b/arch/alpha/lib/csum_partial_copy.c
+@@ -374,7 +374,6 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
+ 	}
+ 	return (__force __wsum)checksum;
+ }
+-EXPORT_SYMBOL(csum_partial_copy_from_user);
+ 
+ __wsum
+ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
+@@ -387,4 +386,3 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
+ 	set_fs(oldfs);
+ 	return checksum;
+ }
+-EXPORT_SYMBOL(csum_partial_copy_nocheck);
+diff --git a/arch/alpha/lib/dec_and_lock.c b/arch/alpha/lib/dec_and_lock.c
+index 4221b40167ee..f9f5fe830e9f 100644
+--- a/arch/alpha/lib/dec_and_lock.c
++++ b/arch/alpha/lib/dec_and_lock.c
+@@ -7,7 +7,6 @@
+ 
+ #include <linux/spinlock.h>
+ #include <linux/atomic.h>
+-#include <linux/export.h>
+ 
+   asm (".text					\n\
+ 	.global _atomic_dec_and_lock		\n\
+@@ -40,4 +39,3 @@ static int __used atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock)
+ 	spin_unlock(lock);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(_atomic_dec_and_lock);
+diff --git a/arch/alpha/lib/divide.S b/arch/alpha/lib/divide.S
+index 1e33bd127621..2d1a0484a99e 100644
+--- a/arch/alpha/lib/divide.S
++++ b/arch/alpha/lib/divide.S
+@@ -45,7 +45,6 @@
+  *	$28 - compare status
+  */
+ 
+-#include <asm/export.h>
+ #define halt .long 0
+ 
+ /*
+@@ -152,7 +151,6 @@ ufunction:
+ 	addq	$30,STACK,$30
+ 	ret	$31,($23),1
+ 	.end	ufunction
+-EXPORT_SYMBOL(ufunction)
+ 
+ /*
+  * Uhh.. Ugly signed division. I'd rather not have it at all, but
+@@ -195,4 +193,3 @@ sfunction:
+ 	addq	$30,STACK,$30
+ 	ret	$31,($23),1
+ 	.end	sfunction
+-EXPORT_SYMBOL(sfunction)
+diff --git a/arch/alpha/lib/ev6-clear_page.S b/arch/alpha/lib/ev6-clear_page.S
+index abe99e69a194..adf4f7be0e2b 100644
+--- a/arch/alpha/lib/ev6-clear_page.S
++++ b/arch/alpha/lib/ev6-clear_page.S
+@@ -3,7 +3,7 @@
+  *
+  * Zero an entire page.
+  */
+-#include <asm/export.h>
++
+         .text
+         .align 4
+         .global clear_page
+@@ -52,4 +52,3 @@ clear_page:
+ 	nop
+ 
+ 	.end clear_page
+-	EXPORT_SYMBOL(clear_page)
+diff --git a/arch/alpha/lib/ev6-clear_user.S b/arch/alpha/lib/ev6-clear_user.S
+index 05bef6b50598..4f42a16b7f53 100644
+--- a/arch/alpha/lib/ev6-clear_user.S
++++ b/arch/alpha/lib/ev6-clear_user.S
+@@ -43,7 +43,6 @@
+  *	want to leave a hole (and we also want to avoid repeating lots of work)
+  */
+ 
+-#include <asm/export.h>
+ /* Allow an exception for an insn; exit if we get one.  */
+ #define EX(x,y...)			\
+ 	99: x,##y;			\
+@@ -223,4 +222,4 @@ $exception:			# Destination for exception recovery(?)
+ 	nop			# .. E  .. ..	:
+ 	ret	$31, ($28), 1	# L0 .. .. ..	: L U L U
+ 	.end __do_clear_user
+-	EXPORT_SYMBOL(__do_clear_user)
++
+diff --git a/arch/alpha/lib/ev6-copy_page.S b/arch/alpha/lib/ev6-copy_page.S
+index 77935061bddb..b789db192754 100644
+--- a/arch/alpha/lib/ev6-copy_page.S
++++ b/arch/alpha/lib/ev6-copy_page.S
+@@ -56,7 +56,7 @@
+    destination pages are in the dcache, but it is my guess that this is
+    less important than the dcache miss case.  */
+ 
+-#include <asm/export.h>
++
+ 	.text
+ 	.align 4
+ 	.global copy_page
+@@ -201,4 +201,3 @@ copy_page:
+ 	nop
+ 
+ 	.end copy_page
+-	EXPORT_SYMBOL(copy_page)
+diff --git a/arch/alpha/lib/ev6-copy_user.S b/arch/alpha/lib/ev6-copy_user.S
+index be720b518af9..c4d0689c3d26 100644
+--- a/arch/alpha/lib/ev6-copy_user.S
++++ b/arch/alpha/lib/ev6-copy_user.S
+@@ -37,7 +37,6 @@
+  *	L	- lower subcluster; L0 - subcluster L0; L1 - subcluster L1
+  */
+ 
+-#include <asm/export.h>
+ /* Allow an exception for an insn; exit if we get one.  */
+ #define EXI(x,y...)			\
+ 	99: x,##y;			\
+@@ -236,4 +235,4 @@ $exitout:			# Destination for exception recovery(?)
+ 	ret $31,($28),1		# L0 .. .. ..	: L U L U
+ 
+ 	.end __copy_user
+-	EXPORT_SYMBOL(__copy_user)
++
+diff --git a/arch/alpha/lib/ev6-csum_ipv6_magic.S b/arch/alpha/lib/ev6-csum_ipv6_magic.S
+index de62627ac4fe..fc0bc399f872 100644
+--- a/arch/alpha/lib/ev6-csum_ipv6_magic.S
++++ b/arch/alpha/lib/ev6-csum_ipv6_magic.S
+@@ -52,7 +52,6 @@
+  * may cause additional delay in rare cases (load-load replay traps).
+  */
+ 
+-#include <asm/export.h>
+ 	.globl csum_ipv6_magic
+ 	.align 4
+ 	.ent csum_ipv6_magic
+@@ -149,4 +148,3 @@ csum_ipv6_magic:
+ 	ret			# L0 : L U L U
+ 
+ 	.end csum_ipv6_magic
+-	EXPORT_SYMBOL(csum_ipv6_magic)
+diff --git a/arch/alpha/lib/ev6-divide.S b/arch/alpha/lib/ev6-divide.S
+index d18dc0e96e3d..2a82b9be93fa 100644
+--- a/arch/alpha/lib/ev6-divide.S
++++ b/arch/alpha/lib/ev6-divide.S
+@@ -55,7 +55,6 @@
+  * Try not to change the actual algorithm if possible for consistency.
+  */
+ 
+-#include <asm/export.h>
+ #define halt .long 0
+ 
+ /*
+@@ -206,7 +205,6 @@ ufunction:
+ 	addq	$30,STACK,$30		# E :
+ 	ret	$31,($23),1		# L0 : L U U L
+ 	.end	ufunction
+-EXPORT_SYMBOL(ufunction)
+ 
+ /*
+  * Uhh.. Ugly signed division. I'd rather not have it at all, but
+@@ -259,4 +257,3 @@ sfunction:
+ 	addq	$30,STACK,$30		# E :
+ 	ret	$31,($23),1		# L0 : L U U L
+ 	.end	sfunction
+-EXPORT_SYMBOL(sfunction)
+diff --git a/arch/alpha/lib/ev6-memchr.S b/arch/alpha/lib/ev6-memchr.S
+index 419adc53ccb4..1a5f71b9d8b1 100644
+--- a/arch/alpha/lib/ev6-memchr.S
++++ b/arch/alpha/lib/ev6-memchr.S
+@@ -27,7 +27,7 @@
+  *	L	- lower subcluster; L0 - subcluster L0; L1 - subcluster L1
+  * Try not to change the actual algorithm if possible for consistency.
+  */
+-#include <asm/export.h>
++
+         .set noreorder
+         .set noat
+ 
+@@ -189,4 +189,3 @@ $not_found:
+ 	ret			# L0 :
+ 
+         .end memchr
+-	EXPORT_SYMBOL(memchr)
+diff --git a/arch/alpha/lib/ev6-memcpy.S b/arch/alpha/lib/ev6-memcpy.S
+index b19798b2efc0..52b37b0f2af5 100644
+--- a/arch/alpha/lib/ev6-memcpy.S
++++ b/arch/alpha/lib/ev6-memcpy.S
+@@ -19,7 +19,7 @@
+  * Temp usage notes:
+  *	$1,$2,		- scratch
+  */
+-#include <asm/export.h>
++
+ 	.set noreorder
+ 	.set noat
+ 
+@@ -242,7 +242,6 @@ $nomoredata:
+ 	nop				# E :
+ 
+ 	.end memcpy
+-	EXPORT_SYMBOL(memcpy)
+ 
+ /* For backwards module compatibility.  */
+ __memcpy = memcpy
+diff --git a/arch/alpha/lib/ev6-memset.S b/arch/alpha/lib/ev6-memset.S
+index fed21c6893e8..356bb2fdd705 100644
+--- a/arch/alpha/lib/ev6-memset.S
++++ b/arch/alpha/lib/ev6-memset.S
+@@ -26,7 +26,7 @@
+  * as fixes will need to be made in multiple places.  The performance gain
+  * is worth it.
+  */
+-#include <asm/export.h>
++
+ 	.set noat
+ 	.set noreorder
+ .text
+@@ -229,7 +229,6 @@ end_b:
+ 	nop
+ 	ret $31,($26),1		# L0 :
+ 	.end ___memset
+-	EXPORT_SYMBOL(___memset)
+ 
+ 	/*
+ 	 * This is the original body of code, prior to replication and
+@@ -407,7 +406,6 @@ end:
+ 	nop
+ 	ret $31,($26),1		# L0 :
+ 	.end __constant_c_memset
+-	EXPORT_SYMBOL(__constant_c_memset)
+ 
+ 	/*
+ 	 * This is a replicant of the __constant_c_memset code, rescheduled
+@@ -596,9 +594,6 @@ end_w:
+ 	ret $31,($26),1		# L0 :
+ 
+ 	.end __memsetw
+-	EXPORT_SYMBOL(__memsetw)
+ 
+ memset = ___memset
+ __memset = ___memset
+-	EXPORT_SYMBOL(memset)
+-	EXPORT_SYMBOL(__memset)
+diff --git a/arch/alpha/lib/ev67-strcat.S b/arch/alpha/lib/ev67-strcat.S
+index b69f60419be1..c426fe3ed72f 100644
+--- a/arch/alpha/lib/ev67-strcat.S
++++ b/arch/alpha/lib/ev67-strcat.S
+@@ -19,7 +19,7 @@
+  * string once.
+  */
+ 
+-#include <asm/export.h>
++
+ 	.text
+ 
+ 	.align 4
+@@ -52,4 +52,3 @@ $found:	cttz	$2, $3		# U0 :
+ 	br	__stxcpy	# L0 :
+ 
+ 	.end strcat
+-	EXPORT_SYMBOL(strcat)
+diff --git a/arch/alpha/lib/ev67-strchr.S b/arch/alpha/lib/ev67-strchr.S
+index ea8f2f35db9c..fbb7b4ffade9 100644
+--- a/arch/alpha/lib/ev67-strchr.S
++++ b/arch/alpha/lib/ev67-strchr.S
+@@ -15,7 +15,7 @@
+  *	L	- lower subcluster; L0 - subcluster L0; L1 - subcluster L1
+  * Try not to change the actual algorithm if possible for consistency.
+  */
+-#include <asm/export.h>
++
+ #include <asm/regdef.h>
+ 
+ 	.set noreorder
+@@ -86,4 +86,3 @@ $found:	negq    t0, t1		# E : clear all but least set bit
+ 	ret			# L0 :
+ 
+ 	.end strchr
+-	EXPORT_SYMBOL(strchr)
+diff --git a/arch/alpha/lib/ev67-strlen.S b/arch/alpha/lib/ev67-strlen.S
+index 736fd41884a8..503928072523 100644
+--- a/arch/alpha/lib/ev67-strlen.S
++++ b/arch/alpha/lib/ev67-strlen.S
+@@ -17,7 +17,7 @@
+  *	U	- upper subcluster; U0 - subcluster U0; U1 - subcluster U1
+  *	L	- lower subcluster; L0 - subcluster L0; L1 - subcluster L1
+  */
+-#include <asm/export.h>
++
+ 	.set noreorder
+ 	.set noat
+ 
+@@ -47,4 +47,3 @@ $found:
+ 	ret	$31, ($26)	# L0 :
+ 
+ 	.end	strlen
+-	EXPORT_SYMBOL(strlen)
+diff --git a/arch/alpha/lib/ev67-strncat.S b/arch/alpha/lib/ev67-strncat.S
+index cd35cbade73a..4ae716cd2bfb 100644
+--- a/arch/alpha/lib/ev67-strncat.S
++++ b/arch/alpha/lib/ev67-strncat.S
+@@ -20,7 +20,7 @@
+  * Try not to change the actual algorithm if possible for consistency.
+  */
+ 
+-#include <asm/export.h>
++
+ 	.text
+ 
+ 	.align 4
+@@ -92,4 +92,3 @@ $zerocount:
+ 	ret			# L0 :
+ 
+ 	.end strncat
+-	EXPORT_SYMBOL(strncat)
+diff --git a/arch/alpha/lib/ev67-strrchr.S b/arch/alpha/lib/ev67-strrchr.S
+index 747455f0328c..dd0d8c6b9f59 100644
+--- a/arch/alpha/lib/ev67-strrchr.S
++++ b/arch/alpha/lib/ev67-strrchr.S
+@@ -18,7 +18,7 @@
+  *	L	- lower subcluster; L0 - subcluster L0; L1 - subcluster L1
+  */
+ 
+-#include <asm/export.h>
++
+ #include <asm/regdef.h>
+ 
+ 	.set noreorder
+@@ -107,4 +107,3 @@ $eos:
+ 	nop
+ 
+ 	.end strrchr
+-	EXPORT_SYMBOL(strrchr)
+diff --git a/arch/alpha/lib/fpreg.c b/arch/alpha/lib/fpreg.c
+index 4aa6dbfa14ee..05017ba34c3c 100644
+--- a/arch/alpha/lib/fpreg.c
++++ b/arch/alpha/lib/fpreg.c
+@@ -4,9 +4,6 @@
+  * (C) Copyright 1998 Linus Torvalds
+  */
+ 
+-#include <linux/compiler.h>
+-#include <linux/export.h>
+-
+ #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
+ #define STT(reg,val)  asm volatile ("ftoit $f"#reg",%0" : "=r"(val));
+ #else
+@@ -55,7 +52,6 @@ alpha_read_fp_reg (unsigned long reg)
+ 	}
+ 	return val;
+ }
+-EXPORT_SYMBOL(alpha_read_fp_reg);
+ 
+ #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
+ #define LDT(reg,val)  asm volatile ("itoft %0,$f"#reg : : "r"(val));
+@@ -101,7 +97,6 @@ alpha_write_fp_reg (unsigned long reg, unsigned long val)
+ 	      case 31: LDT(31, val); break;
+ 	}
+ }
+-EXPORT_SYMBOL(alpha_write_fp_reg);
+ 
+ #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
+ #define STS(reg,val)  asm volatile ("ftois $f"#reg",%0" : "=r"(val));
+@@ -151,7 +146,6 @@ alpha_read_fp_reg_s (unsigned long reg)
+ 	}
+ 	return val;
+ }
+-EXPORT_SYMBOL(alpha_read_fp_reg_s);
+ 
+ #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
+ #define LDS(reg,val)  asm volatile ("itofs %0,$f"#reg : : "r"(val));
+@@ -197,4 +191,3 @@ alpha_write_fp_reg_s (unsigned long reg, unsigned long val)
+ 	      case 31: LDS(31, val); break;
+ 	}
+ }
+-EXPORT_SYMBOL(alpha_write_fp_reg_s);
+diff --git a/arch/alpha/lib/memchr.S b/arch/alpha/lib/memchr.S
+index c13d3eca2e05..14427eeb555e 100644
+--- a/arch/alpha/lib/memchr.S
++++ b/arch/alpha/lib/memchr.S
+@@ -31,7 +31,7 @@ For correctness consider that:
+       - only minimum number of quadwords may be accessed
+       - the third argument is an unsigned long
+ */
+-#include <asm/export.h>
++
+         .set noreorder
+         .set noat
+ 
+@@ -162,4 +162,3 @@ $not_found:
+ 	ret			# .. e1 :
+ 
+         .end memchr
+-	EXPORT_SYMBOL(memchr)
+diff --git a/arch/alpha/lib/memcpy.c b/arch/alpha/lib/memcpy.c
+index 57d9291ad172..64083fc73238 100644
+--- a/arch/alpha/lib/memcpy.c
++++ b/arch/alpha/lib/memcpy.c
+@@ -16,7 +16,6 @@
+  */
+ 
+ #include <linux/types.h>
+-#include <linux/export.h>
+ 
+ /*
+  * This should be done in one go with ldq_u*2/mask/stq_u. Do it
+@@ -159,4 +158,6 @@ void * memcpy(void * dest, const void *src, size_t n)
+ 	__memcpy_unaligned_up ((unsigned long) dest, (unsigned long) src, n);
+ 	return dest;
+ }
+-EXPORT_SYMBOL(memcpy);
++
++/* For backward modules compatibility, define __memcpy.  */
++asm("__memcpy = memcpy; .globl __memcpy");
+diff --git a/arch/alpha/lib/memmove.S b/arch/alpha/lib/memmove.S
+index 6872c85cb5e5..eb3b6e02242f 100644
+--- a/arch/alpha/lib/memmove.S
++++ b/arch/alpha/lib/memmove.S
+@@ -6,7 +6,7 @@
+  * This is hand-massaged output from the original memcpy.c.  We defer to
+  * memcpy whenever possible; the backwards copy loops are not unrolled.
+  */
+-#include <asm/export.h>        
++        
+ 	.set noat
+ 	.set noreorder
+ 	.text
+@@ -179,4 +179,3 @@ $egress:
+ 	nop
+ 
+ 	.end memmove
+-	EXPORT_SYMBOL(memmove)
+diff --git a/arch/alpha/lib/memset.S b/arch/alpha/lib/memset.S
+index 89a26f5e89de..76ccc6d1f364 100644
+--- a/arch/alpha/lib/memset.S
++++ b/arch/alpha/lib/memset.S
+@@ -13,7 +13,7 @@
+  * The scheduling comments are according to the EV5 documentation (and done by 
+  * hand, so they might well be incorrect, please do tell me about it..)
+  */
+-#include <asm/export.h>
++
+ 	.set noat
+ 	.set noreorder
+ .text
+@@ -106,8 +106,6 @@ within_one_quad:
+ end:
+ 	ret $31,($26),1		/* E1 */
+ 	.end ___memset
+-EXPORT_SYMBOL(___memset)
+-EXPORT_SYMBOL(__constant_c_memset)
+ 
+ 	.align 5
+ 	.ent __memsetw
+@@ -124,9 +122,6 @@ __memsetw:
+ 	br __constant_c_memset	/* .. E1 */
+ 
+ 	.end __memsetw
+-EXPORT_SYMBOL(__memsetw)
+ 
+ memset = ___memset
+ __memset = ___memset
+-	EXPORT_SYMBOL(memset)
+-	EXPORT_SYMBOL(__memset)
+diff --git a/arch/alpha/lib/strcat.S b/arch/alpha/lib/strcat.S
+index 249837b03d4b..393f50384878 100644
+--- a/arch/alpha/lib/strcat.S
++++ b/arch/alpha/lib/strcat.S
+@@ -4,7 +4,6 @@
+  *
+  * Append a null-terminated string from SRC to DST.
+  */
+-#include <asm/export.h>
+ 
+ 	.text
+ 
+@@ -51,4 +50,3 @@ $found:	negq    $2, $3		# clear all but least set bit
+ 	br	__stxcpy
+ 
+ 	.end strcat
+-EXPORT_SYMBOL(strcat);
+diff --git a/arch/alpha/lib/strchr.S b/arch/alpha/lib/strchr.S
+index 7412a173ea39..011a175e8329 100644
+--- a/arch/alpha/lib/strchr.S
++++ b/arch/alpha/lib/strchr.S
+@@ -5,7 +5,7 @@
+  * Return the address of a given character within a null-terminated
+  * string, or null if it is not found.
+  */
+-#include <asm/export.h>
++
+ #include <asm/regdef.h>
+ 
+ 	.set noreorder
+@@ -68,4 +68,3 @@ $retnull:
+ 	ret			# .. e1 :
+ 
+ 	.end strchr
+-	EXPORT_SYMBOL(strchr)
+diff --git a/arch/alpha/lib/strcpy.S b/arch/alpha/lib/strcpy.S
+index 98deae1e4d08..e0728e4ad21f 100644
+--- a/arch/alpha/lib/strcpy.S
++++ b/arch/alpha/lib/strcpy.S
+@@ -5,7 +5,7 @@
+  * Copy a null-terminated string from SRC to DST.  Return a pointer
+  * to the null-terminator in the source.
+  */
+-#include <asm/export.h>
++
+ 	.text
+ 
+ 	.align 3
+@@ -21,4 +21,3 @@ strcpy:
+ 	br	__stxcpy	# do the copy
+ 
+ 	.end strcpy
+-	EXPORT_SYMBOL(strcpy)
+diff --git a/arch/alpha/lib/strlen.S b/arch/alpha/lib/strlen.S
+index 79c416f71bac..fe63353de152 100644
+--- a/arch/alpha/lib/strlen.S
++++ b/arch/alpha/lib/strlen.S
+@@ -11,7 +11,7 @@
+  *	  do this instead of the 9 instructions that
+  *	  binary search needs).
+  */
+-#include <asm/export.h>
++
+ 	.set noreorder
+ 	.set noat
+ 
+@@ -55,4 +55,3 @@ done:	subq	$0, $16, $0
+ 	ret	$31, ($26)
+ 
+ 	.end	strlen
+-	EXPORT_SYMBOL(strlen)
+diff --git a/arch/alpha/lib/strncat.S b/arch/alpha/lib/strncat.S
+index 6c29ea60869a..a8278163c972 100644
+--- a/arch/alpha/lib/strncat.S
++++ b/arch/alpha/lib/strncat.S
+@@ -9,7 +9,7 @@
+  * past count, whereas libc may write to count+1.  This follows the generic
+  * implementation in lib/string.c and is, IMHO, more sensible.
+  */
+-#include <asm/export.h>
++
+ 	.text
+ 
+ 	.align 3
+@@ -82,4 +82,3 @@ $zerocount:
+ 	ret
+ 
+ 	.end strncat
+-	EXPORT_SYMBOL(strncat)
+diff --git a/arch/alpha/lib/strncpy.S b/arch/alpha/lib/strncpy.S
+index e102cf1567dd..a46f7f3ad8c7 100644
+--- a/arch/alpha/lib/strncpy.S
++++ b/arch/alpha/lib/strncpy.S
+@@ -10,7 +10,7 @@
+  * version has cropped that bit o' nastiness as well as assuming that
+  * __stxncpy is in range of a branch.
+  */
+-#include <asm/export.h>
++
+ 	.set noat
+ 	.set noreorder
+ 
+@@ -79,4 +79,3 @@ $zerolen:
+ 	ret
+ 
+ 	.end	strncpy
+-	EXPORT_SYMBOL(strncpy)
+diff --git a/arch/alpha/lib/strrchr.S b/arch/alpha/lib/strrchr.S
+index 4bc6cb4b9812..1970dc07cfd1 100644
+--- a/arch/alpha/lib/strrchr.S
++++ b/arch/alpha/lib/strrchr.S
+@@ -5,7 +5,7 @@
+  * Return the address of the last occurrence of a given character
+  * within a null-terminated string, or null if it is not found.
+  */
+-#include <asm/export.h>
++
+ #include <asm/regdef.h>
+ 
+ 	.set noreorder
+@@ -85,4 +85,3 @@ $retnull:
+ 	ret			# .. e1 :
+ 
+ 	.end strrchr
+-	EXPORT_SYMBOL(strrchr)
diff --git a/debian/patches/bugfix/ia64/revert-ia64-move-exports-to-definitions.patch b/debian/patches/bugfix/ia64/revert-ia64-move-exports-to-definitions.patch
new file mode 100644
index 0000000..dadf2c6
--- /dev/null
+++ b/debian/patches/bugfix/ia64/revert-ia64-move-exports-to-definitions.patch
@@ -0,0 +1,643 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 1 Dec 2016 23:20:31 +0000
+Subject: Revert "ia64: move exports to definitions"
+Forwarded: not-needed
+
+This reverts commit e007c53397acb5554e226693e3bff54a312ccd96 because
+symbols exported from assembly don't automatically get modversions (ABI
+hashes).
+---
+ arch/ia64/include/asm/export.h    |  3 --
+ arch/ia64/kernel/entry.S          |  3 --
+ arch/ia64/kernel/esi_stub.S       |  2 -
+ arch/ia64/kernel/head.S           |  2 -
+ arch/ia64/kernel/ia64_ksyms.c     | 94 ++++++++++++++++++++++++++++++++++++++-
+ arch/ia64/kernel/ivt.S            |  2 -
+ arch/ia64/kernel/pal.S            |  7 ---
+ arch/ia64/kernel/setup.c          |  4 --
+ arch/ia64/lib/clear_page.S        |  2 -
+ arch/ia64/lib/clear_user.S        |  2 -
+ arch/ia64/lib/copy_page.S         |  2 -
+ arch/ia64/lib/copy_page_mck.S     |  2 -
+ arch/ia64/lib/copy_user.S         |  2 -
+ arch/ia64/lib/flush.S             |  2 -
+ arch/ia64/lib/idiv32.S            |  2 -
+ arch/ia64/lib/idiv64.S            |  2 -
+ arch/ia64/lib/ip_fast_csum.S      |  3 --
+ arch/ia64/lib/memcpy.S            |  2 -
+ arch/ia64/lib/memcpy_mck.S        |  3 --
+ arch/ia64/lib/memset.S            |  2 -
+ arch/ia64/lib/strlen.S            |  2 -
+ arch/ia64/lib/strlen_user.S       |  2 -
+ arch/ia64/lib/strncpy_from_user.S |  2 -
+ arch/ia64/lib/strnlen_user.S      |  2 -
+ arch/ia64/lib/xor.S               |  5 ---
+ 25 files changed, 92 insertions(+), 64 deletions(-)
+ delete mode 100644 arch/ia64/include/asm/export.h
+
+diff --git a/arch/ia64/include/asm/export.h b/arch/ia64/include/asm/export.h
+deleted file mode 100644
+index ad18c6583252..000000000000
+--- a/arch/ia64/include/asm/export.h
++++ /dev/null
+@@ -1,3 +0,0 @@
+-/* EXPORT_DATA_SYMBOL != EXPORT_SYMBOL here */
+-#define KSYM_FUNC(name) @fptr(name)
+-#include <asm-generic/export.h>
+diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
+index 6f27a663177c..cfaa7b25084c 100644
+--- a/arch/ia64/kernel/entry.S
++++ b/arch/ia64/kernel/entry.S
+@@ -48,7 +48,6 @@
+ #include <asm/thread_info.h>
+ #include <asm/unistd.h>
+ #include <asm/ftrace.h>
+-#include <asm/export.h>
+ 
+ #include "minstate.h"
+ 
+@@ -1346,14 +1345,12 @@ GLOBAL_ENTRY(unw_init_running)
+ 	mov rp=loc0
+ 	br.ret.sptk.many rp
+ END(unw_init_running)
+-EXPORT_SYMBOL(unw_init_running)
+ 
+ #ifdef CONFIG_FUNCTION_TRACER
+ #ifdef CONFIG_DYNAMIC_FTRACE
+ GLOBAL_ENTRY(_mcount)
+ 	br ftrace_stub
+ END(_mcount)
+-EXPORT_SYMBOL(_mcount)
+ 
+ .here:
+ 	br.ret.sptk.many b0
+diff --git a/arch/ia64/kernel/esi_stub.S b/arch/ia64/kernel/esi_stub.S
+index 2c369bf77c4b..6b3d6c1f99b6 100644
+--- a/arch/ia64/kernel/esi_stub.S
++++ b/arch/ia64/kernel/esi_stub.S
+@@ -35,7 +35,6 @@
+ 
+ #include <asm/processor.h>
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ /*
+  * Inputs:
+@@ -95,4 +94,3 @@ GLOBAL_ENTRY(esi_call_phys)
+ 	mov gp=loc2
+ 	br.ret.sptk.many rp
+ END(esi_call_phys)
+-EXPORT_SYMBOL_GPL(esi_call_phys)
+diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
+index c9b5e942f671..bb748c596443 100644
+--- a/arch/ia64/kernel/head.S
++++ b/arch/ia64/kernel/head.S
+@@ -32,7 +32,6 @@
+ #include <asm/mca_asm.h>
+ #include <linux/init.h>
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ #ifdef CONFIG_HOTPLUG_CPU
+ #define SAL_PSR_BITS_TO_SET				\
+@@ -169,7 +168,6 @@ RestRR:											\
+ 	__PAGE_ALIGNED_DATA
+ 
+ 	.global empty_zero_page
+-EXPORT_DATA_SYMBOL_GPL(empty_zero_page)
+ empty_zero_page:
+ 	.skip PAGE_SIZE
+ 
+diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
+index d111248af719..096731049538 100644
+--- a/arch/ia64/kernel/ia64_ksyms.c
++++ b/arch/ia64/kernel/ia64_ksyms.c
+@@ -1,11 +1,101 @@
+ /*
+  * Architecture-specific kernel symbols
++ *
++ * Don't put any exports here unless it's defined in an assembler file.
++ * All other exports should be put directly after the definition.
+  */
+ 
++#include <linux/module.h>
++
++#include <linux/string.h>
++EXPORT_SYMBOL(memset);
++EXPORT_SYMBOL(memcpy);
++EXPORT_SYMBOL(strlen);
++
++#include <asm/pgtable.h>
++EXPORT_SYMBOL_GPL(empty_zero_page);
++
++#include <asm/checksum.h>
++EXPORT_SYMBOL(ip_fast_csum);		/* hand-coded assembly */
++EXPORT_SYMBOL(csum_ipv6_magic);
++
++#include <asm/page.h>
++EXPORT_SYMBOL(clear_page);
++EXPORT_SYMBOL(copy_page);
++
+ #ifdef CONFIG_VIRTUAL_MEM_MAP
+-#include <linux/compiler.h>
+-#include <linux/export.h>
+ #include <linux/bootmem.h>
+ EXPORT_SYMBOL(min_low_pfn);	/* defined by bootmem.c, but not exported by generic code */
+ EXPORT_SYMBOL(max_low_pfn);	/* defined by bootmem.c, but not exported by generic code */
+ #endif
++
++#include <asm/processor.h>
++EXPORT_SYMBOL(ia64_cpu_info);
++#ifdef CONFIG_SMP
++EXPORT_SYMBOL(local_per_cpu_offset);
++#endif
++
++#include <asm/uaccess.h>
++EXPORT_SYMBOL(__copy_user);
++EXPORT_SYMBOL(__do_clear_user);
++EXPORT_SYMBOL(__strlen_user);
++EXPORT_SYMBOL(__strncpy_from_user);
++EXPORT_SYMBOL(__strnlen_user);
++
++/* from arch/ia64/lib */
++extern void __divsi3(void);
++extern void __udivsi3(void);
++extern void __modsi3(void);
++extern void __umodsi3(void);
++extern void __divdi3(void);
++extern void __udivdi3(void);
++extern void __moddi3(void);
++extern void __umoddi3(void);
++
++EXPORT_SYMBOL(__divsi3);
++EXPORT_SYMBOL(__udivsi3);
++EXPORT_SYMBOL(__modsi3);
++EXPORT_SYMBOL(__umodsi3);
++EXPORT_SYMBOL(__divdi3);
++EXPORT_SYMBOL(__udivdi3);
++EXPORT_SYMBOL(__moddi3);
++EXPORT_SYMBOL(__umoddi3);
++
++#if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE)
++extern void xor_ia64_2(void);
++extern void xor_ia64_3(void);
++extern void xor_ia64_4(void);
++extern void xor_ia64_5(void);
++
++EXPORT_SYMBOL(xor_ia64_2);
++EXPORT_SYMBOL(xor_ia64_3);
++EXPORT_SYMBOL(xor_ia64_4);
++EXPORT_SYMBOL(xor_ia64_5);
++#endif
++
++#include <asm/pal.h>
++EXPORT_SYMBOL(ia64_pal_call_phys_stacked);
++EXPORT_SYMBOL(ia64_pal_call_phys_static);
++EXPORT_SYMBOL(ia64_pal_call_stacked);
++EXPORT_SYMBOL(ia64_pal_call_static);
++EXPORT_SYMBOL(ia64_load_scratch_fpregs);
++EXPORT_SYMBOL(ia64_save_scratch_fpregs);
++
++#include <asm/unwind.h>
++EXPORT_SYMBOL(unw_init_running);
++
++#if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE)
++extern void esi_call_phys (void);
++EXPORT_SYMBOL_GPL(esi_call_phys);
++#endif
++extern char ia64_ivt[];
++EXPORT_SYMBOL(ia64_ivt);
++
++#include <asm/ftrace.h>
++#ifdef CONFIG_FUNCTION_TRACER
++/* mcount is defined in assembly */
++EXPORT_SYMBOL(_mcount);
++#endif
++
++#include <asm/cacheflush.h>
++EXPORT_SYMBOL_GPL(flush_icache_range);
+diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
+index 44a103a5de2b..b1c3cfc93e71 100644
+--- a/arch/ia64/kernel/ivt.S
++++ b/arch/ia64/kernel/ivt.S
+@@ -57,7 +57,6 @@
+ #include <asm/thread_info.h>
+ #include <asm/unistd.h>
+ #include <asm/errno.h>
+-#include <asm/export.h>
+ 
+ #if 0
+ # define PSR_DEFAULT_BITS	psr.ac
+@@ -86,7 +85,6 @@
+ 
+ 	.align 32768	// align on 32KB boundary
+ 	.global ia64_ivt
+-	EXPORT_DATA_SYMBOL(ia64_ivt)
+ ia64_ivt:
+ /////////////////////////////////////////////////////////////////////////////////////////
+ // 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47)
+diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S
+index 94fb2e395498..0b533441c3c9 100644
+--- a/arch/ia64/kernel/pal.S
++++ b/arch/ia64/kernel/pal.S
+@@ -14,7 +14,6 @@
+ 
+ #include <asm/asmmacro.h>
+ #include <asm/processor.h>
+-#include <asm/export.h>
+ 
+ 	.data
+ pal_entry_point:
+@@ -88,7 +87,6 @@ GLOBAL_ENTRY(ia64_pal_call_static)
+ 	srlz.d				// seralize restoration of psr.l
+ 	br.ret.sptk.many b0
+ END(ia64_pal_call_static)
+-EXPORT_SYMBOL(ia64_pal_call_static)
+ 
+ /*
+  * Make a PAL call using the stacked registers calling convention.
+@@ -124,7 +122,6 @@ GLOBAL_ENTRY(ia64_pal_call_stacked)
+ 	srlz.d				// serialize restoration of psr.l
+ 	br.ret.sptk.many b0
+ END(ia64_pal_call_stacked)
+-EXPORT_SYMBOL(ia64_pal_call_stacked)
+ 
+ /*
+  * Make a physical mode PAL call using the static registers calling convention.
+@@ -196,7 +193,6 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
+ 	srlz.d				// seralize restoration of psr.l
+ 	br.ret.sptk.many b0
+ END(ia64_pal_call_phys_static)
+-EXPORT_SYMBOL(ia64_pal_call_phys_static)
+ 
+ /*
+  * Make a PAL call using the stacked registers in physical mode.
+@@ -254,7 +250,6 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
+ 	srlz.d				// seralize restoration of psr.l
+ 	br.ret.sptk.many b0
+ END(ia64_pal_call_phys_stacked)
+-EXPORT_SYMBOL(ia64_pal_call_phys_stacked)
+ 
+ /*
+  * Save scratch fp scratch regs which aren't saved in pt_regs already
+@@ -280,7 +275,6 @@ GLOBAL_ENTRY(ia64_save_scratch_fpregs)
+ 	stf.spill [r2]  = f15,32
+ 	br.ret.sptk.many rp
+ END(ia64_save_scratch_fpregs)
+-EXPORT_SYMBOL(ia64_save_scratch_fpregs)
+ 
+ /*
+  * Load scratch fp scratch regs (fp10-fp15)
+@@ -302,4 +296,3 @@ GLOBAL_ENTRY(ia64_load_scratch_fpregs)
+ 	ldf.fill  f15 = [r2],32
+ 	br.ret.sptk.many rp
+ END(ia64_load_scratch_fpregs)
+-EXPORT_SYMBOL(ia64_load_scratch_fpregs)
+diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
+index 7ec7acc844c2..afddb3e80a29 100644
+--- a/arch/ia64/kernel/setup.c
++++ b/arch/ia64/kernel/setup.c
+@@ -71,11 +71,7 @@ EXPORT_SYMBOL(__per_cpu_offset);
+ #endif
+ 
+ DEFINE_PER_CPU(struct cpuinfo_ia64, ia64_cpu_info);
+-EXPORT_SYMBOL(ia64_cpu_info);
+ DEFINE_PER_CPU(unsigned long, local_per_cpu_offset);
+-#ifdef CONFIG_SMP
+-EXPORT_SYMBOL(local_per_cpu_offset);
+-#endif
+ unsigned long ia64_cycles_per_usec;
+ struct ia64_boot_param *ia64_boot_param;
+ struct screen_info screen_info;
+diff --git a/arch/ia64/lib/clear_page.S b/arch/ia64/lib/clear_page.S
+index 3cf5b76e587f..2d814e7ed191 100644
+--- a/arch/ia64/lib/clear_page.S
++++ b/arch/ia64/lib/clear_page.S
+@@ -11,7 +11,6 @@
+ 
+ #include <asm/asmmacro.h>
+ #include <asm/page.h>
+-#include <asm/export.h>
+ 
+ #ifdef CONFIG_ITANIUM
+ # define L3_LINE_SIZE	64	// Itanium L3 line size
+@@ -75,4 +74,3 @@ GLOBAL_ENTRY(clear_page)
+ 	mov ar.lc = saved_lc		// restore lc
+ 	br.ret.sptk.many rp
+ END(clear_page)
+-EXPORT_SYMBOL(clear_page)
+diff --git a/arch/ia64/lib/clear_user.S b/arch/ia64/lib/clear_user.S
+index 7b40731ee5d8..eecd8577b209 100644
+--- a/arch/ia64/lib/clear_user.S
++++ b/arch/ia64/lib/clear_user.S
+@@ -12,7 +12,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ //
+ // arguments
+@@ -208,4 +207,3 @@ GLOBAL_ENTRY(__do_clear_user)
+ 	mov ar.lc=saved_lc
+ 	br.ret.sptk.many rp
+ END(__do_clear_user)
+-EXPORT_SYMBOL(__do_clear_user)
+diff --git a/arch/ia64/lib/copy_page.S b/arch/ia64/lib/copy_page.S
+index cbdb9e323ffb..127d1d050d78 100644
+--- a/arch/ia64/lib/copy_page.S
++++ b/arch/ia64/lib/copy_page.S
+@@ -16,7 +16,6 @@
+  */
+ #include <asm/asmmacro.h>
+ #include <asm/page.h>
+-#include <asm/export.h>
+ 
+ #define PIPE_DEPTH	3
+ #define EPI		p[PIPE_DEPTH-1]
+@@ -97,4 +96,3 @@ GLOBAL_ENTRY(copy_page)
+ 	mov ar.lc=saved_lc
+ 	br.ret.sptk.many rp
+ END(copy_page)
+-EXPORT_SYMBOL(copy_page)
+diff --git a/arch/ia64/lib/copy_page_mck.S b/arch/ia64/lib/copy_page_mck.S
+index c13f69036876..3c45d60a81b4 100644
+--- a/arch/ia64/lib/copy_page_mck.S
++++ b/arch/ia64/lib/copy_page_mck.S
+@@ -61,7 +61,6 @@
+  */
+ #include <asm/asmmacro.h>
+ #include <asm/page.h>
+-#include <asm/export.h>
+ 
+ #define PREFETCH_DIST	8		// McKinley sustains 16 outstanding L2 misses (8 ld, 8 st)
+ 
+@@ -184,4 +183,3 @@ GLOBAL_ENTRY(copy_page)
+ 	mov pr = saved_pr, -1
+ 	br.ret.sptk.many rp
+ END(copy_page)
+-EXPORT_SYMBOL(copy_page)
+diff --git a/arch/ia64/lib/copy_user.S b/arch/ia64/lib/copy_user.S
+index 66facd52e8d0..c952bdc6a093 100644
+--- a/arch/ia64/lib/copy_user.S
++++ b/arch/ia64/lib/copy_user.S
+@@ -30,7 +30,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ //
+ // Tuneable parameters
+@@ -609,4 +608,3 @@ GLOBAL_ENTRY(__copy_user)
+ 	mov ar.pfs=saved_pfs
+ 	br.ret.sptk.many rp
+ END(__copy_user)
+-EXPORT_SYMBOL(__copy_user)
+diff --git a/arch/ia64/lib/flush.S b/arch/ia64/lib/flush.S
+index 9a5a2f9fad13..1d8c88860063 100644
+--- a/arch/ia64/lib/flush.S
++++ b/arch/ia64/lib/flush.S
+@@ -8,7 +8,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ 
+ 	/*
+@@ -61,7 +60,6 @@ GLOBAL_ENTRY(flush_icache_range)
+ 	mov	ar.lc=r3		// restore ar.lc
+ 	br.ret.sptk.many rp
+ END(flush_icache_range)
+-EXPORT_SYMBOL_GPL(flush_icache_range)
+ 
+ 	/*
+ 	 * clflush_cache_range(start,size)
+diff --git a/arch/ia64/lib/idiv32.S b/arch/ia64/lib/idiv32.S
+index 715aed79a9ce..c91b5b0129ff 100644
+--- a/arch/ia64/lib/idiv32.S
++++ b/arch/ia64/lib/idiv32.S
+@@ -15,7 +15,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ #ifdef MODULO
+ # define OP	mod
+@@ -82,4 +81,3 @@ GLOBAL_ENTRY(NAME)
+ 	getf.sig r8 = f6		// transfer result to result register
+ 	br.ret.sptk.many rp
+ END(NAME)
+-EXPORT_SYMBOL(NAME)
+diff --git a/arch/ia64/lib/idiv64.S b/arch/ia64/lib/idiv64.S
+index 25840f697753..627573c4ceb1 100644
+--- a/arch/ia64/lib/idiv64.S
++++ b/arch/ia64/lib/idiv64.S
+@@ -15,7 +15,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ #ifdef MODULO
+ # define OP	mod
+@@ -79,4 +78,3 @@ GLOBAL_ENTRY(NAME)
+ 	getf.sig r8 = f11		// transfer result to result register
+ 	br.ret.sptk.many rp
+ END(NAME)
+-EXPORT_SYMBOL(NAME)
+diff --git a/arch/ia64/lib/ip_fast_csum.S b/arch/ia64/lib/ip_fast_csum.S
+index 648e0d4a4839..620d9dc5220f 100644
+--- a/arch/ia64/lib/ip_fast_csum.S
++++ b/arch/ia64/lib/ip_fast_csum.S
+@@ -13,7 +13,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ /*
+  * Since we know that most likely this function is called with buf aligned
+@@ -93,7 +92,6 @@ GLOBAL_ENTRY(ip_fast_csum)
+ 	mov	b0=r34
+ 	br.ret.sptk.many b0
+ END(ip_fast_csum)
+-EXPORT_SYMBOL(ip_fast_csum)
+ 
+ GLOBAL_ENTRY(csum_ipv6_magic)
+ 	ld4	r20=[in0],4
+@@ -144,4 +142,3 @@ GLOBAL_ENTRY(csum_ipv6_magic)
+ 	andcm	r8=r9,r8
+ 	br.ret.sptk.many b0
+ END(csum_ipv6_magic)
+-EXPORT_SYMBOL(csum_ipv6_magic)
+diff --git a/arch/ia64/lib/memcpy.S b/arch/ia64/lib/memcpy.S
+index ba172fd6acf4..448908d80b69 100644
+--- a/arch/ia64/lib/memcpy.S
++++ b/arch/ia64/lib/memcpy.S
+@@ -14,7 +14,6 @@
+  *	David Mosberger-Tang <davidm at hpl.hp.com>
+  */
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ GLOBAL_ENTRY(memcpy)
+ 
+@@ -300,4 +299,3 @@ GLOBAL_ENTRY(memcpy)
+ 	COPY(56, 0)
+ 
+ END(memcpy)
+-EXPORT_SYMBOL(memcpy)
+diff --git a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S
+index b264b6a7967b..ab0f87639729 100644
+--- a/arch/ia64/lib/memcpy_mck.S
++++ b/arch/ia64/lib/memcpy_mck.S
+@@ -15,7 +15,6 @@
+  */
+ #include <asm/asmmacro.h>
+ #include <asm/page.h>
+-#include <asm/export.h>
+ 
+ #define EK(y...) EX(y)
+ 
+@@ -79,7 +78,6 @@ GLOBAL_ENTRY(memcpy)
+ 	br.cond.sptk .common_code
+ 	;;
+ END(memcpy)
+-EXPORT_SYMBOL(memcpy)
+ GLOBAL_ENTRY(__copy_user)
+ 	.prologue
+ // check dest alignment
+@@ -666,4 +664,3 @@ EK(.ex_handler,  (p17)	st8	[dst1]=r39,8);						\
+ 
+ /* end of McKinley specific optimization */
+ END(__copy_user)
+-EXPORT_SYMBOL(__copy_user)
+diff --git a/arch/ia64/lib/memset.S b/arch/ia64/lib/memset.S
+index 87b974704075..f26c16aefb1c 100644
+--- a/arch/ia64/lib/memset.S
++++ b/arch/ia64/lib/memset.S
+@@ -18,7 +18,6 @@
+    to get peak speed when value = 0.  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ #undef ret
+ 
+ #define dest		in0
+@@ -361,4 +360,3 @@ GLOBAL_ENTRY(memset)
+ 	br.ret.sptk.many rp
+ }
+ END(memset)
+-EXPORT_SYMBOL(memset)
+diff --git a/arch/ia64/lib/strlen.S b/arch/ia64/lib/strlen.S
+index 1a6e17c657b4..e0cdac0a85b8 100644
+--- a/arch/ia64/lib/strlen.S
++++ b/arch/ia64/lib/strlen.S
+@@ -17,7 +17,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ //
+ //
+@@ -191,4 +190,3 @@ GLOBAL_ENTRY(strlen)
+ 	mov ar.pfs=saved_pfs	// because of ar.ec, restore no matter what
+ 	br.ret.sptk.many rp	// end of successful recovery code
+ END(strlen)
+-EXPORT_SYMBOL(strlen)
+diff --git a/arch/ia64/lib/strlen_user.S b/arch/ia64/lib/strlen_user.S
+index 9d257684e733..c71eded4285e 100644
+--- a/arch/ia64/lib/strlen_user.S
++++ b/arch/ia64/lib/strlen_user.S
+@@ -16,7 +16,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ //
+ // int strlen_user(char *)
+@@ -197,4 +196,3 @@ GLOBAL_ENTRY(__strlen_user)
+ 	mov ar.pfs=saved_pfs	// because of ar.ec, restore no matter what
+ 	br.ret.sptk.many rp
+ END(__strlen_user)
+-EXPORT_SYMBOL(__strlen_user)
+diff --git a/arch/ia64/lib/strncpy_from_user.S b/arch/ia64/lib/strncpy_from_user.S
+index ca9ccf280e2e..a504381f31eb 100644
+--- a/arch/ia64/lib/strncpy_from_user.S
++++ b/arch/ia64/lib/strncpy_from_user.S
+@@ -17,7 +17,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ GLOBAL_ENTRY(__strncpy_from_user)
+ 	alloc r2=ar.pfs,3,0,0,0
+@@ -43,4 +42,3 @@ GLOBAL_ENTRY(__strncpy_from_user)
+ [.Lexit:]
+ 	br.ret.sptk.many rp
+ END(__strncpy_from_user)
+-EXPORT_SYMBOL(__strncpy_from_user)
+diff --git a/arch/ia64/lib/strnlen_user.S b/arch/ia64/lib/strnlen_user.S
+index 80a5dfd1d402..d09066b1e49d 100644
+--- a/arch/ia64/lib/strnlen_user.S
++++ b/arch/ia64/lib/strnlen_user.S
+@@ -13,7 +13,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ GLOBAL_ENTRY(__strnlen_user)
+ 	.prologue
+@@ -44,4 +43,3 @@ GLOBAL_ENTRY(__strnlen_user)
+ 	mov ar.lc=r16			// restore ar.lc
+ 	br.ret.sptk.many rp
+ END(__strnlen_user)
+-EXPORT_SYMBOL(__strnlen_user)
+diff --git a/arch/ia64/lib/xor.S b/arch/ia64/lib/xor.S
+index c83f1c410691..54e3f7eab8e9 100644
+--- a/arch/ia64/lib/xor.S
++++ b/arch/ia64/lib/xor.S
+@@ -14,7 +14,6 @@
+  */
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ GLOBAL_ENTRY(xor_ia64_2)
+ 	.prologue
+@@ -52,7 +51,6 @@ GLOBAL_ENTRY(xor_ia64_2)
+ 	mov pr = r29, -1
+ 	br.ret.sptk.few rp
+ END(xor_ia64_2)
+-EXPORT_SYMBOL(xor_ia64_2)
+ 
+ GLOBAL_ENTRY(xor_ia64_3)
+ 	.prologue
+@@ -93,7 +91,6 @@ GLOBAL_ENTRY(xor_ia64_3)
+ 	mov pr = r29, -1
+ 	br.ret.sptk.few rp
+ END(xor_ia64_3)
+-EXPORT_SYMBOL(xor_ia64_3)
+ 
+ GLOBAL_ENTRY(xor_ia64_4)
+ 	.prologue
+@@ -137,7 +134,6 @@ GLOBAL_ENTRY(xor_ia64_4)
+ 	mov pr = r29, -1
+ 	br.ret.sptk.few rp
+ END(xor_ia64_4)
+-EXPORT_SYMBOL(xor_ia64_4)
+ 
+ GLOBAL_ENTRY(xor_ia64_5)
+ 	.prologue
+@@ -186,4 +182,3 @@ GLOBAL_ENTRY(xor_ia64_5)
+ 	mov pr = r29, -1
+ 	br.ret.sptk.few rp
+ END(xor_ia64_5)
+-EXPORT_SYMBOL(xor_ia64_5)
diff --git a/debian/patches/bugfix/m68k/revert-m68k-move-exports-to-definitions.patch b/debian/patches/bugfix/m68k/revert-m68k-move-exports-to-definitions.patch
new file mode 100644
index 0000000..844375b
--- /dev/null
+++ b/debian/patches/bugfix/m68k/revert-m68k-move-exports-to-definitions.patch
@@ -0,0 +1,254 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 1 Dec 2016 23:14:09 +0000
+Subject: Revert "m68k: move exports to definitions"
+Forwarded: not-needed
+
+This reverts commit d13ffb5630443e6112df0263969cbdfc8ab9ab57 because
+symbols exported from assembly don't automatically get modversions (ABI
+hashes).
+---
+ arch/m68k/include/asm/export.h |  3 ---
+ arch/m68k/kernel/Makefile      |  2 +-
+ arch/m68k/kernel/m68k_ksyms.c  | 32 ++++++++++++++++++++++++++++++++
+ arch/m68k/lib/ashldi3.c        |  4 ----
+ arch/m68k/lib/ashrdi3.c        |  4 ----
+ arch/m68k/lib/divsi3.S         |  3 ---
+ arch/m68k/lib/lshrdi3.c        |  4 ----
+ arch/m68k/lib/modsi3.S         |  3 ---
+ arch/m68k/lib/muldi3.c         |  4 ----
+ arch/m68k/lib/mulsi3.S         |  4 ++--
+ arch/m68k/lib/udivsi3.S        |  4 ++--
+ arch/m68k/lib/umodsi3.S        |  4 ++--
+ 12 files changed, 39 insertions(+), 32 deletions(-)
+ delete mode 100644 arch/m68k/include/asm/export.h
+ create mode 100644 arch/m68k/kernel/m68k_ksyms.c
+
+diff --git a/arch/m68k/include/asm/export.h b/arch/m68k/include/asm/export.h
+deleted file mode 100644
+index 0af20f48bd07..000000000000
+--- a/arch/m68k/include/asm/export.h
++++ /dev/null
+@@ -1,3 +0,0 @@
+-#define KSYM_ALIGN 2
+-#define KCRC_ALIGN 2
+-#include <asm-generic/export.h>
+diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
+index 74c898ced8cc..8a1c4d3f91c8 100644
+--- a/arch/m68k/kernel/Makefile
++++ b/arch/m68k/kernel/Makefile
+@@ -13,7 +13,7 @@ extra-$(CONFIG_SUN3X)	:= head.o
+ extra-$(CONFIG_SUN3)	:= sun3-head.o
+ extra-y			+= vmlinux.lds
+ 
+-obj-y	:= entry.o irq.o module.o process.o ptrace.o
++obj-y	:= entry.o irq.o m68k_ksyms.o module.o process.o ptrace.o
+ obj-y	+= setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o
+ 
+ obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o
+diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
+new file mode 100644
+index 000000000000..774c1bd59c36
+--- /dev/null
++++ b/arch/m68k/kernel/m68k_ksyms.c
+@@ -0,0 +1,32 @@
++#include <linux/module.h>
++
++asmlinkage long long __ashldi3 (long long, int);
++asmlinkage long long __ashrdi3 (long long, int);
++asmlinkage long long __lshrdi3 (long long, int);
++asmlinkage long long __muldi3 (long long, long long);
++
++/* The following are special because they're not called
++   explicitly (the C compiler generates them).  Fortunately,
++   their interface isn't gonna change any time soon now, so
++   it's OK to leave it out of version control.  */
++EXPORT_SYMBOL(__ashldi3);
++EXPORT_SYMBOL(__ashrdi3);
++EXPORT_SYMBOL(__lshrdi3);
++EXPORT_SYMBOL(__muldi3);
++
++#if defined(CONFIG_CPU_HAS_NO_MULDIV64)
++/*
++ * Simpler 68k and ColdFire parts also need a few other gcc functions.
++ */
++extern long long __divsi3(long long, long long);
++extern long long __modsi3(long long, long long);
++extern long long __mulsi3(long long, long long);
++extern long long __udivsi3(long long, long long);
++extern long long __umodsi3(long long, long long);
++
++EXPORT_SYMBOL(__divsi3);
++EXPORT_SYMBOL(__modsi3);
++EXPORT_SYMBOL(__mulsi3);
++EXPORT_SYMBOL(__udivsi3);
++EXPORT_SYMBOL(__umodsi3);
++#endif
+diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c
+index 8dffd36ec4f2..37234c2df47f 100644
+--- a/arch/m68k/lib/ashldi3.c
++++ b/arch/m68k/lib/ashldi3.c
+@@ -13,9 +13,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details. */
+ 
+-#include <linux/compiler.h>
+-#include <linux/export.h>
+-
+ #define BITS_PER_UNIT 8
+ 
+ typedef		 int SItype	__attribute__ ((mode (SI)));
+@@ -58,4 +55,3 @@ __ashldi3 (DItype u, word_type b)
+ 
+   return w.ll;
+ }
+-EXPORT_SYMBOL(__ashldi3);
+diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c
+index e6565a3ee2c3..1d59345f36c6 100644
+--- a/arch/m68k/lib/ashrdi3.c
++++ b/arch/m68k/lib/ashrdi3.c
+@@ -13,9 +13,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details. */
+ 
+-#include <linux/compiler.h>
+-#include <linux/export.h>
+-
+ #define BITS_PER_UNIT 8
+ 
+ typedef		 int SItype	__attribute__ ((mode (SI)));
+@@ -59,4 +56,3 @@ __ashrdi3 (DItype u, word_type b)
+ 
+   return w.ll;
+ }
+-EXPORT_SYMBOL(__ashrdi3);
+diff --git a/arch/m68k/lib/divsi3.S b/arch/m68k/lib/divsi3.S
+index 3a2143f51631..2c0ec85ac661 100644
+--- a/arch/m68k/lib/divsi3.S
++++ b/arch/m68k/lib/divsi3.S
+@@ -33,8 +33,6 @@ General Public License for more details. */
+    D. V. Henkel-Wallace (gumby at cygnus.com) Fete Bastille, 1992
+ */
+ 
+-#include <asm/export.h>
+-
+ /* These are predefined by new versions of GNU cpp.  */
+ 
+ #ifndef __USER_LABEL_PREFIX__
+@@ -120,4 +118,3 @@ L2:	movel	d1, sp at -
+ L3:	movel	sp at +, d2
+ 	rts
+ 
+-	EXPORT_SYMBOL(__divsi3)
+diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c
+index 039779737c7d..49e1ec8f2cc2 100644
+--- a/arch/m68k/lib/lshrdi3.c
++++ b/arch/m68k/lib/lshrdi3.c
+@@ -13,9 +13,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details. */
+ 
+-#include <linux/compiler.h>
+-#include <linux/export.h>
+-
+ #define BITS_PER_UNIT 8
+ 
+ typedef		 int SItype	__attribute__ ((mode (SI)));
+@@ -58,4 +55,3 @@ __lshrdi3 (DItype u, word_type b)
+ 
+   return w.ll;
+ }
+-EXPORT_SYMBOL(__lshrdi3);
+diff --git a/arch/m68k/lib/modsi3.S b/arch/m68k/lib/modsi3.S
+index 1c967649a4e0..1d9e0efdf31d 100644
+--- a/arch/m68k/lib/modsi3.S
++++ b/arch/m68k/lib/modsi3.S
+@@ -33,8 +33,6 @@ General Public License for more details. */
+    D. V. Henkel-Wallace (gumby at cygnus.com) Fete Bastille, 1992
+ */
+ 
+-#include <asm/export.h>
+-
+ /* These are predefined by new versions of GNU cpp.  */
+ 
+ #ifndef __USER_LABEL_PREFIX__
+@@ -108,4 +106,3 @@ SYM (__modsi3):
+ 	movel	d1, d0
+ 	rts
+ 
+-	EXPORT_SYMBOL(__modsi3)
+diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c
+index 6459af5b2af0..9006d15b8721 100644
+--- a/arch/m68k/lib/muldi3.c
++++ b/arch/m68k/lib/muldi3.c
+@@ -14,9 +14,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details. */
+ 
+-#include <linux/compiler.h>
+-#include <linux/export.h>
+-
+ #ifdef CONFIG_CPU_HAS_NO_MULDIV64
+ 
+ #define SI_TYPE_SIZE 32
+@@ -93,4 +90,3 @@ __muldi3 (DItype u, DItype v)
+ 
+   return w.ll;
+ }
+-EXPORT_SYMBOL(__muldi3);
+diff --git a/arch/m68k/lib/mulsi3.S b/arch/m68k/lib/mulsi3.S
+index 855675e69a8a..c39ad4e738e9 100644
+--- a/arch/m68k/lib/mulsi3.S
++++ b/arch/m68k/lib/mulsi3.S
+@@ -32,7 +32,7 @@ General Public License for more details. */
+    Some of this code comes from MINIX, via the folks at ericsson.
+    D. V. Henkel-Wallace (gumby at cygnus.com) Fete Bastille, 1992
+ */
+-#include <asm/export.h>
++
+ /* These are predefined by new versions of GNU cpp.  */
+ 
+ #ifndef __USER_LABEL_PREFIX__
+@@ -102,4 +102,4 @@ SYM (__mulsi3):
+ 	addl	d1, d0
+ 
+ 	rts
+-	EXPORT_SYMBOL(__mulsi3)
++
+diff --git a/arch/m68k/lib/udivsi3.S b/arch/m68k/lib/udivsi3.S
+index 78440ae513bf..35a5446572a5 100644
+--- a/arch/m68k/lib/udivsi3.S
++++ b/arch/m68k/lib/udivsi3.S
+@@ -32,7 +32,7 @@ General Public License for more details. */
+    Some of this code comes from MINIX, via the folks at ericsson.
+    D. V. Henkel-Wallace (gumby at cygnus.com) Fete Bastille, 1992
+ */
+-#include <asm/export.h>
++
+ /* These are predefined by new versions of GNU cpp.  */
+ 
+ #ifndef __USER_LABEL_PREFIX__
+@@ -154,4 +154,4 @@ L2:	subql	IMM (1),d4
+ 	unlk	a6		| and return
+ 	rts
+ #endif /* __mcf5200__ || __mcoldfire__ */
+-	EXPORT_SYMBOL(__udivsi3)
++
+diff --git a/arch/m68k/lib/umodsi3.S b/arch/m68k/lib/umodsi3.S
+index b6fd11f58948..099da514a8fd 100644
+--- a/arch/m68k/lib/umodsi3.S
++++ b/arch/m68k/lib/umodsi3.S
+@@ -32,7 +32,7 @@ General Public License for more details. */
+    Some of this code comes from MINIX, via the folks at ericsson.
+    D. V. Henkel-Wallace (gumby at cygnus.com) Fete Bastille, 1992
+ */
+-#include <asm/export.h>
++
+ /* These are predefined by new versions of GNU cpp.  */
+ 
+ #ifndef __USER_LABEL_PREFIX__
+@@ -105,4 +105,4 @@ SYM (__umodsi3):
+ 	subl	d0, d1		/* d1 = a - (a/b)*b */
+ 	movel	d1, d0
+ 	rts
+-	EXPORT_SYMBOL(__umodsi3)
++
diff --git a/debian/patches/bugfix/sparc/revert-sparc-move-exports-to-definitions.patch b/debian/patches/bugfix/sparc/revert-sparc-move-exports-to-definitions.patch
new file mode 100644
index 0000000..3f8a264
--- /dev/null
+++ b/debian/patches/bugfix/sparc/revert-sparc-move-exports-to-definitions.patch
@@ -0,0 +1,1377 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Thu, 1 Dec 2016 23:10:49 +0000
+Subject: Revert "sparc: move exports to definitions"
+Forwarded: not-needed
+
+This reverts commit d3867f0483103b8ff7edfdea3ef1981c03d96891 because
+symbols exported from assembly don't automatically get modversions (ABI
+hashes).
+
+__memmove and __ret_efault are no longer exported.
+---
+ arch/sparc/include/asm/Kbuild      |   1 -
+ arch/sparc/kernel/Makefile         |   2 +-
+ arch/sparc/kernel/entry.S          |   3 -
+ arch/sparc/kernel/head_32.S        |   3 -
+ arch/sparc/kernel/head_64.S        |   6 +-
+ arch/sparc/kernel/helpers.S        |   2 -
+ arch/sparc/kernel/hvcalls.S        |   5 --
+ arch/sparc/kernel/sparc_ksyms.c    |  12 ---
+ arch/sparc/kernel/sparc_ksyms_32.c |  31 +++++++
+ arch/sparc/kernel/sparc_ksyms_64.c |  52 +++++++++++
+ arch/sparc/lib/Makefile            |   1 +
+ arch/sparc/lib/U1memcpy.S          |   2 -
+ arch/sparc/lib/VISsave.S           |   2 -
+ arch/sparc/lib/ashldi3.S           |   2 -
+ arch/sparc/lib/ashrdi3.S           |   2 -
+ arch/sparc/lib/atomic_64.S         |  16 +---
+ arch/sparc/lib/bitops.S            |   7 --
+ arch/sparc/lib/blockops.S          |   3 -
+ arch/sparc/lib/bzero.S             |   4 -
+ arch/sparc/lib/checksum_32.S       |   3 -
+ arch/sparc/lib/checksum_64.S       |   2 -
+ arch/sparc/lib/clear_page.S        |   3 -
+ arch/sparc/lib/copy_in_user.S      |   2 -
+ arch/sparc/lib/copy_page.S         |   2 -
+ arch/sparc/lib/copy_user.S         |   2 -
+ arch/sparc/lib/csum_copy.S         |   3 -
+ arch/sparc/lib/divdi3.S            |   2 -
+ arch/sparc/lib/ffs.S               |   3 -
+ arch/sparc/lib/hweight.S           |   5 --
+ arch/sparc/lib/ipcsum.S            |   2 -
+ arch/sparc/lib/ksyms.c             | 173 +++++++++++++++++++++++++++++++++++++
+ arch/sparc/lib/locks.S             |   5 --
+ arch/sparc/lib/lshrdi3.S           |   2 -
+ arch/sparc/lib/mcount.S            |   2 -
+ arch/sparc/lib/memcmp.S            |   2 -
+ arch/sparc/lib/memcpy.S            |   3 -
+ arch/sparc/lib/memmove.S           |   2 -
+ arch/sparc/lib/memscan_32.S        |   4 -
+ arch/sparc/lib/memscan_64.S        |   4 -
+ arch/sparc/lib/memset.S            |   3 -
+ arch/sparc/lib/muldi3.S            |   2 -
+ arch/sparc/lib/strlen.S            |   2 -
+ arch/sparc/lib/strncmp_32.S        |   2 -
+ arch/sparc/lib/strncmp_64.S        |   2 -
+ arch/sparc/lib/xor.S               |   9 --
+ 45 files changed, 263 insertions(+), 139 deletions(-)
+ delete mode 100644 arch/sparc/kernel/sparc_ksyms.c
+ create mode 100644 arch/sparc/kernel/sparc_ksyms_32.c
+ create mode 100644 arch/sparc/kernel/sparc_ksyms_64.c
+ create mode 100644 arch/sparc/lib/ksyms.c
+
+diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
+index cfc918067f80..6024c26c0585 100644
+--- a/arch/sparc/include/asm/Kbuild
++++ b/arch/sparc/include/asm/Kbuild
+@@ -6,7 +6,6 @@ generic-y += cputime.h
+ generic-y += div64.h
+ generic-y += emergency-restart.h
+ generic-y += exec.h
+-generic-y += export.h
+ generic-y += irq_regs.h
+ generic-y += irq_work.h
+ generic-y += linkage.h
+diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
+index fa3c02d41138..fdb13327fded 100644
+--- a/arch/sparc/kernel/Makefile
++++ b/arch/sparc/kernel/Makefile
+@@ -86,7 +86,7 @@ obj-y                     += auxio_$(BITS).o
+ obj-$(CONFIG_SUN_PM)      += apc.o pmc.o
+ 
+ obj-$(CONFIG_MODULES)     += module.o
+-obj-$(CONFIG_MODULES)     += sparc_ksyms.o
++obj-$(CONFIG_MODULES)     += sparc_ksyms_$(BITS).o
+ obj-$(CONFIG_SPARC_LED)   += led.o
+ obj-$(CONFIG_KGDB)        += kgdb_$(BITS).o
+ 
+diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
+index d85bdb999819..07918ab3062e 100644
+--- a/arch/sparc/kernel/entry.S
++++ b/arch/sparc/kernel/entry.S
+@@ -29,7 +29,6 @@
+ #include <asm/unistd.h>
+ 
+ #include <asm/asmmacro.h>
+-#include <asm/export.h>
+ 
+ #define curptr      g6
+ 
+@@ -1208,8 +1207,6 @@ delay_continue:
+ 	
+ 	ret
+ 	restore
+-EXPORT_SYMBOL(__udelay)
+-EXPORT_SYMBOL(__ndelay)
+ 
+ 	/* Handle a software breakpoint */
+ 	/* We have to inform parent that child has stopped */
+diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
+index 7bb317b87dde..3d92c0a8f6c4 100644
+--- a/arch/sparc/kernel/head_32.S
++++ b/arch/sparc/kernel/head_32.S
+@@ -24,7 +24,6 @@
+ #include <asm/thread_info.h>	/* TI_UWINMASK */
+ #include <asm/errno.h>
+ #include <asm/pgtsrmmu.h>	/* SRMMU_PGDIR_SHIFT */
+-#include <asm/export.h>
+ 
+ 	.data
+ /* The following are used with the prom_vector node-ops to figure out
+@@ -61,7 +60,6 @@ sun4e_notsup:
+  */
+ 	.globl empty_zero_page
+ empty_zero_page:	.skip PAGE_SIZE
+-EXPORT_SYMBOL(empty_zero_page)
+ 
+ 	.global root_flags
+ 	.global ram_flags
+@@ -815,4 +813,3 @@ lvl14_save:
+ __ret_efault:
+         ret
+          restore %g0, -EFAULT, %o0
+-EXPORT_SYMBOL(__ret_efault)
+diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
+index 6aa3da152c20..5f1f3ae21657 100644
+--- a/arch/sparc/kernel/head_64.S
++++ b/arch/sparc/kernel/head_64.S
+@@ -32,8 +32,7 @@
+ #include <asm/estate.h>
+ #include <asm/sfafsr.h>
+ #include <asm/unistd.h>
+-#include <asm/export.h>
+-
++	
+ /* This section from from _start to sparc64_boot_end should fit into
+  * 0x0000000000404000 to 0x0000000000408000.
+  */
+@@ -144,7 +143,6 @@ prom_cpu_compatible:
+ 	.skip	64
+ prom_root_node:
+ 	.word	0
+-EXPORT_SYMBOL(prom_root_node)
+ prom_mmu_ihandle_cache:
+ 	.word	0
+ prom_boot_mapped_pc:
+@@ -160,7 +158,6 @@ is_sun4v:
+ 	.word	0
+ sun4v_chip_type:
+ 	.word	SUN4V_CHIP_INVALID
+-EXPORT_SYMBOL(sun4v_chip_type)
+ 1:
+ 	rd	%pc, %l0
+ 
+@@ -923,7 +920,6 @@ swapper_4m_tsb:
+ 	.globl	prom_tba, tlb_type
+ prom_tba:	.xword	0
+ tlb_type:	.word	0	/* Must NOT end up in BSS */
+-EXPORT_SYMBOL(tlb_type)
+ 	.section	".fixup",#alloc,#execinstr
+ 
+ ENTRY(__retl_efault)
+diff --git a/arch/sparc/kernel/helpers.S b/arch/sparc/kernel/helpers.S
+index e4e5b832fcb6..314dd0c9fc5b 100644
+--- a/arch/sparc/kernel/helpers.S
++++ b/arch/sparc/kernel/helpers.S
+@@ -15,7 +15,6 @@ __flushw_user:
+ 2:	retl
+ 	 nop
+ 	.size	__flushw_user,.-__flushw_user
+-EXPORT_SYMBOL(__flushw_user)
+ 
+ 	/* Flush %fp and %i7 to the stack for all register
+ 	 * windows active inside of the cpu.  This allows
+@@ -62,4 +61,3 @@ real_hard_smp_processor_id:
+ 	.size		hard_smp_processor_id,.-hard_smp_processor_id
+ #endif
+ 	.size		real_hard_smp_processor_id,.-real_hard_smp_processor_id
+-EXPORT_SYMBOL_GPL(real_hard_smp_processor_id)
+diff --git a/arch/sparc/kernel/hvcalls.S b/arch/sparc/kernel/hvcalls.S
+index 4116ee5c7791..d127130bf424 100644
+--- a/arch/sparc/kernel/hvcalls.S
++++ b/arch/sparc/kernel/hvcalls.S
+@@ -343,7 +343,6 @@ ENTRY(sun4v_mach_set_watchdog)
+ 0:	retl
+ 	 nop
+ ENDPROC(sun4v_mach_set_watchdog)
+-EXPORT_SYMBOL(sun4v_mach_set_watchdog)
+ 
+ 	/* No inputs and does not return.  */
+ ENTRY(sun4v_mach_sir)
+@@ -777,7 +776,6 @@ ENTRY(sun4v_niagara_getperf)
+ 	retl
+ 	 nop
+ ENDPROC(sun4v_niagara_getperf)
+-EXPORT_SYMBOL(sun4v_niagara_getperf)
+ 
+ ENTRY(sun4v_niagara_setperf)
+ 	mov	HV_FAST_SET_PERFREG, %o5
+@@ -785,7 +783,6 @@ ENTRY(sun4v_niagara_setperf)
+ 	retl
+ 	 nop
+ ENDPROC(sun4v_niagara_setperf)
+-EXPORT_SYMBOL(sun4v_niagara_setperf)
+ 
+ ENTRY(sun4v_niagara2_getperf)
+ 	mov	%o0, %o4
+@@ -795,7 +792,6 @@ ENTRY(sun4v_niagara2_getperf)
+ 	retl
+ 	 nop
+ ENDPROC(sun4v_niagara2_getperf)
+-EXPORT_SYMBOL(sun4v_niagara2_getperf)
+ 
+ ENTRY(sun4v_niagara2_setperf)
+ 	mov	HV_FAST_N2_SET_PERFREG, %o5
+@@ -803,7 +799,6 @@ ENTRY(sun4v_niagara2_setperf)
+ 	retl
+ 	 nop
+ ENDPROC(sun4v_niagara2_setperf)
+-EXPORT_SYMBOL(sun4v_niagara2_setperf)
+ 
+ ENTRY(sun4v_reboot_data_set)
+ 	mov	HV_FAST_REBOOT_DATA_SET, %o5
+diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
+deleted file mode 100644
+index 09aa69e422e5..000000000000
+--- a/arch/sparc/kernel/sparc_ksyms.c
++++ /dev/null
+@@ -1,12 +0,0 @@
+-/*
+- * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
+- *
+- * Copyright (C) 1996 David S. Miller (davem at caip.rutgers.edu)
+- * Copyright (C) 1996 Eddie C. Dost (ecd at skynet.be)
+- */
+-
+-#include <linux/init.h>
+-#include <linux/export.h>
+-
+-/* This is needed only for drivers/sbus/char/openprom.c */
+-EXPORT_SYMBOL(saved_command_line);
+diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
+new file mode 100644
+index 000000000000..bf4ccb10a78c
+--- /dev/null
++++ b/arch/sparc/kernel/sparc_ksyms_32.c
+@@ -0,0 +1,31 @@
++/*
++ * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
++ *
++ * Copyright (C) 1996 David S. Miller (davem at caip.rutgers.edu)
++ * Copyright (C) 1996 Eddie C. Dost (ecd at skynet.be)
++ */
++
++#include <linux/module.h>
++
++#include <asm/pgtable.h>
++#include <asm/uaccess.h>
++#include <asm/delay.h>
++#include <asm/head.h>
++#include <asm/dma.h>
++
++struct poll {
++	int fd;
++	short events;
++	short revents;
++};
++
++/* from entry.S */
++EXPORT_SYMBOL(__udelay);
++EXPORT_SYMBOL(__ndelay);
++
++/* from head_32.S */
++EXPORT_SYMBOL(__ret_efault);
++EXPORT_SYMBOL(empty_zero_page);
++
++/* Exporting a symbol from /init/main.c */
++EXPORT_SYMBOL(saved_command_line);
+diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
+new file mode 100644
+index 000000000000..20ffb052fe38
+--- /dev/null
++++ b/arch/sparc/kernel/sparc_ksyms_64.c
+@@ -0,0 +1,52 @@
++/* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
++ *
++ * Copyright (C) 1996, 2007 David S. Miller (davem at davemloft.net)
++ * Copyright (C) 1996 Eddie C. Dost (ecd at skynet.be)
++ * Copyright (C) 1999 Jakub Jelinek (jj at ultra.linux.cz)
++ */
++
++#include <linux/export.h>
++#include <linux/pci.h>
++#include <linux/bitops.h>
++
++#include <asm/cpudata.h>
++#include <asm/uaccess.h>
++#include <asm/spitfire.h>
++#include <asm/oplib.h>
++#include <asm/hypervisor.h>
++#include <asm/cacheflush.h>
++
++struct poll {
++	int fd;
++	short events;
++	short revents;
++};
++
++/* from helpers.S */
++EXPORT_SYMBOL(__flushw_user);
++EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
++
++/* from head_64.S */
++EXPORT_SYMBOL(tlb_type);
++EXPORT_SYMBOL(sun4v_chip_type);
++EXPORT_SYMBOL(prom_root_node);
++
++/* from hvcalls.S */
++EXPORT_SYMBOL(sun4v_niagara_getperf);
++EXPORT_SYMBOL(sun4v_niagara_setperf);
++EXPORT_SYMBOL(sun4v_niagara2_getperf);
++EXPORT_SYMBOL(sun4v_niagara2_setperf);
++EXPORT_SYMBOL(sun4v_mach_set_watchdog);
++
++/* from hweight.S */
++EXPORT_SYMBOL(__arch_hweight8);
++EXPORT_SYMBOL(__arch_hweight16);
++EXPORT_SYMBOL(__arch_hweight32);
++EXPORT_SYMBOL(__arch_hweight64);
++
++/* from ffs_ffz.S */
++EXPORT_SYMBOL(ffs);
++EXPORT_SYMBOL(__ffs);
++
++/* Exporting a symbol from /init/main.c */
++EXPORT_SYMBOL(saved_command_line);
+diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
+index 69912d2f8b54..4f2384a4286a 100644
+--- a/arch/sparc/lib/Makefile
++++ b/arch/sparc/lib/Makefile
+@@ -43,4 +43,5 @@ lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o
+ 
+ obj-$(CONFIG_SPARC64) += iomap.o
+ obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o
++obj-y                 += ksyms.o
+ obj-$(CONFIG_SPARC64) += PeeCeeI.o
+diff --git a/arch/sparc/lib/U1memcpy.S b/arch/sparc/lib/U1memcpy.S
+index 4f0d50b33a72..f30d2ab2c371 100644
+--- a/arch/sparc/lib/U1memcpy.S
++++ b/arch/sparc/lib/U1memcpy.S
+@@ -8,7 +8,6 @@
+ #include <linux/linkage.h>
+ #include <asm/visasm.h>
+ #include <asm/asi.h>
+-#include <asm/export.h>
+ #define GLOBAL_SPARE	g7
+ #else
+ #define GLOBAL_SPARE	g5
+@@ -681,4 +680,3 @@ FUNC_NAME:		/* %o0=dst, %o1=src, %o2=len */
+ 	 mov		EX_RETVAL(%o4), %o0
+ 
+ 	.size		FUNC_NAME, .-FUNC_NAME
+-EXPORT_SYMBOL(FUNC_NAME)
+diff --git a/arch/sparc/lib/VISsave.S b/arch/sparc/lib/VISsave.S
+index 1c7b6a39b942..62c2647bd5ce 100644
+--- a/arch/sparc/lib/VISsave.S
++++ b/arch/sparc/lib/VISsave.S
+@@ -13,7 +13,6 @@
+ #include <asm/ptrace.h>
+ #include <asm/visasm.h>
+ #include <asm/thread_info.h>
+-#include <asm/export.h>
+ 
+ 	/* On entry: %o5=current FPRS value, %g7 is callers address */
+ 	/* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */
+@@ -80,4 +79,3 @@ vis1:	ldub		[%g6 + TI_FPSAVED], %g3
+ 80:	jmpl		%g7 + %g0, %g0
+ 	 nop
+ ENDPROC(VISenter)
+-EXPORT_SYMBOL(VISenter)
+diff --git a/arch/sparc/lib/ashldi3.S b/arch/sparc/lib/ashldi3.S
+index c8b1cf71bc73..86f60de07b0a 100644
+--- a/arch/sparc/lib/ashldi3.S
++++ b/arch/sparc/lib/ashldi3.S
+@@ -6,7 +6,6 @@
+  */
+ 
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(__ashldi3)
+@@ -34,4 +33,3 @@ ENTRY(__ashldi3)
+ 	retl
+ 	 nop
+ ENDPROC(__ashldi3)
+-EXPORT_SYMBOL(__ashldi3)
+diff --git a/arch/sparc/lib/ashrdi3.S b/arch/sparc/lib/ashrdi3.S
+index 4310256e7964..6eb8ba2dd50e 100644
+--- a/arch/sparc/lib/ashrdi3.S
++++ b/arch/sparc/lib/ashrdi3.S
+@@ -6,7 +6,6 @@
+  */
+ 
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(__ashrdi3)
+@@ -36,4 +35,3 @@ ENTRY(__ashrdi3)
+ 	jmpl	%o7 + 8, %g0
+ 	 nop
+ ENDPROC(__ashrdi3)
+-EXPORT_SYMBOL(__ashrdi3)
+diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S
+index 1c6a1bde5138..a5c5a0279ccc 100644
+--- a/arch/sparc/lib/atomic_64.S
++++ b/arch/sparc/lib/atomic_64.S
+@@ -6,7 +6,6 @@
+ #include <linux/linkage.h>
+ #include <asm/asi.h>
+ #include <asm/backoff.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ 
+@@ -30,7 +29,6 @@ ENTRY(atomic_##op) /* %o0 = increment, %o1 = atomic_ptr */		\
+ 	 nop;								\
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b);					\
+ ENDPROC(atomic_##op);							\
+-EXPORT_SYMBOL(atomic_##op);
+ 
+ #define ATOMIC_OP_RETURN(op)						\
+ ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */	\
+@@ -44,8 +42,7 @@ ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */	\
+ 	retl;								\
+ 	 sra	%g1, 0, %o0;						\
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b);					\
+-ENDPROC(atomic_##op##_return);						\
+-EXPORT_SYMBOL(atomic_##op##_return);
++ENDPROC(atomic_##op##_return);
+ 
+ #define ATOMIC_FETCH_OP(op)						\
+ ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */	\
+@@ -59,8 +56,7 @@ ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */	\
+ 	retl;								\
+ 	 sra	%g1, 0, %o0;						\
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b);					\
+-ENDPROC(atomic_fetch_##op);						\
+-EXPORT_SYMBOL(atomic_fetch_##op);
++ENDPROC(atomic_fetch_##op);
+ 
+ #define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
+ 
+@@ -92,7 +88,6 @@ ENTRY(atomic64_##op) /* %o0 = increment, %o1 = atomic_ptr */		\
+ 	 nop;								\
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b);					\
+ ENDPROC(atomic64_##op);							\
+-EXPORT_SYMBOL(atomic64_##op);
+ 
+ #define ATOMIC64_OP_RETURN(op)						\
+ ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */	\
+@@ -106,8 +101,7 @@ ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */	\
+ 	retl;								\
+ 	 op	%g1, %o0, %o0;						\
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b);					\
+-ENDPROC(atomic64_##op##_return);					\
+-EXPORT_SYMBOL(atomic64_##op##_return);
++ENDPROC(atomic64_##op##_return);
+ 
+ #define ATOMIC64_FETCH_OP(op)						\
+ ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */	\
+@@ -121,8 +115,7 @@ ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */	\
+ 	retl;								\
+ 	 mov	%g1, %o0;						\
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b);					\
+-ENDPROC(atomic64_fetch_##op);						\
+-EXPORT_SYMBOL(atomic64_fetch_##op);
++ENDPROC(atomic64_fetch_##op);
+ 
+ #define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
+ 
+@@ -154,4 +147,3 @@ ENTRY(atomic64_dec_if_positive) /* %o0 = atomic_ptr */
+ 	 sub	%g1, 1, %o0
+ 2:	BACKOFF_SPIN(%o2, %o3, 1b)
+ ENDPROC(atomic64_dec_if_positive)
+-EXPORT_SYMBOL(atomic64_dec_if_positive)
+diff --git a/arch/sparc/lib/bitops.S b/arch/sparc/lib/bitops.S
+index 7031bf1587cb..36f72cc0e67e 100644
+--- a/arch/sparc/lib/bitops.S
++++ b/arch/sparc/lib/bitops.S
+@@ -6,7 +6,6 @@
+ #include <linux/linkage.h>
+ #include <asm/asi.h>
+ #include <asm/backoff.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ 
+@@ -30,7 +29,6 @@ ENTRY(test_and_set_bit)	/* %o0=nr, %o1=addr */
+ 	 nop
+ 2:	BACKOFF_SPIN(%o3, %o4, 1b)
+ ENDPROC(test_and_set_bit)
+-EXPORT_SYMBOL(test_and_set_bit)
+ 
+ ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
+ 	BACKOFF_SETUP(%o3)
+@@ -52,7 +50,6 @@ ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
+ 	 nop
+ 2:	BACKOFF_SPIN(%o3, %o4, 1b)
+ ENDPROC(test_and_clear_bit)
+-EXPORT_SYMBOL(test_and_clear_bit)
+ 
+ ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
+ 	BACKOFF_SETUP(%o3)
+@@ -74,7 +71,6 @@ ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
+ 	 nop
+ 2:	BACKOFF_SPIN(%o3, %o4, 1b)
+ ENDPROC(test_and_change_bit)
+-EXPORT_SYMBOL(test_and_change_bit)
+ 
+ ENTRY(set_bit) /* %o0=nr, %o1=addr */
+ 	BACKOFF_SETUP(%o3)
+@@ -94,7 +90,6 @@ ENTRY(set_bit) /* %o0=nr, %o1=addr */
+ 	 nop
+ 2:	BACKOFF_SPIN(%o3, %o4, 1b)
+ ENDPROC(set_bit)
+-EXPORT_SYMBOL(set_bit)
+ 
+ ENTRY(clear_bit) /* %o0=nr, %o1=addr */
+ 	BACKOFF_SETUP(%o3)
+@@ -114,7 +109,6 @@ ENTRY(clear_bit) /* %o0=nr, %o1=addr */
+ 	 nop
+ 2:	BACKOFF_SPIN(%o3, %o4, 1b)
+ ENDPROC(clear_bit)
+-EXPORT_SYMBOL(clear_bit)
+ 
+ ENTRY(change_bit) /* %o0=nr, %o1=addr */
+ 	BACKOFF_SETUP(%o3)
+@@ -134,4 +128,3 @@ ENTRY(change_bit) /* %o0=nr, %o1=addr */
+ 	 nop
+ 2:	BACKOFF_SPIN(%o3, %o4, 1b)
+ ENDPROC(change_bit)
+-EXPORT_SYMBOL(change_bit)
+diff --git a/arch/sparc/lib/blockops.S b/arch/sparc/lib/blockops.S
+index 1f2692d59d18..3c771011ff4b 100644
+--- a/arch/sparc/lib/blockops.S
++++ b/arch/sparc/lib/blockops.S
+@@ -6,7 +6,6 @@
+ 
+ #include <linux/linkage.h>
+ #include <asm/page.h>
+-#include <asm/export.h>
+ 
+ 	/* Zero out 64 bytes of memory at (buf + offset).
+ 	 * Assumes %g1 contains zero.
+@@ -65,7 +64,6 @@ ENTRY(bzero_1page)
+ 	retl
+ 	 nop
+ ENDPROC(bzero_1page)
+-EXPORT_SYMBOL(bzero_1page)
+ 
+ ENTRY(__copy_1page)
+ /* NOTE: If you change the number of insns of this routine, please check
+@@ -89,4 +87,3 @@ ENTRY(__copy_1page)
+ 	retl
+ 	 nop
+ ENDPROC(__copy_1page)
+-EXPORT_SYMBOL(__copy_1page)
+diff --git a/arch/sparc/lib/bzero.S b/arch/sparc/lib/bzero.S
+index 3bb1914c4fa4..8c058114b649 100644
+--- a/arch/sparc/lib/bzero.S
++++ b/arch/sparc/lib/bzero.S
+@@ -5,7 +5,6 @@
+  */
+ 
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ 
+@@ -79,8 +78,6 @@ __bzero_done:
+ 	 mov		%o3, %o0
+ ENDPROC(__bzero)
+ ENDPROC(memset)
+-EXPORT_SYMBOL(__bzero)
+-EXPORT_SYMBOL(memset)
+ 
+ #define EX_ST(x,y)		\
+ 98:	x,y;			\
+@@ -146,4 +143,3 @@ __clear_user_done:
+ 	retl
+ 	 clr		%o0
+ ENDPROC(__clear_user)
+-EXPORT_SYMBOL(__clear_user)
+diff --git a/arch/sparc/lib/checksum_32.S b/arch/sparc/lib/checksum_32.S
+index c9d8b6232111..0084c3361e15 100644
+--- a/arch/sparc/lib/checksum_32.S
++++ b/arch/sparc/lib/checksum_32.S
+@@ -14,7 +14,6 @@
+  */
+ 
+ #include <asm/errno.h>
+-#include <asm/export.h>
+ 
+ #define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5)	\
+ 	ldd	[buf + offset + 0x00], t0;			\
+@@ -105,7 +104,6 @@ csum_partial_fix_alignment:
+ 	 * buffer of size 0x20.  Follow the code path for that case.
+ 	 */
+ 	.globl	csum_partial
+-	EXPORT_SYMBOL(csum_partial)
+ csum_partial:			/* %o0=buf, %o1=len, %o2=sum */
+ 	andcc	%o0, 0x7, %g0				! alignment problems?
+ 	bne	csum_partial_fix_alignment		! yep, handle it
+@@ -337,7 +335,6 @@ cc_dword_align:
+ 	 */
+ 	.align	8
+ 	.globl	__csum_partial_copy_sparc_generic
+-	EXPORT_SYMBOL(__csum_partial_copy_sparc_generic)
+ __csum_partial_copy_sparc_generic:
+ 					/* %o0=src, %o1=dest, %g1=len, %g7=sum */
+ 	xor	%o0, %o1, %o4		! get changing bits
+diff --git a/arch/sparc/lib/checksum_64.S b/arch/sparc/lib/checksum_64.S
+index f6732174fe6b..1d230f693dc4 100644
+--- a/arch/sparc/lib/checksum_64.S
++++ b/arch/sparc/lib/checksum_64.S
+@@ -13,7 +13,6 @@
+  *	BSD4.4 portable checksum routine
+  */
+ 
+-#include <asm/export.h>
+ 	.text
+ 
+ csum_partial_fix_alignment:
+@@ -38,7 +37,6 @@ csum_partial_fix_alignment:
+ 
+ 	.align		32
+ 	.globl		csum_partial
+-	EXPORT_SYMBOL(csum_partial)
+ csum_partial:		/* %o0=buff, %o1=len, %o2=sum */
+ 	prefetch	[%o0 + 0x000], #n_reads
+ 	clr		%o4
+diff --git a/arch/sparc/lib/clear_page.S b/arch/sparc/lib/clear_page.S
+index f30d6b78afbd..46272dfc26e8 100644
+--- a/arch/sparc/lib/clear_page.S
++++ b/arch/sparc/lib/clear_page.S
+@@ -10,7 +10,6 @@
+ #include <asm/pgtable.h>
+ #include <asm/spitfire.h>
+ #include <asm/head.h>
+-#include <asm/export.h>
+ 
+ 	/* What we used to do was lock a TLB entry into a specific
+ 	 * TLB slot, clear the page with interrupts disabled, then
+@@ -27,7 +26,6 @@
+ 	.text
+ 
+ 	.globl		_clear_page
+-	EXPORT_SYMBOL(_clear_page)
+ _clear_page:		/* %o0=dest */
+ 	ba,pt		%xcc, clear_page_common
+ 	 clr		%o4
+@@ -37,7 +35,6 @@ _clear_page:		/* %o0=dest */
+ 	 */
+ 	.align		32
+ 	.globl		clear_user_page
+-	EXPORT_SYMBOL(clear_user_page)
+ clear_user_page:	/* %o0=dest, %o1=vaddr */
+ 	lduw		[%g6 + TI_PRE_COUNT], %o2
+ 	sethi		%hi(PAGE_OFFSET), %g2
+diff --git a/arch/sparc/lib/copy_in_user.S b/arch/sparc/lib/copy_in_user.S
+index 0252b218de45..4c89b486fa0d 100644
+--- a/arch/sparc/lib/copy_in_user.S
++++ b/arch/sparc/lib/copy_in_user.S
+@@ -5,7 +5,6 @@
+ 
+ #include <linux/linkage.h>
+ #include <asm/asi.h>
+-#include <asm/export.h>
+ 
+ #define XCC xcc
+ 
+@@ -106,4 +105,3 @@ ENTRY(___copy_in_user)	/* %o0=dst, %o1=src, %o2=len */
+ 	retl
+ 	 clr		%o0
+ ENDPROC(___copy_in_user)
+-EXPORT_SYMBOL(___copy_in_user)
+diff --git a/arch/sparc/lib/copy_page.S b/arch/sparc/lib/copy_page.S
+index 7197b7250895..dd16c61f3263 100644
+--- a/arch/sparc/lib/copy_page.S
++++ b/arch/sparc/lib/copy_page.S
+@@ -10,7 +10,6 @@
+ #include <asm/pgtable.h>
+ #include <asm/spitfire.h>
+ #include <asm/head.h>
+-#include <asm/export.h>
+ 
+ 	/* What we used to do was lock a TLB entry into a specific
+ 	 * TLB slot, clear the page with interrupts disabled, then
+@@ -45,7 +44,6 @@
+ 	.align		32
+ 	.globl		copy_user_page
+ 	.type		copy_user_page,#function
+-	EXPORT_SYMBOL(copy_user_page)
+ copy_user_page:		/* %o0=dest, %o1=src, %o2=vaddr */
+ 	lduw		[%g6 + TI_PRE_COUNT], %o4
+ 	sethi		%hi(PAGE_OFFSET), %g2
+diff --git a/arch/sparc/lib/copy_user.S b/arch/sparc/lib/copy_user.S
+index cea644dc67a6..ef095b6c43b1 100644
+--- a/arch/sparc/lib/copy_user.S
++++ b/arch/sparc/lib/copy_user.S
+@@ -15,7 +15,6 @@
+ #include <asm/asmmacro.h>
+ #include <asm/page.h>
+ #include <asm/thread_info.h>
+-#include <asm/export.h>
+ 
+ /* Work around cpp -rob */
+ #define ALLOC #alloc
+@@ -120,7 +119,6 @@
+ __copy_user_begin:
+ 
+ 	.globl	__copy_user
+-	EXPORT_SYMBOL(__copy_user)
+ dword_align:
+ 	andcc	%o1, 1, %g0
+ 	be	4f
+diff --git a/arch/sparc/lib/csum_copy.S b/arch/sparc/lib/csum_copy.S
+index 0ecbafc30fd0..e566c770a0f6 100644
+--- a/arch/sparc/lib/csum_copy.S
++++ b/arch/sparc/lib/csum_copy.S
+@@ -3,8 +3,6 @@
+  * Copyright (C) 2005 David S. Miller <davem at davemloft.net>
+  */
+ 
+-#include <asm/export.h>
+-
+ #ifdef __KERNEL__
+ #define GLOBAL_SPARE	%g7
+ #else
+@@ -65,7 +63,6 @@
+ 	 add		%o5, %o4, %o4
+ 
+ 	.globl		FUNC_NAME
+-	EXPORT_SYMBOL(FUNC_NAME)
+ FUNC_NAME:		/* %o0=src, %o1=dst, %o2=len, %o3=sum */
+ 	LOAD(prefetch, %o0 + 0x000, #n_reads)
+ 	xor		%o0, %o1, %g1
+diff --git a/arch/sparc/lib/divdi3.S b/arch/sparc/lib/divdi3.S
+index a2b5a976be33..9614b48b6ef8 100644
+--- a/arch/sparc/lib/divdi3.S
++++ b/arch/sparc/lib/divdi3.S
+@@ -17,7 +17,6 @@ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+-#include <asm/export.h>
+ 	.text
+ 	.align 4
+ 	.globl __divdi3
+@@ -280,4 +279,3 @@ __divdi3:
+ .LL81:
+ 	ret
+ 	restore
+-EXPORT_SYMBOL(__divdi3)
+diff --git a/arch/sparc/lib/ffs.S b/arch/sparc/lib/ffs.S
+index 23aab144d28e..b39389f69899 100644
+--- a/arch/sparc/lib/ffs.S
++++ b/arch/sparc/lib/ffs.S
+@@ -1,5 +1,4 @@
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.register	%g2,#scratch
+ 
+@@ -66,8 +65,6 @@ ENTRY(__ffs)
+ 	 add	%o2, %g1, %o0
+ ENDPROC(ffs)
+ ENDPROC(__ffs)
+-EXPORT_SYMBOL(__ffs)
+-EXPORT_SYMBOL(ffs)
+ 
+ 	.section	.popc_6insn_patch, "ax"
+ 	.word		ffs
+diff --git a/arch/sparc/lib/hweight.S b/arch/sparc/lib/hweight.S
+index f9985f129fb6..95414e0a6808 100644
+--- a/arch/sparc/lib/hweight.S
++++ b/arch/sparc/lib/hweight.S
+@@ -1,5 +1,4 @@
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ 	.align	32
+@@ -8,7 +7,6 @@ ENTRY(__arch_hweight8)
+ 	 nop
+ 	nop
+ ENDPROC(__arch_hweight8)
+-EXPORT_SYMBOL(__arch_hweight8)
+ 	.section	.popc_3insn_patch, "ax"
+ 	.word		__arch_hweight8
+ 	sllx		%o0, 64-8, %g1
+@@ -21,7 +19,6 @@ ENTRY(__arch_hweight16)
+ 	 nop
+ 	nop
+ ENDPROC(__arch_hweight16)
+-EXPORT_SYMBOL(__arch_hweight16)
+ 	.section	.popc_3insn_patch, "ax"
+ 	.word		__arch_hweight16
+ 	sllx		%o0, 64-16, %g1
+@@ -34,7 +31,6 @@ ENTRY(__arch_hweight32)
+ 	 nop
+ 	nop
+ ENDPROC(__arch_hweight32)
+-EXPORT_SYMBOL(__arch_hweight32)
+ 	.section	.popc_3insn_patch, "ax"
+ 	.word		__arch_hweight32
+ 	sllx		%o0, 64-32, %g1
+@@ -47,7 +43,6 @@ ENTRY(__arch_hweight64)
+ 	 nop
+ 	nop
+ ENDPROC(__arch_hweight64)
+-EXPORT_SYMBOL(__arch_hweight64)
+ 	.section	.popc_3insn_patch, "ax"
+ 	.word		__arch_hweight64
+ 	retl
+diff --git a/arch/sparc/lib/ipcsum.S b/arch/sparc/lib/ipcsum.S
+index 5d61648b53dd..4742d59029ee 100644
+--- a/arch/sparc/lib/ipcsum.S
++++ b/arch/sparc/lib/ipcsum.S
+@@ -1,5 +1,4 @@
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
+@@ -32,4 +31,3 @@ ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
+ 	retl
+ 	 and	%o2, %o1, %o0
+ ENDPROC(ip_fast_csum)
+-EXPORT_SYMBOL(ip_fast_csum)
+diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
+new file mode 100644
+index 000000000000..a7e55c67a43e
+--- /dev/null
++++ b/arch/sparc/lib/ksyms.c
+@@ -0,0 +1,173 @@
++/*
++ * Export of symbols defined in assembler
++ */
++
++/* Tell string.h we don't want memcpy etc. as cpp defines */
++#define EXPORT_SYMTAB_STROPS
++
++#include <linux/module.h>
++#include <linux/string.h>
++#include <linux/types.h>
++
++#include <asm/checksum.h>
++#include <asm/uaccess.h>
++#include <asm/ftrace.h>
++
++/* string functions */
++EXPORT_SYMBOL(strlen);
++EXPORT_SYMBOL(strncmp);
++
++/* mem* functions */
++extern void *__memscan_zero(void *, size_t);
++extern void *__memscan_generic(void *, int, size_t);
++extern void *__bzero(void *, size_t);
++
++EXPORT_SYMBOL(memscan);
++EXPORT_SYMBOL(__memscan_zero);
++EXPORT_SYMBOL(__memscan_generic);
++EXPORT_SYMBOL(memcmp);
++EXPORT_SYMBOL(memcpy);
++EXPORT_SYMBOL(memset);
++EXPORT_SYMBOL(memmove);
++EXPORT_SYMBOL(__bzero);
++
++/* Networking helper routines. */
++EXPORT_SYMBOL(csum_partial);
++
++#ifdef CONFIG_MCOUNT
++EXPORT_SYMBOL(_mcount);
++#endif
++
++/*
++ * sparc
++ */
++#ifdef CONFIG_SPARC32
++extern int __ashrdi3(int, int);
++extern int __ashldi3(int, int);
++extern int __lshrdi3(int, int);
++extern int __muldi3(int, int);
++extern int __divdi3(int, int);
++
++extern void (*__copy_1page)(void *, const void *);
++extern void (*bzero_1page)(void *);
++
++extern void ___rw_read_enter(void);
++extern void ___rw_read_try(void);
++extern void ___rw_read_exit(void);
++extern void ___rw_write_enter(void);
++
++/* Networking helper routines. */
++EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
++
++/* Special internal versions of library functions. */
++EXPORT_SYMBOL(__copy_1page);
++EXPORT_SYMBOL(bzero_1page);
++
++/* Moving data to/from/in userspace. */
++EXPORT_SYMBOL(__copy_user);
++
++/* Used by asm/spinlock.h */
++#ifdef CONFIG_SMP
++EXPORT_SYMBOL(___rw_read_enter);
++EXPORT_SYMBOL(___rw_read_try);
++EXPORT_SYMBOL(___rw_read_exit);
++EXPORT_SYMBOL(___rw_write_enter);
++#endif
++
++EXPORT_SYMBOL(__ashrdi3);
++EXPORT_SYMBOL(__ashldi3);
++EXPORT_SYMBOL(__lshrdi3);
++EXPORT_SYMBOL(__muldi3);
++EXPORT_SYMBOL(__divdi3);
++#endif
++
++/*
++ * sparc64
++ */
++#ifdef CONFIG_SPARC64
++/* Networking helper routines. */
++EXPORT_SYMBOL(csum_partial_copy_nocheck);
++EXPORT_SYMBOL(__csum_partial_copy_from_user);
++EXPORT_SYMBOL(__csum_partial_copy_to_user);
++EXPORT_SYMBOL(ip_fast_csum);
++
++/* Moving data to/from/in userspace. */
++EXPORT_SYMBOL(___copy_to_user);
++EXPORT_SYMBOL(___copy_from_user);
++EXPORT_SYMBOL(___copy_in_user);
++EXPORT_SYMBOL(__clear_user);
++
++/* Atomic counter implementation. */
++#define ATOMIC_OP(op)							\
++EXPORT_SYMBOL(atomic_##op);						\
++EXPORT_SYMBOL(atomic64_##op);
++
++#define ATOMIC_OP_RETURN(op)						\
++EXPORT_SYMBOL(atomic_##op##_return);					\
++EXPORT_SYMBOL(atomic64_##op##_return);
++
++#define ATOMIC_FETCH_OP(op)						\
++EXPORT_SYMBOL(atomic_fetch_##op);					\
++EXPORT_SYMBOL(atomic64_fetch_##op);
++
++#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
++
++ATOMIC_OPS(add)
++ATOMIC_OPS(sub)
++
++#undef ATOMIC_OPS
++#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
++
++ATOMIC_OPS(and)
++ATOMIC_OPS(or)
++ATOMIC_OPS(xor)
++
++#undef ATOMIC_OPS
++#undef ATOMIC_FETCH_OP
++#undef ATOMIC_OP_RETURN
++#undef ATOMIC_OP
++
++EXPORT_SYMBOL(atomic64_dec_if_positive);
++
++/* Atomic bit operations. */
++EXPORT_SYMBOL(test_and_set_bit);
++EXPORT_SYMBOL(test_and_clear_bit);
++EXPORT_SYMBOL(test_and_change_bit);
++EXPORT_SYMBOL(set_bit);
++EXPORT_SYMBOL(clear_bit);
++EXPORT_SYMBOL(change_bit);
++
++/* Special internal versions of library functions. */
++EXPORT_SYMBOL(_clear_page);
++EXPORT_SYMBOL(clear_user_page);
++EXPORT_SYMBOL(copy_user_page);
++
++/* RAID code needs this */
++void VISenter(void);
++EXPORT_SYMBOL(VISenter);
++
++extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
++extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
++		unsigned long *);
++extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
++		unsigned long *, unsigned long *);
++extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
++		unsigned long *, unsigned long *, unsigned long *);
++EXPORT_SYMBOL(xor_vis_2);
++EXPORT_SYMBOL(xor_vis_3);
++EXPORT_SYMBOL(xor_vis_4);
++EXPORT_SYMBOL(xor_vis_5);
++
++extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
++extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
++		unsigned long *);
++extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
++		unsigned long *, unsigned long *);
++extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
++		unsigned long *, unsigned long *, unsigned long *);
++
++EXPORT_SYMBOL(xor_niagara_2);
++EXPORT_SYMBOL(xor_niagara_3);
++EXPORT_SYMBOL(xor_niagara_4);
++EXPORT_SYMBOL(xor_niagara_5);
++#endif
+diff --git a/arch/sparc/lib/locks.S b/arch/sparc/lib/locks.S
+index f38c4e59d078..64f53f2b673d 100644
+--- a/arch/sparc/lib/locks.S
++++ b/arch/sparc/lib/locks.S
+@@ -10,7 +10,6 @@
+ #include <asm/psr.h>
+ #include <asm/smp.h>
+ #include <asm/spinlock.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ 	.align	4
+@@ -49,7 +48,6 @@ ___rw_write_enter_spin_on_wlock:
+ 	 ld	[%g1], %g2
+ 
+ 	.globl	___rw_read_enter
+-EXPORT_SYMBOL(___rw_read_enter)
+ ___rw_read_enter:
+ 	orcc	%g2, 0x0, %g0
+ 	bne,a	___rw_read_enter_spin_on_wlock
+@@ -61,7 +59,6 @@ ___rw_read_enter:
+ 	 mov	%g4, %o7
+ 
+ 	.globl	___rw_read_exit
+-EXPORT_SYMBOL(___rw_read_exit)
+ ___rw_read_exit:
+ 	orcc	%g2, 0x0, %g0
+ 	bne,a	___rw_read_exit_spin_on_wlock
+@@ -73,7 +70,6 @@ ___rw_read_exit:
+ 	 mov	%g4, %o7
+ 
+ 	.globl	___rw_read_try
+-EXPORT_SYMBOL(___rw_read_try)
+ ___rw_read_try:
+ 	orcc	%g2, 0x0, %g0
+ 	bne	___rw_read_try_spin_on_wlock
+@@ -85,7 +81,6 @@ ___rw_read_try:
+ 	 mov	%g4, %o7
+ 
+ 	.globl	___rw_write_enter
+-EXPORT_SYMBOL(___rw_write_enter)
+ ___rw_write_enter:
+ 	orcc	%g2, 0x0, %g0
+ 	bne	___rw_write_enter_spin_on_wlock
+diff --git a/arch/sparc/lib/lshrdi3.S b/arch/sparc/lib/lshrdi3.S
+index c9b9373f8d81..60ebc7cdbee0 100644
+--- a/arch/sparc/lib/lshrdi3.S
++++ b/arch/sparc/lib/lshrdi3.S
+@@ -1,5 +1,4 @@
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ ENTRY(__lshrdi3)
+ 	cmp	%o2, 0
+@@ -26,4 +25,3 @@ ENTRY(__lshrdi3)
+ 	retl 
+ 	 nop 
+ ENDPROC(__lshrdi3)
+-EXPORT_SYMBOL(__lshrdi3)
+diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S
+index 194f383611c0..0b0ed4d34219 100644
+--- a/arch/sparc/lib/mcount.S
++++ b/arch/sparc/lib/mcount.S
+@@ -6,7 +6,6 @@
+  */
+ 
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ /*
+  * This is the main variant and is called by C code.  GCC's -pg option
+@@ -17,7 +16,6 @@
+ 	.align		32
+ 	.globl		_mcount
+ 	.type		_mcount,#function
+-	EXPORT_SYMBOL(_mcount)
+ 	.globl		mcount
+ 	.type		mcount,#function
+ _mcount:
+diff --git a/arch/sparc/lib/memcmp.S b/arch/sparc/lib/memcmp.S
+index cee7f30dbb61..efa106c41ed0 100644
+--- a/arch/sparc/lib/memcmp.S
++++ b/arch/sparc/lib/memcmp.S
+@@ -6,7 +6,6 @@
+ 
+ #include <linux/linkage.h>
+ #include <asm/asm.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(memcmp)
+@@ -26,4 +25,3 @@ ENTRY(memcmp)
+ 2:	retl
+ 	 mov	0, %o0
+ ENDPROC(memcmp)
+-EXPORT_SYMBOL(memcmp)
+diff --git a/arch/sparc/lib/memcpy.S b/arch/sparc/lib/memcpy.S
+index 8913feaa7ac7..b2e64a898fc5 100644
+--- a/arch/sparc/lib/memcpy.S
++++ b/arch/sparc/lib/memcpy.S
+@@ -7,7 +7,6 @@
+  * Copyright (C) 1996 Jakub Jelinek (jj at sunsite.mff.cuni.cz)
+  */
+ 
+-#include <asm/export.h>
+ #define FUNC(x) 		\
+ 	.globl	x;		\
+ 	.type	x, at function;	\
+@@ -63,7 +62,6 @@ x:
+ 	.align	4
+ 
+ FUNC(memmove)
+-EXPORT_SYMBOL(memmove)
+ 	cmp		%o0, %o1
+ 	mov		%o0, %g7
+ 	bleu		9f
+@@ -121,7 +119,6 @@ EXPORT_SYMBOL(memmove)
+ 	 add		%o0, 2, %o0
+ 
+ FUNC(memcpy)	/* %o0=dst %o1=src %o2=len */
+-EXPORT_SYMBOL(memcpy)
+ 
+ 	sub		%o0, %o1, %o4
+ 	mov		%o0, %g7
+diff --git a/arch/sparc/lib/memmove.S b/arch/sparc/lib/memmove.S
+index 012cdb6ca467..857ad4f8905f 100644
+--- a/arch/sparc/lib/memmove.S
++++ b/arch/sparc/lib/memmove.S
+@@ -5,7 +5,6 @@
+  */
+ 
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(memmove) /* o0=dst o1=src o2=len */
+@@ -58,4 +57,3 @@ ENTRY(memmove) /* o0=dst o1=src o2=len */
+ 	 stb		%g7, [%o0 - 0x1]
+ 	ba,a,pt		%xcc, 99b
+ ENDPROC(memmove)
+-EXPORT_SYMBOL(memmove)
+diff --git a/arch/sparc/lib/memscan_32.S b/arch/sparc/lib/memscan_32.S
+index 51ce690c42a8..4ff1657dfc24 100644
+--- a/arch/sparc/lib/memscan_32.S
++++ b/arch/sparc/lib/memscan_32.S
+@@ -4,8 +4,6 @@
+  * Copyright (C) 1996 David S. Miller (davem at caip.rutgers.edu)
+  */
+ 
+-#include <asm/export.h>
+-
+ /* In essence, this is just a fancy strlen. */
+ 
+ #define LO_MAGIC 0x01010101
+@@ -15,8 +13,6 @@
+ 	.align	4
+ 	.globl	__memscan_zero, __memscan_generic
+ 	.globl	memscan
+-EXPORT_SYMBOL(__memscan_zero)
+-EXPORT_SYMBOL(__memscan_generic)
+ __memscan_zero:
+ 	/* %o0 = addr, %o1 = size */
+ 	cmp	%o1, 0
+diff --git a/arch/sparc/lib/memscan_64.S b/arch/sparc/lib/memscan_64.S
+index daa96f4b03e6..5686dfa5dc15 100644
+--- a/arch/sparc/lib/memscan_64.S
++++ b/arch/sparc/lib/memscan_64.S
+@@ -5,8 +5,6 @@
+  * Copyright (C) 1998 David S. Miller (davem at redhat.com)
+  */
+ 
+-	#include <asm/export.h>
+-
+ #define HI_MAGIC	0x8080808080808080
+ #define LO_MAGIC	0x0101010101010101
+ #define ASI_PL		0x88
+@@ -15,8 +13,6 @@
+ 	.align	32
+ 	.globl		__memscan_zero, __memscan_generic
+ 	.globl		memscan
+-	EXPORT_SYMBOL(__memscan_zero)
+-	EXPORT_SYMBOL(__memscan_generic)
+ 
+ __memscan_zero:
+ 	/* %o0 = bufp, %o1 = size */
+diff --git a/arch/sparc/lib/memset.S b/arch/sparc/lib/memset.S
+index bb539b42b088..f75e6906df14 100644
+--- a/arch/sparc/lib/memset.S
++++ b/arch/sparc/lib/memset.S
+@@ -9,7 +9,6 @@
+  */
+ 
+ #include <asm/ptrace.h>
+-#include <asm/export.h>
+ 
+ /* Work around cpp -rob */
+ #define ALLOC #alloc
+@@ -64,8 +63,6 @@ __bzero_begin:
+ 
+ 	.globl	__bzero
+ 	.globl	memset
+-	EXPORT_SYMBOL(__bzero)
+-	EXPORT_SYMBOL(memset)
+ 	.globl	__memset_start, __memset_end
+ __memset_start:
+ memset:
+diff --git a/arch/sparc/lib/muldi3.S b/arch/sparc/lib/muldi3.S
+index 17a0f49aef3c..9794939d1c12 100644
+--- a/arch/sparc/lib/muldi3.S
++++ b/arch/sparc/lib/muldi3.S
+@@ -17,7 +17,6 @@ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+-#include <asm/export.h>
+ 	.text
+ 	.align 4
+ 	.globl __muldi3
+@@ -75,4 +74,3 @@ __muldi3:
+ 	add  %l2, %l0, %i0
+ 	ret 
+ 	restore  %g0, %l3, %o1
+-EXPORT_SYMBOL(__muldi3)
+diff --git a/arch/sparc/lib/strlen.S b/arch/sparc/lib/strlen.S
+index ca0e7077e871..536f83507fbf 100644
+--- a/arch/sparc/lib/strlen.S
++++ b/arch/sparc/lib/strlen.S
+@@ -7,7 +7,6 @@
+ 
+ #include <linux/linkage.h>
+ #include <asm/asm.h>
+-#include <asm/export.h>
+ 
+ #define LO_MAGIC 0x01010101
+ #define HI_MAGIC 0x80808080
+@@ -79,4 +78,3 @@ ENTRY(strlen)
+ 	retl
+ 	 mov	2, %o0
+ ENDPROC(strlen)
+-EXPORT_SYMBOL(strlen)
+diff --git a/arch/sparc/lib/strncmp_32.S b/arch/sparc/lib/strncmp_32.S
+index e3fe014813af..c0d1b568c1c5 100644
+--- a/arch/sparc/lib/strncmp_32.S
++++ b/arch/sparc/lib/strncmp_32.S
+@@ -4,7 +4,6 @@
+  */
+ 
+ #include <linux/linkage.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(strncmp)
+@@ -117,4 +116,3 @@ ENTRY(strncmp)
+ 	retl
+ 	 sub	%o3, %o0, %o0
+ ENDPROC(strncmp)
+-EXPORT_SYMBOL(strncmp)
+diff --git a/arch/sparc/lib/strncmp_64.S b/arch/sparc/lib/strncmp_64.S
+index efb5f884330d..0656627166f3 100644
+--- a/arch/sparc/lib/strncmp_64.S
++++ b/arch/sparc/lib/strncmp_64.S
+@@ -6,7 +6,6 @@
+ 
+ #include <linux/linkage.h>
+ #include <asm/asi.h>
+-#include <asm/export.h>
+ 
+ 	.text
+ ENTRY(strncmp)
+@@ -29,4 +28,3 @@ ENTRY(strncmp)
+ 	retl
+ 	 clr	%o0
+ ENDPROC(strncmp)
+-EXPORT_SYMBOL(strncmp)
+diff --git a/arch/sparc/lib/xor.S b/arch/sparc/lib/xor.S
+index 45a49cb618b5..2c05641c3263 100644
+--- a/arch/sparc/lib/xor.S
++++ b/arch/sparc/lib/xor.S
+@@ -13,7 +13,6 @@
+ #include <asm/asi.h>
+ #include <asm/dcu.h>
+ #include <asm/spitfire.h>
+-#include <asm/export.h>
+ 
+ /*
+  *	Requirements:
+@@ -91,7 +90,6 @@ ENTRY(xor_vis_2)
+ 	retl
+ 	  wr	%g0, 0, %fprs
+ ENDPROC(xor_vis_2)
+-EXPORT_SYMBOL(xor_vis_2)
+ 
+ ENTRY(xor_vis_3)
+ 	rd	%fprs, %o5
+@@ -158,7 +156,6 @@ ENTRY(xor_vis_3)
+ 	retl
+ 	 wr	%g0, 0, %fprs
+ ENDPROC(xor_vis_3)
+-EXPORT_SYMBOL(xor_vis_3)
+ 
+ ENTRY(xor_vis_4)
+ 	rd	%fprs, %o5
+@@ -244,7 +241,6 @@ ENTRY(xor_vis_4)
+ 	retl
+ 	 wr	%g0, 0, %fprs
+ ENDPROC(xor_vis_4)
+-EXPORT_SYMBOL(xor_vis_4)
+ 
+ ENTRY(xor_vis_5)
+ 	save	%sp, -192, %sp
+@@ -351,7 +347,6 @@ ENTRY(xor_vis_5)
+ 	ret
+ 	 restore
+ ENDPROC(xor_vis_5)
+-EXPORT_SYMBOL(xor_vis_5)
+ 
+ 	/* Niagara versions. */
+ ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
+@@ -398,7 +393,6 @@ ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
+ 	ret
+ 	 restore
+ ENDPROC(xor_niagara_2)
+-EXPORT_SYMBOL(xor_niagara_2)
+ 
+ ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
+ 	save		%sp, -192, %sp
+@@ -460,7 +454,6 @@ ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
+ 	ret
+ 	 restore
+ ENDPROC(xor_niagara_3)
+-EXPORT_SYMBOL(xor_niagara_3)
+ 
+ ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
+ 	save		%sp, -192, %sp
+@@ -543,7 +536,6 @@ ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
+ 	ret
+ 	 restore
+ ENDPROC(xor_niagara_4)
+-EXPORT_SYMBOL(xor_niagara_4)
+ 
+ ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */
+ 	save		%sp, -192, %sp
+@@ -642,4 +634,3 @@ ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=s
+ 	ret
+ 	 restore
+ ENDPROC(xor_niagara_5)
+-EXPORT_SYMBOL(xor_niagara_5)
diff --git a/debian/patches/bugfix/x86/x86-kbuild-enable-modversions-for-symbols-exported-f.patch b/debian/patches/bugfix/x86/x86-kbuild-enable-modversions-for-symbols-exported-f.patch
new file mode 100644
index 0000000..10f960d
--- /dev/null
+++ b/debian/patches/bugfix/x86/x86-kbuild-enable-modversions-for-symbols-exported-f.patch
@@ -0,0 +1,59 @@
+From 14d9f1f7f3709199ded0f3b29125943b3eaca0ab Mon Sep 17 00:00:00 2001
+From: Adam Borowski <kilobyte at angband.pl>
+Date: Tue, 29 Nov 2016 14:51:17 +0100
+Subject: x86/kbuild: enable modversions for symbols exported from asm
+
+Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
+modversion support for symbols exported from asm files. Architectures
+must include C-style declarations for those symbols in asm/asm-prototypes.h
+in order for them to be versioned.
+
+Add these declarations for x86, and an architecture-independent file that
+can be used for common symbols.
+
+User impact: kernels may fail to load modules at all when
+CONFIG_MODVERSIONS=y.
+
+Signed-off-by: Adam Borowski <kilobyte at angband.pl>
+Tested-by: Kalle Valo <kvalo at codeaurora.org>
+Acked-by: Nicholas Piggin <npiggin at gmail.com>
+Tested-by: Peter Wu <peter at lekensteyn.nl>
+Tested-by: Oliver Hartkopp <socketcan at hartkopp.net>
+---
+ arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
+ include/asm-generic/asm-prototypes.h  |  7 +++++++
+ 2 files changed, 19 insertions(+)
+ create mode 100644 arch/x86/include/asm/asm-prototypes.h
+ create mode 100644 include/asm-generic/asm-prototypes.h
+
+diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
+new file mode 100644
+index 000000000000..ae87224df613
+--- /dev/null
++++ b/arch/x86/include/asm/asm-prototypes.h
+@@ -0,0 +1,12 @@
++#include <asm/ftrace.h>
++#include <asm/uaccess.h>
++#include <asm/string.h>
++#include <asm/page.h>
++#include <asm/checksum.h>
++
++#include <asm-generic/asm-prototypes.h>
++
++#include <asm/page.h>
++#include <asm/pgtable.h>
++#include <asm/special_insns.h>
++#include <asm/preempt.h>
+diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
+new file mode 100644
+index 000000000000..df13637e4017
+--- /dev/null
++++ b/include/asm-generic/asm-prototypes.h
+@@ -0,0 +1,7 @@
++#include <linux/bitops.h>
++extern void *__memset(void *, int, __kernel_size_t);
++extern void *__memcpy(void *, const void *, __kernel_size_t);
++extern void *__memmove(void *, const void *, __kernel_size_t);
++extern void *memset(void *, int, __kernel_size_t);
++extern void *memcpy(void *, const void *, __kernel_size_t);
++extern void *memmove(void *, const void *, __kernel_size_t);
diff --git a/debian/patches/series b/debian/patches/series
index 0350a99..742955f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -93,6 +93,15 @@ features/all/securelevel/arm64-add-kernel-config-option-to-set-securelevel-wh.pa
 bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
 debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
 
+# Fix exported symbol versions
+bugfix/ia64/revert-ia64-move-exports-to-definitions.patch
+bugfix/sparc/revert-sparc-move-exports-to-definitions.patch
+bugfix/s390/revert-s390-move-exports-to-definitions.patch
+bugfix/m68k/revert-m68k-move-exports-to-definitions.patch
+bugfix/alpha/revert-alpha-move-exports-to-actual-definitions.patch
+bugfix/x86/x86-kbuild-enable-modversions-for-symbols-exported-f.patch
+bugfix/all/revert-fix-subtle-config_modversions-problems.patch
+
 # ABI maintenance
 
 # Tools bug fixes

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list