Clean up symbol version fixes for symbols exported from asm

We can't keep reverting these changes, so instead move forward.  Most
architectures now have <asm/asm-protoypes.h> and only 3 were left:

- alpha: Added <asm/asm-protoypes.h> and submitted patch upstream
- m68k: Did same, but realised it's only needed for Coldfire configs
  so we don't need any patches
- sparc: Cherry-picked changes from upstream
This commit is contained in:
Ben Hutchings 2017-07-19 01:07:37 +01:00
parent aaafbb9091
commit 45a06e2c0f
8 changed files with 190 additions and 2388 deletions

11
debian/changelog vendored
View File

@ -1,8 +1,15 @@
linux (4.12.2-1~exp2) UNRELEASED; urgency=medium
* media: Enable USB_RAINSHADOW_CEC as module (see #868511)
* [sparc64] Update "Revert "sparc: move exports to definitions"" again
(really fixes FTBFS)
* Clean up symbol version fixes for symbols exported from asm
(fixes FTBFS on sparc64):
- [alpha] Un-revert "alpha: move exports to actual definitions"
- [alpha] Restore symbol versions for symbols exported from assembly
- [m68k] Un-revert "m68k: move exports to definitions"
- [sparc64] Un-revert "sparc: move exports to definitions"
- [sparc64] Adding asm-prototypes.h for genksyms to generate crc
- [sparc64] sed regex in Makefile.build requires line break between
exported symbols
-- Ben Hutchings <ben@decadent.org.uk> Tue, 18 Jul 2017 13:26:41 +0100

View File

@ -0,0 +1,39 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 18 Jul 2017 23:44:25 +0100
Subject: alpha: Restore symbol versions for symbols exported from assembly
Forwarded: https://marc.info/?l=linux-alpha&m=150042247925108&w=2
Add <asm/asm-prototypes.h> so that genksyms knows the types of
these symbols and can generate CRCs for them.
Fixes: 00fc0e0dda62 ("alpha: move exports to actual definitions")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/alpha/include/asm/asm-prototypes.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 arch/alpha/include/asm/asm-prototypes.h
diff --git a/arch/alpha/include/asm/asm-prototypes.h b/arch/alpha/include/asm/asm-prototypes.h
new file mode 100644
index 000000000000..d12c68ea340b
--- /dev/null
+++ b/arch/alpha/include/asm/asm-prototypes.h
@@ -0,0 +1,18 @@
+#include <linux/spinlock.h>
+
+#include <asm/checksum.h>
+#include <asm/console.h>
+#include <asm/page.h>
+#include <asm/string.h>
+#include <asm/uaccess.h>
+
+#include <asm-generic/asm-prototypes.h>
+
+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);

View File

@ -1,869 +0,0 @@
From: Ben Hutchings <ben@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).
Commit 8525023121de "alpha: switch __copy_user() and __do_clean_user() to
normal calling conventions" renamed __do_clear_user() to __clear_user().
---
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
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -2,7 +2,6 @@
generic-y += clkdev.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
--- 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
--- /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(__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);
--- 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 */
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -115,7 +115,6 @@ unsigned long alpha_agpgart_size = DEFAU
#ifdef CONFIG_ALPHA_GENERIC
struct alpha_machine_vector alpha_mv;
-EXPORT_SYMBOL(alpha_mv);
#endif
#ifndef alpha_using_srm
--- 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
--- a/arch/alpha/lib/checksum.c
+++ b/arch/alpha/lib/checksum.c
@@ -48,7 +48,6 @@ __sum16 csum_tcpudp_magic(__be32 saddr,
(__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, un
{
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
{
return (__force __sum16)~from64to16(do_csum(buff,len));
}
-EXPORT_SYMBOL(ip_compute_csum);
--- 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)
--- a/arch/alpha/lib/clear_user.S
+++ b/arch/alpha/lib/clear_user.S
@@ -9,7 +9,6 @@
* a successful copy). There is also some rather minor exception setup
* stuff.
*/
-#include <asm/export.h>
/* Allow an exception for an insn; exit if we get one. */
#define EX(x,y...) \
@@ -98,4 +97,3 @@ $exception:
ret $31, ($26), 1 # .. e1 :
.end __clear_user
- EXPORT_SYMBOL(__clear_user)
--- 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)
--- a/arch/alpha/lib/copy_user.S
+++ b/arch/alpha/lib/copy_user.S
@@ -11,8 +11,6 @@
* exception setup stuff..
*/
-#include <asm/export.h>
-
/* Allow an exception for an insn; exit if we get one. */
#define EXI(x,y...) \
99: x,##y; \
@@ -117,4 +115,3 @@ $exitout:
ret $31,($26),1
.end __copy_user
-EXPORT_SYMBOL(__copy_user)
--- 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@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)
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -368,7 +368,6 @@ csum_partial_copy_from_user(const void _
}
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)
@@ -381,4 +380,3 @@ csum_partial_copy_nocheck(const void *sr
set_fs(oldfs);
return checksum;
}
-EXPORT_SYMBOL(csum_partial_copy_nocheck);
--- 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(
spin_unlock(lock);
return 0;
}
-EXPORT_SYMBOL(_atomic_dec_and_lock);
--- 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)
--- 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)
--- a/arch/alpha/lib/ev6-clear_user.S
+++ b/arch/alpha/lib/ev6-clear_user.S
@@ -28,7 +28,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; \
@@ -209,4 +208,4 @@ $exception: # Destination for exceptio
nop # .. E .. .. :
ret $31, ($26), 1 # L0 .. .. .. : L U L U
.end __clear_user
- EXPORT_SYMBOL(__clear_user)
+
--- 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)
--- a/arch/alpha/lib/ev6-copy_user.S
+++ b/arch/alpha/lib/ev6-copy_user.S
@@ -22,7 +22,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; \
@@ -222,4 +221,4 @@ $exitout: # Destination for exception
ret $31,($26),1 # L0 .. .. .. : L U L U
.end __copy_user
- EXPORT_SYMBOL(__copy_user)
+
--- 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)
--- 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)
--- 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)
--- 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
--- 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)
--- 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)
--- 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
ret # L0 :
.end strchr
- EXPORT_SYMBOL(strchr)
--- 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)
--- 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)
--- 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)
--- 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, u
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,
case 31: LDS(31, val); break;
}
}
-EXPORT_SYMBOL(alpha_write_fp_reg_s);
--- 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)
--- 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 *s
__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");
--- 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)
--- 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)
--- 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
br __stxcpy
.end strcat
-EXPORT_SYMBOL(strcat);
--- 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)
--- 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)
--- 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)
--- 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)
--- 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)
--- 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)

