linux/debian/patches/bugfix/m68k/revert-m68k-move-exports-to...

208 lines
5.7 KiB
Diff

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)
+