new file mode 100644
@@ -0,0 +1 @@
+#define EXPORT_SYMBOL_VOIDPROTO(x) /* nothing */
@@ -728,6 +728,7 @@ __pv_phys_pfn_offset:
__pv_offset:
.quad 0
.size __pv_offset, . -__pv_offset
+SYMBOL_CPROTO_INCLUDE(<asm/memory.h>)
EXPORT_SYMBOL(__pv_phys_pfn_offset)
EXPORT_SYMBOL(__pv_offset)
#endif
@@ -18,6 +18,8 @@
#include <asm/unwind.h>
#include <asm/export.h>
+SYMBOL_CPROTO_INCLUDE(<linux/arm-smccc.h>)
+
/*
* Wrap c macros in asm macros to delay expansion until after the
* SMCCC asm macro is expanded.
@@ -29,6 +29,7 @@ Boston, MA 02110-1301, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/export.h>
+#include "voidproto.h"
#ifdef __ARMEB__
#define al r1
@@ -53,5 +54,5 @@ ENTRY(__aeabi_llsl)
ENDPROC(__ashldi3)
ENDPROC(__aeabi_llsl)
-EXPORT_SYMBOL(__ashldi3)
-EXPORT_SYMBOL(__aeabi_llsl)
+EXPORT_SYMBOL_VOIDPROTO(__ashldi3)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_llsl)
@@ -29,6 +29,7 @@ Boston, MA 02110-1301, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/export.h>
+#include "voidproto.h"
#ifdef __ARMEB__
#define al r1
@@ -53,5 +54,5 @@ ENTRY(__aeabi_lasr)
ENDPROC(__ashrdi3)
ENDPROC(__aeabi_lasr)
-EXPORT_SYMBOL(__ashrdi3)
-EXPORT_SYMBOL(__aeabi_lasr)
+EXPORT_SYMBOL_VOIDPROTO(__ashrdi3)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_lasr)
@@ -2,6 +2,16 @@
#include <asm/unwind.h>
#include <asm/export.h>
+SYMBOL_CPROTO_INCLUDE(<linux/bitops.h>)
+
+#define BITOP(name, instr) \
+ bitop name, instr; \
+ EXPORT_SYMBOL(name)
+
+#define TESTOP(name, instr, store) \
+ testop name, instr, store; \
+ EXPORT_SYMBOL(name)
+
#if __LINUX_ARM_ARCH__ >= 6
.macro bitop, name, instr
ENTRY( \name )
@@ -26,7 +36,6 @@ UNWIND( .fnstart )
bx lr
UNWIND( .fnend )
ENDPROC(\name )
-EXPORT_SYMBOL(\name )
.endm
.macro testop, name, instr, store
@@ -57,7 +66,6 @@ UNWIND( .fnstart )
2: bx lr
UNWIND( .fnend )
ENDPROC(\name )
-EXPORT_SYMBOL(\name )
.endm
#else
.macro bitop, name, instr
@@ -77,7 +85,6 @@ UNWIND( .fnstart )
ret lr
UNWIND( .fnend )
ENDPROC(\name )
-EXPORT_SYMBOL(\name )
.endm
/**
@@ -106,6 +113,5 @@ UNWIND( .fnstart )
ret lr
UNWIND( .fnend )
ENDPROC(\name )
-EXPORT_SYMBOL(\name )
.endm
#endif
@@ -1,6 +1,7 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/export.h>
+#include "voidproto.h"
#if __LINUX_ARM_ARCH__ >= 6
ENTRY(__bswapsi2)
@@ -36,5 +37,5 @@ ENTRY(__bswapdi2)
ret lr
ENDPROC(__bswapdi2)
#endif
-EXPORT_SYMBOL(__bswapsi2)
-EXPORT_SYMBOL(__bswapdi2)
+EXPORT_SYMBOL_VOIDPROTO(__bswapsi2)
+EXPORT_SYMBOL_VOIDPROTO(__bswapdi2)
@@ -12,4 +12,4 @@
#include "bitops.h"
.text
-bitop _change_bit, eor
+BITOP( _change_bit, eor )
@@ -52,6 +52,7 @@ UNWIND(.fnend)
ENDPROC(arm_clear_user)
ENDPROC(__clear_user_std)
#ifndef CONFIG_UACCESS_WITH_MEMCPY
+SYMBOL_CPROTO_INCLUDE(<asm/uaccess.h>)
EXPORT_SYMBOL(arm_clear_user)
#endif
@@ -12,4 +12,4 @@
#include "bitops.h"
.text
-bitop _clear_bit, bic
+BITOP( _clear_bit, bic )
@@ -95,6 +95,7 @@ ENTRY(arm_copy_from_user)
#include "copy_template.S"
ENDPROC(arm_copy_from_user)
+SYMBOL_CPROTO_INCLUDE(<asm/uaccess.h>)
EXPORT_SYMBOL(arm_copy_from_user)
.pushsection .fixup,"ax"
@@ -46,4 +46,5 @@ ENTRY(copy_page)
PLD( beq 2b )
ldmfd sp!, {r4, pc} @ 3
ENDPROC(copy_page)
+SYMBOL_CPROTO_INCLUDE(<asm/page.h>)
EXPORT_SYMBOL(copy_page)
@@ -101,6 +101,7 @@ WEAK(arm_copy_to_user)
ENDPROC(arm_copy_to_user)
ENDPROC(__copy_to_user_std)
#ifndef CONFIG_UACCESS_WITH_MEMCPY
+SYMBOL_CPROTO_INCLUDE(<asm/uaccess.h>)
EXPORT_SYMBOL(arm_copy_to_user)
#endif
@@ -31,4 +31,5 @@ ENTRY(__csum_ipv6_magic)
adcs r0, r0, #0
ldmfd sp!, {pc}
ENDPROC(__csum_ipv6_magic)
+SYMBOL_CPROTO_INCLUDE(<asm/checksum.h>)
EXPORT_SYMBOL(__csum_ipv6_magic)
@@ -141,4 +141,5 @@ ENTRY(csum_partial)
bne 4b
b .Lless4
ENDPROC(csum_partial)
+SYMBOL_CPROTO_INCLUDE(<asm/checksum.h>)
EXPORT_SYMBOL(csum_partial)
@@ -10,6 +10,8 @@
#include <asm/assembler.h>
#include <asm/export.h>
+SYMBOL_CPROTO_INCLUDE(<asm/checksum.h>)
+
/*
* unsigned int
* csum_partial_copy_xxx(const char *src, char *dst, int len, int sum, )
@@ -16,6 +16,7 @@
#include <asm/assembler.h>
#include <asm/unwind.h>
#include <asm/export.h>
+#include "voidproto.h"
#ifdef __ARMEB__
#define xh r0
@@ -211,4 +212,4 @@ Ldiv0_64:
UNWIND(.fnend)
ENDPROC(__do_div64)
-EXPORT_SYMBOL(__do_div64)
+EXPORT_SYMBOL_VOIDPROTO(__do_div64)
@@ -33,6 +33,8 @@
#include <asm/domain.h>
#include <asm/export.h>
+SYMBOL_CPROTO_INCLUDE(<asm/uaccess.h>)
+
ENTRY(__get_user_1)
check_uaccess r0, 1, r1, r2, __get_user_bad
1: TUSER(ldrb) r2, [r0]
@@ -122,4 +122,5 @@ ENTRY(__raw_readsb)
ldmfd sp!, {r4 - r6, pc}
ENDPROC(__raw_readsb)
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_readsb)
@@ -78,4 +78,5 @@ ENTRY(__raw_readsl)
strb r3, [r1, #0]
ret lr
ENDPROC(__raw_readsl)
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_readsl)
@@ -104,4 +104,5 @@ ENTRY(__raw_readsw)
ldmfd sp!, {r4, r5, r6, pc}
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_readsw)
@@ -130,4 +130,5 @@ ENTRY(__raw_readsw)
strneb ip, [r1]
ldmfd sp!, {r4, pc}
ENDPROC(__raw_readsw)
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_readsw)
@@ -93,4 +93,5 @@ ENTRY(__raw_writesb)
ldmfd sp!, {r4, r5, pc}
ENDPROC(__raw_writesb)
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_writesb)
@@ -66,4 +66,5 @@ ENTRY(__raw_writesl)
bne 6b
ret lr
ENDPROC(__raw_writesl)
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_writesl)
@@ -125,4 +125,5 @@ ENTRY(__raw_writesw)
strne ip, [r0]
ldmfd sp!, {r4, r5, r6, pc}
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_writesw)
@@ -99,4 +99,5 @@ ENTRY(__raw_writesw)
strneh ip, [r0]
ret lr
ENDPROC(__raw_writesw)
+SYMBOL_CPROTO_INCLUDE(<asm/io.h>)
EXPORT_SYMBOL(__raw_writesw)
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include <asm/assembler.h>
#include <asm/unwind.h>
#include <asm/export.h>
+#include "voidproto.h"
.macro ARM_DIV_BODY dividend, divisor, result, curbit
@@ -239,8 +240,8 @@ UNWIND(.fnstart)
UNWIND(.fnend)
ENDPROC(__udivsi3)
ENDPROC(__aeabi_uidiv)
-EXPORT_SYMBOL(__udivsi3)
-EXPORT_SYMBOL(__aeabi_uidiv)
+EXPORT_SYMBOL_VOIDPROTO(__udivsi3)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_uidiv)
ENTRY(__umodsi3)
UNWIND(.fnstart)
@@ -259,7 +260,7 @@ UNWIND(.fnstart)
UNWIND(.fnend)
ENDPROC(__umodsi3)
-EXPORT_SYMBOL(__umodsi3)
+EXPORT_SYMBOL_VOIDPROTO(__umodsi3)
#ifdef CONFIG_ARM_PATCH_IDIV
.align 3
@@ -307,8 +308,8 @@ UNWIND(.fnstart)
UNWIND(.fnend)
ENDPROC(__divsi3)
ENDPROC(__aeabi_idiv)
-EXPORT_SYMBOL(__divsi3)
-EXPORT_SYMBOL(__aeabi_idiv)
+EXPORT_SYMBOL_VOIDPROTO(__divsi3)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_idiv)
ENTRY(__modsi3)
UNWIND(.fnstart)
@@ -333,7 +334,7 @@ UNWIND(.fnstart)
UNWIND(.fnend)
ENDPROC(__modsi3)
-EXPORT_SYMBOL(__modsi3)
+EXPORT_SYMBOL_VOIDPROTO(__modsi3)
#ifdef CONFIG_AEABI
@@ -350,7 +351,7 @@ UNWIND(.save {r0, r1, ip, lr} )
UNWIND(.fnend)
ENDPROC(__aeabi_uidivmod)
-EXPORT_SYMBOL(__aeabi_uidivmod)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_uidivmod)
ENTRY(__aeabi_idivmod)
UNWIND(.fnstart)
@@ -364,7 +365,7 @@ UNWIND(.save {r0, r1, ip, lr} )
UNWIND(.fnend)
ENDPROC(__aeabi_idivmod)
-EXPORT_SYMBOL(__aeabi_idivmod)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_idivmod)
#endif
@@ -29,6 +29,7 @@ Boston, MA 02110-1301, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/export.h>
+#include "voidproto.h"
#ifdef __ARMEB__
#define al r1
@@ -53,5 +54,5 @@ ENTRY(__aeabi_llsr)
ENDPROC(__lshrdi3)
ENDPROC(__aeabi_llsr)
-EXPORT_SYMBOL(__lshrdi3)
-EXPORT_SYMBOL(__aeabi_llsr)
+EXPORT_SYMBOL_VOIDPROTO(__lshrdi3)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_llsr)
@@ -25,4 +25,5 @@ ENTRY(memchr)
2: movne r0, #0
ret lr
ENDPROC(memchr)
+SYMBOL_CPROTO_INCLUDE(<linux/string.h>)
EXPORT_SYMBOL(memchr)
@@ -69,5 +69,9 @@ ENTRY(memcpy)
ENDPROC(memcpy)
ENDPROC(mmiocpy)
+
+SYMBOL_CPROTO_INCLUDE(<linux/string.h>)
EXPORT_SYMBOL(memcpy)
+
+SYMBOL_CPROTO(void mmiocpy(void *, const void *, size_t))
EXPORT_SYMBOL(mmiocpy)
@@ -226,4 +226,5 @@ ENTRY(memmove)
18: backward_copy_shift push=24 pull=8
ENDPROC(memmove)
+SYMBOL_CPROTO_INCLUDE(<linux/string.h>)
EXPORT_SYMBOL(memmove)
@@ -136,5 +136,9 @@ UNWIND( .fnstart )
UNWIND( .fnend )
ENDPROC(memset)
ENDPROC(mmioset)
+
+SYMBOL_CPROTO_INCLUDE(<linux/string.h>)
EXPORT_SYMBOL(memset)
+
+SYMBOL_CPROTO(extern void mmioset(void *, unsigned int, size_t))
EXPORT_SYMBOL(mmioset)
@@ -136,4 +136,5 @@ UNWIND( .fnstart )
ret lr @ 1
UNWIND( .fnend )
ENDPROC(__memzero)
+SYMBOL_CPROTO_INCLUDE(<asm/string.h>)
EXPORT_SYMBOL(__memzero)
@@ -13,6 +13,7 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/export.h>
+#include "voidproto.h"
#ifdef __ARMEB__
#define xh r0
@@ -47,5 +48,5 @@ ENTRY(__aeabi_lmul)
ENDPROC(__muldi3)
ENDPROC(__aeabi_lmul)
-EXPORT_SYMBOL(__muldi3)
-EXPORT_SYMBOL(__aeabi_lmul)
+EXPORT_SYMBOL_VOIDPROTO(__muldi3)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_lmul)
@@ -33,6 +33,8 @@
#include <asm/domain.h>
#include <asm/export.h>
+SYMBOL_CPROTO_INCLUDE(<asm/uaccess.h>)
+
ENTRY(__put_user_1)
check_uaccess r0, 1, r1, ip, __put_user_bad
1: TUSER(strb) r2, [r0]
@@ -12,4 +12,4 @@
#include "bitops.h"
.text
-bitop _set_bit, orr
+BITOP( _set_bit, orr )
@@ -26,4 +26,5 @@ ENTRY(strchr)
subeq r0, r0, #1
ret lr
ENDPROC(strchr)
+SYMBOL_CPROTO_INCLUDE(<linux/string.h>)
EXPORT_SYMBOL(strchr)
@@ -25,4 +25,5 @@ ENTRY(strrchr)
mov r0, r3
ret lr
ENDPROC(strrchr)
+SYMBOL_CPROTO_INCLUDE(<linux/string.h>)
EXPORT_SYMBOL(strrchr)
@@ -12,4 +12,4 @@
#include "bitops.h"
.text
-testop _test_and_change_bit, eor, str
+TESTOP( _test_and_change_bit, eor, str )
@@ -12,4 +12,4 @@
#include "bitops.h"
.text
-testop _test_and_clear_bit, bicne, strne
+TESTOP( _test_and_clear_bit, bicne, strne )
@@ -12,4 +12,4 @@
#include "bitops.h"
.text
-testop _test_and_set_bit, orreq, streq
+TESTOP( _test_and_set_bit, orreq, streq )
@@ -13,6 +13,7 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/export.h>
+#include "voidproto.h"
#ifdef __ARMEB__
#define xh r0
@@ -36,7 +37,7 @@ ENTRY(__ucmpdi2)
ret lr
ENDPROC(__ucmpdi2)
-EXPORT_SYMBOL(__ucmpdi2)
+EXPORT_SYMBOL_VOIDPROTO(__ucmpdi2)
#ifdef CONFIG_AEABI
@@ -50,7 +51,7 @@ ENTRY(__aeabi_ulcmp)
ret lr
ENDPROC(__aeabi_ulcmp)
-EXPORT_SYMBOL(__aeabi_ulcmp)
+EXPORT_SYMBOL_VOIDPROTO(__aeabi_ulcmp)
#endif
new file mode 100644
@@ -0,0 +1,7 @@
+/*
+ * The gcc helper functions exported from assembly code are never
+ * called from C code directly, however they traditionally always had
+ * a prototype like void __symbol(void) for modversion.
+ */
+#define EXPORT_SYMBOL_VOIDPROTO(sym) \
+ SYMBOL_CPROTO(void sym(void)); EXPORT_SYMBOL(sym)
This assumes a revert of commit 8478132a87 before being applied. Annotate exported assembly symbols so they are properly checksummed when modversion is selected. Also, don't use \name with EXPORT_SYMBOL() in bitops.h. Here \name is an assembler macro argument which is not subject to preprocessor substitutions. And the assembler doesn't handle preprocessor macros either. That has the effect of breaking CONFIG_TRIM_UNUSED_KSYMS=y. Signed-off-by: Nicolas Pitre <nico@linaro.org> --- arch/arm/boot/compressed/voidproto.h | 1 + arch/arm/kernel/head.S | 1 + arch/arm/kernel/smccc-call.S | 2 ++ arch/arm/lib/ashldi3.S | 5 +++-- arch/arm/lib/ashrdi3.S | 5 +++-- arch/arm/lib/bitops.h | 14 ++++++++++---- arch/arm/lib/bswapsdi2.S | 5 +++-- arch/arm/lib/changebit.S | 2 +- arch/arm/lib/clear_user.S | 1 + arch/arm/lib/clearbit.S | 2 +- arch/arm/lib/copy_from_user.S | 1 + arch/arm/lib/copy_page.S | 1 + arch/arm/lib/copy_to_user.S | 1 + arch/arm/lib/csumipv6.S | 1 + arch/arm/lib/csumpartial.S | 1 + arch/arm/lib/csumpartialcopygeneric.S | 2 ++ arch/arm/lib/div64.S | 3 ++- arch/arm/lib/getuser.S | 2 ++ arch/arm/lib/io-readsb.S | 1 + arch/arm/lib/io-readsl.S | 1 + arch/arm/lib/io-readsw-armv3.S | 1 + arch/arm/lib/io-readsw-armv4.S | 1 + arch/arm/lib/io-writesb.S | 1 + arch/arm/lib/io-writesl.S | 1 + arch/arm/lib/io-writesw-armv3.S | 1 + arch/arm/lib/io-writesw-armv4.S | 1 + arch/arm/lib/lib1funcs.S | 17 +++++++++-------- arch/arm/lib/lshrdi3.S | 5 +++-- arch/arm/lib/memchr.S | 1 + arch/arm/lib/memcpy.S | 4 ++++ arch/arm/lib/memmove.S | 1 + arch/arm/lib/memset.S | 4 ++++ arch/arm/lib/memzero.S | 1 + arch/arm/lib/muldi3.S | 5 +++-- arch/arm/lib/putuser.S | 2 ++ arch/arm/lib/setbit.S | 2 +- arch/arm/lib/strchr.S | 1 + arch/arm/lib/strrchr.S | 1 + arch/arm/lib/testchangebit.S | 2 +- arch/arm/lib/testclearbit.S | 2 +- arch/arm/lib/testsetbit.S | 2 +- arch/arm/lib/ucmpdi2.S | 5 +++-- arch/arm/lib/voidproto.h | 7 +++++++ 43 files changed, 89 insertions(+), 31 deletions(-) create mode 100644 arch/arm/boot/compressed/voidproto.h create mode 100644 arch/arm/lib/voidproto.h -- 2.7.4