View File

@ -1,207 +0,0 @@
From: Ben Hutchings <ben@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).
Updated for 4.11: don't revert additions of #include <compiler.h> as
it's needed for other reasons (see #862393).
---
--- 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>
--- 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
--- /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
--- a/arch/m68k/lib/ashldi3.c
+++ b/arch/m68k/lib/ashldi3.c
@@ -14,7 +14,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICU
GNU General Public License for more details. */
#include <linux/compiler.h>
-#include <linux/export.h>
#define BITS_PER_UNIT 8
@@ -58,4 +57,3 @@ __ashldi3 (DItype u, word_type b)
return w.ll;
}
-EXPORT_SYMBOL(__ashldi3);
--- a/arch/m68k/lib/ashrdi3.c
+++ b/arch/m68k/lib/ashrdi3.c
@@ -14,7 +14,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICU
GNU General Public License for more details. */
#include <linux/compiler.h>
-#include <linux/export.h>
#define BITS_PER_UNIT 8
@@ -59,4 +58,3 @@ __ashrdi3 (DItype u, word_type b)
return w.ll;
}
-EXPORT_SYMBOL(__ashrdi3);
--- 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@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@-
L3: movel sp@+, d2
rts
- EXPORT_SYMBOL(__divsi3)
--- a/arch/m68k/lib/lshrdi3.c
+++ b/arch/m68k/lib/lshrdi3.c
@@ -14,7 +14,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICU
GNU General Public License for more details. */
#include <linux/compiler.h>
-#include <linux/export.h>
#define BITS_PER_UNIT 8
@@ -58,4 +57,3 @@ __lshrdi3 (DItype u, word_type b)
return w.ll;
}
-EXPORT_SYMBOL(__lshrdi3);
--- 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@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)
--- a/arch/m68k/lib/muldi3.c
+++ b/arch/m68k/lib/muldi3.c
@@ -15,7 +15,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICU
GNU General Public License for more details. */
#include <linux/compiler.h>
-#include <linux/export.h>
#ifdef CONFIG_CPU_HAS_NO_MULDIV64
@@ -93,4 +92,3 @@ __muldi3 (DItype u, DItype v)
return w.ll;
}
-EXPORT_SYMBOL(__muldi3);
--- 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@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)
+
--- 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@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)
+
--- 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@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)
+

View File

@ -0,0 +1,47 @@
From: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
Date: Mon, 19 Jun 2017 13:08:48 -0400
Subject: Adding asm-prototypes.h for genksyms to generate crc
Origin: https://git.kernel.org/linus/bdca8cc096203b17ad0ac4e19f50578207e054d2
This patch adds the prototypes of assembly defined functions to asm-prototypes.h.
Some prototypes are directly added as they are not present in any existing header
files.
Signed-off-by: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
Reviewed-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
arch/sparc/include/asm/asm-prototypes.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 arch/sparc/include/asm/asm-prototypes.h
diff --git a/arch/sparc/include/asm/asm-prototypes.h b/arch/sparc/include/asm/asm-prototypes.h
new file mode 100644
index 000000000000..d381e11c5dbb
--- /dev/null
+++ b/arch/sparc/include/asm/asm-prototypes.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
+ */
+
+#include <asm/xor.h>
+#include <asm/checksum.h>
+#include <asm/trap_block.h>
+#include <asm/uaccess.h>
+#include <asm/atomic.h>
+#include <asm/ftrace.h>
+#include <asm/cacheflush.h>
+#include <asm/oplib.h>
+#include <linux/atomic.h>
+
+void *__memscan_zero(void *, size_t);
+void *__memscan_generic(void *, int, size_t);
+void *__bzero(void *, size_t);
+void VISenter(void); /* Dummy prototype to supress warning */
+#undef memcpy
+#undef memset
+void *memcpy(void *dest, const void *src, size_t n);
+void *memset(void *s, int c, size_t n);
+typedef int TItype __attribute__((mode(TI)));
+TItype __multi3(TItype a, TItype b);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
From: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
Date: Mon, 19 Jun 2017 13:08:49 -0400
Subject: sed regex in Makefile.build requires line break between exported
symbols
Origin: https://git.kernel.org/linus/d16c0649feb4fe4e814f44803df5a617769c3233
The following regex in Makefile.build matches only one ___EXPORT_SYMBOL per line.
sed
's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/'
ATOMIC_OPS macro in atomic_64.S expands multiple symbols in same line hence
version generation is done only for the last matched symbol. This patch adds
new line between the symbol expansions.
Signed-off-by: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
Reviewed-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
arch/sparc/lib/atomic_64.S | 44 ++++++++++++++++++++++++++------------------
1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S
index 1c6a1bde5138..ce17c3094ba6 100644
--- a/arch/sparc/lib/atomic_64.S
+++ b/arch/sparc/lib/atomic_64.S
@@ -62,19 +62,23 @@ ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
ENDPROC(atomic_fetch_##op); \
EXPORT_SYMBOL(atomic_fetch_##op);
-#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
+ATOMIC_OP(add)
+ATOMIC_OP_RETURN(add)
+ATOMIC_FETCH_OP(add)
-ATOMIC_OPS(add)
-ATOMIC_OPS(sub)
+ATOMIC_OP(sub)
+ATOMIC_OP_RETURN(sub)
+ATOMIC_FETCH_OP(sub)
-#undef ATOMIC_OPS
-#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
+ATOMIC_OP(and)
+ATOMIC_FETCH_OP(and)
-ATOMIC_OPS(and)
-ATOMIC_OPS(or)
-ATOMIC_OPS(xor)
+ATOMIC_OP(or)
+ATOMIC_FETCH_OP(or)
+
+ATOMIC_OP(xor)
+ATOMIC_FETCH_OP(xor)
-#undef ATOMIC_OPS
#undef ATOMIC_FETCH_OP
#undef ATOMIC_OP_RETURN
#undef ATOMIC_OP
@@ -124,19 +128,23 @@ ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
ENDPROC(atomic64_fetch_##op); \
EXPORT_SYMBOL(atomic64_fetch_##op);
-#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
+ATOMIC64_OP(add)
+ATOMIC64_OP_RETURN(add)
+ATOMIC64_FETCH_OP(add)
+
+ATOMIC64_OP(sub)
+ATOMIC64_OP_RETURN(sub)
+ATOMIC64_FETCH_OP(sub)
-ATOMIC64_OPS(add)
-ATOMIC64_OPS(sub)
+ATOMIC64_OP(and)
+ATOMIC64_FETCH_OP(and)
-#undef ATOMIC64_OPS
-#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_FETCH_OP(op)
+ATOMIC64_OP(or)
+ATOMIC64_FETCH_OP(or)
-ATOMIC64_OPS(and)
-ATOMIC64_OPS(or)
-ATOMIC64_OPS(xor)
+ATOMIC64_OP(xor)
+ATOMIC64_FETCH_OP(xor)
-#undef ATOMIC64_OPS
#undef ATOMIC64_FETCH_OP
#undef ATOMIC64_OP_RETURN
#undef ATOMIC64_OP

View File

@ -117,9 +117,9 @@ debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
bugfix/all/binfmt_elf-use-elf_et_dyn_base-only-for-pie.patch
# Fix exported symbol versions
bugfix/sparc/revert-sparc-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/sparc/adding-asm-prototypes.h-for-genksyms-to-generate-crc.patch
bugfix/sparc/sed-regex-in-makefile.build-requires-line-break-betw.patch
bugfix/alpha/alpha-restore-symbol-versions-for-symbols-exported-f.patch
bugfix/all/module-disable-matching-missing-version-crc.patch
# ABI maintenance