aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-14 17:26:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-14 17:26:58 -0400
commit84d69848c97faab0c25aa2667b273404d2e2a64a (patch)
tree594f3fe1b271b5255a1c5281e36f8bf938acd1c0
parentd4d24d2d0a7ea3b62efd7336bfc2344e29b36bc5 (diff)
parent590abbdd273304b55824bcb9ea91840ea375575d (diff)
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek: - EXPORT_SYMBOL for asm source by Al Viro. This does bring a regression, because genksyms no longer generates checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is working on a patch to fix this. Plus, we are talking about functions like strcpy(), which rarely change prototypes. - Fixes for PPC fallout of the above by Stephen Rothwell and Nick Piggin - fixdep speedup by Alexey Dobriyan. - preparatory work by Nick Piggin to allow architectures to build with -ffunction-sections, -fdata-sections and --gc-sections - CONFIG_THIN_ARCHIVES support by Stephen Rothwell - fix for filenames with colons in the initramfs source by me. * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (22 commits) initramfs: Escape colons in depfile ppc: there is no clear_pages to export powerpc/64: whitelist unresolved modversions CRCs kbuild: -ffunction-sections fix for archs with conflicting sections kbuild: add arch specific post-link Makefile kbuild: allow archs to select link dead code/data elimination kbuild: allow architectures to use thin archives instead of ld -r kbuild: Regenerate genksyms lexer kbuild: genksyms fix for typeof handling fixdep: faster CONFIG_ search ia64: move exports to definitions sparc32: debride memcpy.S a bit [sparc] unify 32bit and 64bit string.h sparc: move exports to definitions ppc: move exports to definitions arm: move exports to definitions s390: move exports to definitions m68k: move exports to definitions alpha: move exports to actual definitions x86: move exports to actual definitions ...
-rw-r--r--Documentation/kbuild/makefiles.txt16
-rw-r--r--Makefile19
-rw-r--r--arch/Kconfig21
-rw-r--r--arch/alpha/include/asm/Kbuild1
-rw-r--r--arch/alpha/kernel/Makefile2
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c102
-rw-r--r--arch/alpha/kernel/machvec_impl.h6
-rw-r--r--arch/alpha/kernel/setup.c1
-rw-r--r--arch/alpha/lib/callback_srm.S5
-rw-r--r--arch/alpha/lib/checksum.c3
-rw-r--r--arch/alpha/lib/clear_page.S3
-rw-r--r--arch/alpha/lib/clear_user.S2
-rw-r--r--arch/alpha/lib/copy_page.S3
-rw-r--r--arch/alpha/lib/copy_user.S3
-rw-r--r--arch/alpha/lib/csum_ipv6_magic.S2
-rw-r--r--arch/alpha/lib/csum_partial_copy.c2
-rw-r--r--arch/alpha/lib/dec_and_lock.c2
-rw-r--r--arch/alpha/lib/divide.S3
-rw-r--r--arch/alpha/lib/ev6-clear_page.S3
-rw-r--r--arch/alpha/lib/ev6-clear_user.S3
-rw-r--r--arch/alpha/lib/ev6-copy_page.S3
-rw-r--r--arch/alpha/lib/ev6-copy_user.S3
-rw-r--r--arch/alpha/lib/ev6-csum_ipv6_magic.S2
-rw-r--r--arch/alpha/lib/ev6-divide.S3
-rw-r--r--arch/alpha/lib/ev6-memchr.S3
-rw-r--r--arch/alpha/lib/ev6-memcpy.S3
-rw-r--r--arch/alpha/lib/ev6-memset.S7
-rw-r--r--arch/alpha/lib/ev67-strcat.S3
-rw-r--r--arch/alpha/lib/ev67-strchr.S3
-rw-r--r--arch/alpha/lib/ev67-strlen.S3
-rw-r--r--arch/alpha/lib/ev67-strncat.S3
-rw-r--r--arch/alpha/lib/ev67-strrchr.S3
-rw-r--r--arch/alpha/lib/fpreg.c7
-rw-r--r--arch/alpha/lib/memchr.S3
-rw-r--r--arch/alpha/lib/memcpy.c5
-rw-r--r--arch/alpha/lib/memmove.S3
-rw-r--r--arch/alpha/lib/memset.S7
-rw-r--r--arch/alpha/lib/strcat.S2
-rw-r--r--arch/alpha/lib/strchr.S3
-rw-r--r--arch/alpha/lib/strcpy.S3
-rw-r--r--arch/alpha/lib/strlen.S3
-rw-r--r--arch/alpha/lib/strncat.S3
-rw-r--r--arch/alpha/lib/strncpy.S3
-rw-r--r--arch/alpha/lib/strrchr.S3
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/armksyms.c183
-rw-r--r--arch/arm/kernel/entry-ftrace.S3
-rw-r--r--arch/arm/kernel/head.S3
-rw-r--r--arch/arm/kernel/smccc-call.S3
-rw-r--r--arch/arm/lib/ashldi3.S3
-rw-r--r--arch/arm/lib/ashrdi3.S3
-rw-r--r--arch/arm/lib/bitops.h5
-rw-r--r--arch/arm/lib/bswapsdi2.S3
-rw-r--r--arch/arm/lib/clear_user.S4
-rw-r--r--arch/arm/lib/copy_from_user.S2
-rw-r--r--arch/arm/lib/copy_page.S2
-rw-r--r--arch/arm/lib/copy_to_user.S4
-rw-r--r--arch/arm/lib/csumipv6.S3
-rw-r--r--arch/arm/lib/csumpartial.S2
-rw-r--r--arch/arm/lib/csumpartialcopy.S1
-rw-r--r--arch/arm/lib/csumpartialcopygeneric.S2
-rw-r--r--arch/arm/lib/csumpartialcopyuser.S1
-rw-r--r--arch/arm/lib/delay.c2
-rw-r--r--arch/arm/lib/div64.S2
-rw-r--r--arch/arm/lib/findbit.S9
-rw-r--r--arch/arm/lib/getuser.S9
-rw-r--r--arch/arm/lib/io-readsb.S2
-rw-r--r--arch/arm/lib/io-readsl.S2
-rw-r--r--arch/arm/lib/io-readsw-armv3.S3
-rw-r--r--arch/arm/lib/io-readsw-armv4.S2
-rw-r--r--arch/arm/lib/io-writesb.S2
-rw-r--r--arch/arm/lib/io-writesl.S2
-rw-r--r--arch/arm/lib/io-writesw-armv3.S2
-rw-r--r--arch/arm/lib/io-writesw-armv4.S2
-rw-r--r--arch/arm/lib/lib1funcs.S9
-rw-r--r--arch/arm/lib/lshrdi3.S3
-rw-r--r--arch/arm/lib/memchr.S2
-rw-r--r--arch/arm/lib/memcpy.S3
-rw-r--r--arch/arm/lib/memmove.S2
-rw-r--r--arch/arm/lib/memset.S3
-rw-r--r--arch/arm/lib/memzero.S2
-rw-r--r--arch/arm/lib/muldi3.S3
-rw-r--r--arch/arm/lib/putuser.S5
-rw-r--r--arch/arm/lib/strchr.S2
-rw-r--r--arch/arm/lib/strrchr.S2
-rw-r--r--arch/arm/lib/uaccess_with_memcpy.c3
-rw-r--r--arch/arm/lib/ucmpdi2.S3
-rw-r--r--arch/arm/mach-imx/Makefile1
-rw-r--r--arch/arm/mach-imx/ssi-fiq-ksym.c20
-rw-r--r--arch/arm/mach-imx/ssi-fiq.S7
-rw-r--r--arch/ia64/hp/sim/boot/Makefile2
-rw-r--r--arch/ia64/include/asm/export.h3
-rw-r--r--arch/ia64/kernel/entry.S3
-rw-r--r--arch/ia64/kernel/esi_stub.S2
-rw-r--r--arch/ia64/kernel/head.S2
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c94
-rw-r--r--arch/ia64/kernel/ivt.S2
-rw-r--r--arch/ia64/kernel/pal.S7
-rw-r--r--arch/ia64/kernel/setup.c4
-rw-r--r--arch/ia64/lib/Makefile8
-rw-r--r--arch/ia64/lib/clear_page.S2
-rw-r--r--arch/ia64/lib/clear_user.S2
-rw-r--r--arch/ia64/lib/copy_page.S2
-rw-r--r--arch/ia64/lib/copy_page_mck.S2
-rw-r--r--arch/ia64/lib/copy_user.S2
-rw-r--r--arch/ia64/lib/flush.S2
-rw-r--r--arch/ia64/lib/idiv32.S2
-rw-r--r--arch/ia64/lib/idiv64.S2
-rw-r--r--arch/ia64/lib/ip_fast_csum.S3
-rw-r--r--arch/ia64/lib/memcpy.S2
-rw-r--r--arch/ia64/lib/memcpy_mck.S3
-rw-r--r--arch/ia64/lib/memset.S2
-rw-r--r--arch/ia64/lib/strlen.S2
-rw-r--r--arch/ia64/lib/strlen_user.S2
-rw-r--r--arch/ia64/lib/strncpy_from_user.S2
-rw-r--r--arch/ia64/lib/strnlen_user.S2
-rw-r--r--arch/ia64/lib/xor.S5
-rw-r--r--arch/m68k/include/asm/export.h3
-rw-r--r--arch/m68k/kernel/Makefile2
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c32
-rw-r--r--arch/m68k/lib/ashldi3.c4
-rw-r--r--arch/m68k/lib/ashrdi3.c4
-rw-r--r--arch/m68k/lib/divsi3.S3
-rw-r--r--arch/m68k/lib/lshrdi3.c4
-rw-r--r--arch/m68k/lib/modsi3.S3
-rw-r--r--arch/m68k/lib/muldi3.c4
-rw-r--r--arch/m68k/lib/mulsi3.S4
-rw-r--r--arch/m68k/lib/udivsi3.S4
-rw-r--r--arch/m68k/lib/umodsi3.S4
-rw-r--r--arch/powerpc/include/asm/Kbuild1
-rw-r--r--arch/powerpc/kernel/Makefile4
-rw-r--r--arch/powerpc/kernel/entry_32.S2
-rw-r--r--arch/powerpc/kernel/entry_64.S3
-rw-r--r--arch/powerpc/kernel/epapr_hcalls.S2
-rw-r--r--arch/powerpc/kernel/fpu.S3
-rw-r--r--arch/powerpc/kernel/head_32.S5
-rw-r--r--arch/powerpc/kernel/head_40x.S2
-rw-r--r--arch/powerpc/kernel/head_44x.S2
-rw-r--r--arch/powerpc/kernel/head_64.S2
-rw-r--r--arch/powerpc/kernel/head_8xx.S2
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S2
-rw-r--r--arch/powerpc/kernel/misc.S2
-rw-r--r--arch/powerpc/kernel/misc_32.S10
-rw-r--r--arch/powerpc/kernel/misc_64.S4
-rw-r--r--arch/powerpc/kernel/pci-common.c1
-rw-r--r--arch/powerpc/kernel/pci_32.c2
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c37
-rw-r--r--arch/powerpc/kernel/ppc_ksyms_32.c60
-rw-r--r--arch/powerpc/kernel/setup_32.c6
-rw-r--r--arch/powerpc/kernel/time.c1
-rw-r--r--arch/powerpc/kernel/vector.S3
-rw-r--r--arch/powerpc/lib/Makefile2
-rw-r--r--arch/powerpc/lib/checksum_32.S3
-rw-r--r--arch/powerpc/lib/checksum_64.S3
-rw-r--r--arch/powerpc/lib/copy_32.S5
-rw-r--r--arch/powerpc/lib/copypage_64.S2
-rw-r--r--arch/powerpc/lib/copyuser_64.S2
-rw-r--r--arch/powerpc/lib/hweight_64.S5
-rw-r--r--arch/powerpc/lib/mem_64.S3
-rw-r--r--arch/powerpc/lib/memcmp_64.S2
-rw-r--r--arch/powerpc/lib/memcpy_64.S2
-rw-r--r--arch/powerpc/lib/ppc_ksyms.c29
-rw-r--r--arch/powerpc/lib/string.S6
-rw-r--r--arch/powerpc/lib/string_64.S2
-rw-r--r--arch/powerpc/mm/hash_low_32.S3
-rwxr-xr-xarch/powerpc/relocs_check.sh4
-rw-r--r--arch/powerpc/sysdev/dcr-low.S3
-rw-r--r--arch/s390/include/asm/Kbuild1
-rw-r--r--arch/s390/kernel/Makefile2
-rw-r--r--arch/s390/kernel/entry.S6
-rw-r--r--arch/s390/kernel/mcount.S3
-rw-r--r--arch/s390/kernel/s390_ksyms.c15
-rw-r--r--arch/s390/lib/mem.S3
-rw-r--r--arch/sparc/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/string.h34
-rw-r--r--arch/sparc/include/asm/string_32.h56
-rw-r--r--arch/sparc/include/asm/string_64.h44
-rw-r--r--arch/sparc/kernel/Makefile2
-rw-r--r--arch/sparc/kernel/entry.S3
-rw-r--r--arch/sparc/kernel/head_32.S3
-rw-r--r--arch/sparc/kernel/head_64.S7
-rw-r--r--arch/sparc/kernel/helpers.S2
-rw-r--r--arch/sparc/kernel/hvcalls.S5
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c12
-rw-r--r--arch/sparc/kernel/sparc_ksyms_32.c31
-rw-r--r--arch/sparc/kernel/sparc_ksyms_64.c53
-rw-r--r--arch/sparc/lib/Makefile1
-rw-r--r--arch/sparc/lib/U1memcpy.S2
-rw-r--r--arch/sparc/lib/VISsave.S2
-rw-r--r--arch/sparc/lib/ashldi3.S2
-rw-r--r--arch/sparc/lib/ashrdi3.S2
-rw-r--r--arch/sparc/lib/atomic_64.S16
-rw-r--r--arch/sparc/lib/bitops.S7
-rw-r--r--arch/sparc/lib/blockops.S3
-rw-r--r--arch/sparc/lib/bzero.S4
-rw-r--r--arch/sparc/lib/checksum_32.S3
-rw-r--r--arch/sparc/lib/checksum_64.S2
-rw-r--r--arch/sparc/lib/clear_page.S3
-rw-r--r--arch/sparc/lib/copy_in_user.S2
-rw-r--r--arch/sparc/lib/copy_page.S2
-rw-r--r--arch/sparc/lib/copy_user.S2
-rw-r--r--arch/sparc/lib/csum_copy.S3
-rw-r--r--arch/sparc/lib/divdi3.S2
-rw-r--r--arch/sparc/lib/ffs.S3
-rw-r--r--arch/sparc/lib/hweight.S5
-rw-r--r--arch/sparc/lib/ipcsum.S2
-rw-r--r--arch/sparc/lib/ksyms.c174
-rw-r--r--arch/sparc/lib/locks.S5
-rw-r--r--arch/sparc/lib/lshrdi3.S2
-rw-r--r--arch/sparc/lib/mcount.S2
-rw-r--r--arch/sparc/lib/memcmp.S2
-rw-r--r--arch/sparc/lib/memcpy.S86
-rw-r--r--arch/sparc/lib/memmove.S2
-rw-r--r--arch/sparc/lib/memscan_32.S4
-rw-r--r--arch/sparc/lib/memscan_64.S4
-rw-r--r--arch/sparc/lib/memset.S3
-rw-r--r--arch/sparc/lib/muldi3.S2
-rw-r--r--arch/sparc/lib/strlen.S2
-rw-r--r--arch/sparc/lib/strncmp_32.S2
-rw-r--r--arch/sparc/lib/strncmp_64.S2
-rw-r--r--arch/sparc/lib/xor.S9
-rw-r--r--arch/x86/entry/entry_32.S2
-rw-r--r--arch/x86/entry/entry_64.S2
-rw-r--r--arch/x86/entry/thunk_32.S3
-rw-r--r--arch/x86/entry/thunk_64.S3
-rw-r--r--arch/x86/include/asm/export.h4
-rw-r--r--arch/x86/kernel/Makefile4
-rw-r--r--arch/x86/kernel/head_32.S2
-rw-r--r--arch/x86/kernel/head_64.S3
-rw-r--r--arch/x86/kernel/i386_ksyms_32.c47
-rw-r--r--arch/x86/kernel/mcount_64.S2
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c85
-rw-r--r--arch/x86/lib/checksum_32.S3
-rw-r--r--arch/x86/lib/clear_page_64.S2
-rw-r--r--arch/x86/lib/cmpxchg8b_emu.S2
-rw-r--r--arch/x86/lib/copy_page_64.S2
-rw-r--r--arch/x86/lib/copy_user_64.S8
-rw-r--r--arch/x86/lib/csum-partial_64.c1
-rw-r--r--arch/x86/lib/getuser.S5
-rw-r--r--arch/x86/lib/hweight.S3
-rw-r--r--arch/x86/lib/memcpy_64.S4
-rw-r--r--arch/x86/lib/memmove_64.S3
-rw-r--r--arch/x86/lib/memset_64.S3
-rw-r--r--arch/x86/lib/putuser.S5
-rw-r--r--arch/x86/lib/strstr_32.c3
-rw-r--r--arch/x86/um/Makefile2
-rw-r--r--arch/x86/um/checksum_32.S2
-rw-r--r--arch/x86/um/ksyms.c13
-rw-r--r--include/asm-generic/export.h94
-rw-r--r--include/asm-generic/vmlinux.lds.h57
-rw-r--r--include/linux/compiler.h23
-rw-r--r--include/linux/export.h30
-rw-r--r--include/linux/init.h38
-rw-r--r--init/Makefile2
-rw-r--r--scripts/Makefile.build43
-rw-r--r--scripts/Makefile.modpost14
-rw-r--r--scripts/basic/fixdep.c86
-rwxr-xr-xscripts/gen_initramfs_list.sh5
-rw-r--r--scripts/genksyms/lex.l35
-rw-r--r--scripts/genksyms/lex.lex.c_shipped35
-rwxr-xr-xscripts/link-vmlinux.sh71
262 files changed, 1094 insertions, 1403 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 385a5ef41c17..9b9c4797fc55 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -41,6 +41,7 @@ This document describes the Linux kernel Makefiles.
41 --- 6.8 Custom kbuild commands 41 --- 6.8 Custom kbuild commands
42 --- 6.9 Preprocessing linker scripts 42 --- 6.9 Preprocessing linker scripts
43 --- 6.10 Generic header files 43 --- 6.10 Generic header files
44 --- 6.11 Post-link pass
44 45
45 === 7 Kbuild syntax for exported headers 46 === 7 Kbuild syntax for exported headers
46 --- 7.1 header-y 47 --- 7.1 header-y
@@ -1237,6 +1238,21 @@ When kbuild executes, the following steps are followed (roughly):
1237 to list the file in the Kbuild file. 1238 to list the file in the Kbuild file.
1238 See "7.4 generic-y" for further info on syntax etc. 1239 See "7.4 generic-y" for further info on syntax etc.
1239 1240
1241--- 6.11 Post-link pass
1242
1243 If the file arch/xxx/Makefile.postlink exists, this makefile
1244 will be invoked for post-link objects (vmlinux and modules.ko)
1245 for architectures to run post-link passes on. Must also handle
1246 the clean target.
1247
1248 This pass runs after kallsyms generation. If the architecture
1249 needs to modify symbol locations, rather than manipulate the
1250 kallsyms, it may be easier to add another postlink target for
1251 .tmp_vmlinux? targets to be called from link-vmlinux.sh.
1252
1253 For example, powerpc uses this to check relocation sanity of
1254 the linked vmlinux file.
1255
1240=== 7 Kbuild syntax for exported headers 1256=== 7 Kbuild syntax for exported headers
1241 1257
1242The kernel includes a set of headers that is exported to userspace. 1258The kernel includes a set of headers that is exported to userspace.
diff --git a/Makefile b/Makefile
index 27f97b53e6eb..fa2c3bd2aef9 100644
--- a/Makefile
+++ b/Makefile
@@ -623,6 +623,11 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
623KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) 623KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
624KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) 624KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
625 625
626ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
627KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
628KBUILD_CFLAGS += $(call cc-option,-fdata-sections,)
629endif
630
626ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 631ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
627KBUILD_CFLAGS += -Os 632KBUILD_CFLAGS += -Os
628else 633else
@@ -803,6 +808,10 @@ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
803KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 808KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
804LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 809LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
805 810
811ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
812LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
813endif
814
806ifeq ($(CONFIG_STRIP_ASM_SYMS),y) 815ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
807LDFLAGS_vmlinux += $(call ld-option, -X,) 816LDFLAGS_vmlinux += $(call ld-option, -X,)
808endif 817endif
@@ -942,9 +951,12 @@ endif
942include/generated/autoksyms.h: FORCE 951include/generated/autoksyms.h: FORCE
943 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh true 952 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh true
944 953
945# Final link of vmlinux 954ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
946 cmd_link-vmlinux = $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) 955
947quiet_cmd_link-vmlinux = LINK $@ 956# Final link of vmlinux with optional arch pass after final link
957 cmd_link-vmlinux = \
958 $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
959 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
948 960
949vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE 961vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE
950 +$(call if_changed,link-vmlinux) 962 +$(call if_changed,link-vmlinux)
@@ -1271,6 +1283,7 @@ $(clean-dirs):
1271 1283
1272vmlinuxclean: 1284vmlinuxclean:
1273 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean 1285 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
1286 $(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean)
1274 1287
1275clean: archclean vmlinuxclean 1288clean: archclean vmlinuxclean
1276 1289
diff --git a/arch/Kconfig b/arch/Kconfig
index 180ea33164dc..11d349561ece 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -450,6 +450,27 @@ config CC_STACKPROTECTOR_STRONG
450 450
451endchoice 451endchoice
452 452
453config THIN_ARCHIVES
454 bool
455 help
456 Select this if the architecture wants to use thin archives
457 instead of ld -r to create the built-in.o files.
458
459config LD_DEAD_CODE_DATA_ELIMINATION
460 bool
461 help
462 Select this if the architecture wants to do dead code and
463 data elimination with the linker by compiling with
464 -ffunction-sections -fdata-sections and linking with
465 --gc-sections.
466
467 This requires that the arch annotates or otherwise protects
468 its external entry points from being discarded. Linker scripts
469 must also merge .text.*, .data.*, and .bss.* correctly into
470 output sections. Care must be taken not to pull in unrelated
471 sections (e.g., '.text.init'). Typically '.' in section names
472 is used to distinguish them from label names / C identifiers.
473
453config HAVE_ARCH_WITHIN_STACK_FRAMES 474config HAVE_ARCH_WITHIN_STACK_FRAMES
454 bool 475 bool
455 help 476 help
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index ffd9cf5ec8c4..bf8475ce85ee 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -3,6 +3,7 @@
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += cputime.h 4generic-y += cputime.h
5generic-y += exec.h 5generic-y += exec.h
6generic-y += export.h
6generic-y += irq_work.h 7generic-y += irq_work.h
7generic-y += mcs_spinlock.h 8generic-y += mcs_spinlock.h
8generic-y += mm-arch-hooks.h 9generic-y += mm-arch-hooks.h
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
index 3ecac0106c8a..8ce13d7a2ad3 100644
--- a/arch/alpha/kernel/Makefile
+++ b/arch/alpha/kernel/Makefile
@@ -8,7 +8,7 @@ ccflags-y := -Wno-sign-compare
8 8
9obj-y := entry.o traps.o process.o osf_sys.o irq.o \ 9obj-y := entry.o traps.o process.o osf_sys.o irq.o \
10 irq_alpha.o signal.o setup.o ptrace.o time.o \ 10 irq_alpha.o signal.o setup.o ptrace.o time.o \
11 alpha_ksyms.o systbls.o err_common.o io.o 11 systbls.o err_common.o io.o
12 12
13obj-$(CONFIG_VGA_HOSE) += console.o 13obj-$(CONFIG_VGA_HOSE) += console.o
14obj-$(CONFIG_SMP) += smp.o 14obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
deleted file mode 100644
index f4c7ab6f43b0..000000000000
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ /dev/null
@@ -1,102 +0,0 @@
1/*
2 * linux/arch/alpha/kernel/alpha_ksyms.c
3 *
4 * Export the alpha-specific functions that are needed for loadable
5 * modules.
6 */
7
8#include <linux/module.h>
9#include <asm/console.h>
10#include <asm/uaccess.h>
11#include <asm/checksum.h>
12#include <asm/fpu.h>
13#include <asm/machvec.h>
14
15#include <linux/syscalls.h>
16
17/* these are C runtime functions with special calling conventions: */
18extern void __divl (void);
19extern void __reml (void);
20extern void __divq (void);
21extern void __remq (void);
22extern void __divlu (void);
23extern void __remlu (void);
24extern void __divqu (void);
25extern void __remqu (void);
26
27EXPORT_SYMBOL(alpha_mv);
28EXPORT_SYMBOL(callback_getenv);
29EXPORT_SYMBOL(callback_setenv);
30EXPORT_SYMBOL(callback_save_env);
31
32/* platform dependent support */
33EXPORT_SYMBOL(strcat);
34EXPORT_SYMBOL(strcpy);
35EXPORT_SYMBOL(strlen);
36EXPORT_SYMBOL(strncpy);
37EXPORT_SYMBOL(strncat);
38EXPORT_SYMBOL(strchr);
39EXPORT_SYMBOL(strrchr);
40EXPORT_SYMBOL(memmove);
41EXPORT_SYMBOL(__memcpy);
42EXPORT_SYMBOL(__memset);
43EXPORT_SYMBOL(___memset);
44EXPORT_SYMBOL(__memsetw);
45EXPORT_SYMBOL(__constant_c_memset);
46EXPORT_SYMBOL(copy_page);
47EXPORT_SYMBOL(clear_page);
48
49EXPORT_SYMBOL(alpha_read_fp_reg);
50EXPORT_SYMBOL(alpha_read_fp_reg_s);
51EXPORT_SYMBOL(alpha_write_fp_reg);
52EXPORT_SYMBOL(alpha_write_fp_reg_s);
53
54/* Networking helper routines. */
55EXPORT_SYMBOL(csum_tcpudp_magic);
56EXPORT_SYMBOL(ip_compute_csum);
57EXPORT_SYMBOL(ip_fast_csum);
58EXPORT_SYMBOL(csum_partial_copy_nocheck);
59EXPORT_SYMBOL(csum_partial_copy_from_user);
60EXPORT_SYMBOL(csum_ipv6_magic);
61
62#ifdef CONFIG_MATHEMU_MODULE
63extern long (*alpha_fp_emul_imprecise)(struct pt_regs *, unsigned long);
64extern long (*alpha_fp_emul) (unsigned long pc);
65EXPORT_SYMBOL(alpha_fp_emul_imprecise);
66EXPORT_SYMBOL(alpha_fp_emul);
67#endif
68
69/*
70 * The following are specially called from the uaccess assembly stubs.
71 */
72EXPORT_SYMBOL(__copy_user);
73EXPORT_SYMBOL(__do_clear_user);
74
75/*
76 * SMP-specific symbols.
77 */
78
79#ifdef CONFIG_SMP
80EXPORT_SYMBOL(_atomic_dec_and_lock);
81#endif /* CONFIG_SMP */
82
83/*
84 * The following are special because they're not called
85 * explicitly (the C compiler or assembler generates them in
86 * response to division operations). Fortunately, their
87 * interface isn't gonna change any time soon now, so it's OK
88 * to leave it out of version control.
89 */
90# undef memcpy
91# undef memset
92EXPORT_SYMBOL(__divl);
93EXPORT_SYMBOL(__divlu);
94EXPORT_SYMBOL(__divq);
95EXPORT_SYMBOL(__divqu);
96EXPORT_SYMBOL(__reml);
97EXPORT_SYMBOL(__remlu);
98EXPORT_SYMBOL(__remq);
99EXPORT_SYMBOL(__remqu);
100EXPORT_SYMBOL(memcpy);
101EXPORT_SYMBOL(memset);
102EXPORT_SYMBOL(memchr);
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
index d3398f6ab74c..b7d69604b6d2 100644
--- a/arch/alpha/kernel/machvec_impl.h
+++ b/arch/alpha/kernel/machvec_impl.h
@@ -144,9 +144,11 @@
144 else beforehand. Fine. We'll do it ourselves. */ 144 else beforehand. Fine. We'll do it ourselves. */
145#if 0 145#if 0
146#define ALIAS_MV(system) \ 146#define ALIAS_MV(system) \
147 struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv"))); 147 struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv"))); \
148 EXPORT_SYMBOL(alpha_mv);
148#else 149#else
149#define ALIAS_MV(system) \ 150#define ALIAS_MV(system) \
150 asm(".global alpha_mv\nalpha_mv = " #system "_mv"); 151 asm(".global alpha_mv\nalpha_mv = " #system "_mv"); \
152 EXPORT_SYMBOL(alpha_mv);
151#endif 153#endif
152#endif /* GENERIC */ 154#endif /* GENERIC */
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index b20af76f12c1..4811e54069fc 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -115,6 +115,7 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE;
115 115
116#ifdef CONFIG_ALPHA_GENERIC 116#ifdef CONFIG_ALPHA_GENERIC
117struct alpha_machine_vector alpha_mv; 117struct alpha_machine_vector alpha_mv;
118EXPORT_SYMBOL(alpha_mv);
118#endif 119#endif
119 120
120#ifndef alpha_using_srm 121#ifndef alpha_using_srm
diff --git a/arch/alpha/lib/callback_srm.S b/arch/alpha/lib/callback_srm.S
index 8804bec2c644..6093addc931a 100644
--- a/arch/alpha/lib/callback_srm.S
+++ b/arch/alpha/lib/callback_srm.S
@@ -3,6 +3,7 @@
3 */ 3 */
4 4
5#include <asm/console.h> 5#include <asm/console.h>
6#include <asm/export.h>
6 7
7.text 8.text
8#define HWRPB_CRB_OFFSET 0xc0 9#define HWRPB_CRB_OFFSET 0xc0
@@ -92,6 +93,10 @@ CALLBACK(reset_env, CCB_RESET_ENV, 4)
92CALLBACK(save_env, CCB_SAVE_ENV, 1) 93CALLBACK(save_env, CCB_SAVE_ENV, 1)
93CALLBACK(pswitch, CCB_PSWITCH, 3) 94CALLBACK(pswitch, CCB_PSWITCH, 3)
94CALLBACK(bios_emul, CCB_BIOS_EMUL, 5) 95CALLBACK(bios_emul, CCB_BIOS_EMUL, 5)
96
97EXPORT_SYMBOL(callback_getenv)
98EXPORT_SYMBOL(callback_setenv)
99EXPORT_SYMBOL(callback_save_env)
95 100
96.data 101.data
97__alpha_using_srm: # For use by bootpheader 102__alpha_using_srm: # For use by bootpheader
diff --git a/arch/alpha/lib/checksum.c b/arch/alpha/lib/checksum.c
index 377f9e34eb97..b57f8007db14 100644
--- a/arch/alpha/lib/checksum.c
+++ b/arch/alpha/lib/checksum.c
@@ -48,6 +48,7 @@ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
48 (__force u64)saddr + (__force u64)daddr + 48 (__force u64)saddr + (__force u64)daddr +
49 (__force u64)sum + ((len + proto) << 8)); 49 (__force u64)sum + ((len + proto) << 8));
50} 50}
51EXPORT_SYMBOL(csum_tcpudp_magic);
51 52
52__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, 53__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
53 __u32 len, __u8 proto, __wsum sum) 54 __u32 len, __u8 proto, __wsum sum)
@@ -144,6 +145,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
144{ 145{
145 return (__force __sum16)~do_csum(iph,ihl*4); 146 return (__force __sum16)~do_csum(iph,ihl*4);
146} 147}
148EXPORT_SYMBOL(ip_fast_csum);
147 149
148/* 150/*
149 * computes the checksum of a memory block at buff, length len, 151 * computes the checksum of a memory block at buff, length len,
@@ -178,3 +180,4 @@ __sum16 ip_compute_csum(const void *buff, int len)
178{ 180{
179 return (__force __sum16)~from64to16(do_csum(buff,len)); 181 return (__force __sum16)~from64to16(do_csum(buff,len));
180} 182}
183EXPORT_SYMBOL(ip_compute_csum);
diff --git a/arch/alpha/lib/clear_page.S b/arch/alpha/lib/clear_page.S
index a221ae266e29..263d7393c0e7 100644
--- a/arch/alpha/lib/clear_page.S
+++ b/arch/alpha/lib/clear_page.S
@@ -3,7 +3,7 @@
3 * 3 *
4 * Zero an entire page. 4 * Zero an entire page.
5 */ 5 */
6 6#include <asm/export.h>
7 .text 7 .text
8 .align 4 8 .align 4
9 .global clear_page 9 .global clear_page
@@ -37,3 +37,4 @@ clear_page:
37 nop 37 nop
38 38
39 .end clear_page 39 .end clear_page
40 EXPORT_SYMBOL(clear_page)
diff --git a/arch/alpha/lib/clear_user.S b/arch/alpha/lib/clear_user.S
index 8860316c1957..bf5b931866ba 100644
--- a/arch/alpha/lib/clear_user.S
+++ b/arch/alpha/lib/clear_user.S
@@ -24,6 +24,7 @@
24 * Clobbers: 24 * Clobbers:
25 * $1,$2,$3,$4,$5,$6 25 * $1,$2,$3,$4,$5,$6
26 */ 26 */
27#include <asm/export.h>
27 28
28/* Allow an exception for an insn; exit if we get one. */ 29/* Allow an exception for an insn; exit if we get one. */
29#define EX(x,y...) \ 30#define EX(x,y...) \
@@ -111,3 +112,4 @@ $exception:
111 ret $31, ($28), 1 # .. e1 : 112 ret $31, ($28), 1 # .. e1 :
112 113
113 .end __do_clear_user 114 .end __do_clear_user
115 EXPORT_SYMBOL(__do_clear_user)
diff --git a/arch/alpha/lib/copy_page.S b/arch/alpha/lib/copy_page.S
index 9f3b97459cc6..2ee0bd0508c5 100644
--- a/arch/alpha/lib/copy_page.S
+++ b/arch/alpha/lib/copy_page.S
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copy an entire page. 4 * Copy an entire page.
5 */ 5 */
6 6#include <asm/export.h>
7 .text 7 .text
8 .align 4 8 .align 4
9 .global copy_page 9 .global copy_page
@@ -47,3 +47,4 @@ copy_page:
47 nop 47 nop
48 48
49 .end copy_page 49 .end copy_page
50 EXPORT_SYMBOL(copy_page)
diff --git a/arch/alpha/lib/copy_user.S b/arch/alpha/lib/copy_user.S
index 6f3fab9eb434..2238068b1b40 100644
--- a/arch/alpha/lib/copy_user.S
+++ b/arch/alpha/lib/copy_user.S
@@ -26,6 +26,8 @@
26 * $1,$2,$3,$4,$5,$6,$7 26 * $1,$2,$3,$4,$5,$6,$7
27 */ 27 */
28 28
29#include <asm/export.h>
30
29/* Allow an exception for an insn; exit if we get one. */ 31/* Allow an exception for an insn; exit if we get one. */
30#define EXI(x,y...) \ 32#define EXI(x,y...) \
31 99: x,##y; \ 33 99: x,##y; \
@@ -143,3 +145,4 @@ $101:
143 ret $31,($28),1 145 ret $31,($28),1
144 146
145 .end __copy_user 147 .end __copy_user
148EXPORT_SYMBOL(__copy_user)
diff --git a/arch/alpha/lib/csum_ipv6_magic.S b/arch/alpha/lib/csum_ipv6_magic.S
index 2c2acb96deb6..e74b4544b0cc 100644
--- a/arch/alpha/lib/csum_ipv6_magic.S
+++ b/arch/alpha/lib/csum_ipv6_magic.S
@@ -12,6 +12,7 @@
12 * added by Ivan Kokshaysky <ink@jurassic.park.msu.ru> 12 * added by Ivan Kokshaysky <ink@jurassic.park.msu.ru>
13 */ 13 */
14 14
15#include <asm/export.h>
15 .globl csum_ipv6_magic 16 .globl csum_ipv6_magic
16 .align 4 17 .align 4
17 .ent csum_ipv6_magic 18 .ent csum_ipv6_magic
@@ -113,3 +114,4 @@ csum_ipv6_magic:
113 ret # .. e1 : 114 ret # .. e1 :
114 115
115 .end csum_ipv6_magic 116 .end csum_ipv6_magic
117 EXPORT_SYMBOL(csum_ipv6_magic)
diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
index 5675dca8dbb1..b4ff3b683bcd 100644
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -374,6 +374,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
374 } 374 }
375 return (__force __wsum)checksum; 375 return (__force __wsum)checksum;
376} 376}
377EXPORT_SYMBOL(csum_partial_copy_from_user);
377 378
378__wsum 379__wsum
379csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) 380csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
@@ -386,3 +387,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
386 set_fs(oldfs); 387 set_fs(oldfs);
387 return checksum; 388 return checksum;
388} 389}
390EXPORT_SYMBOL(csum_partial_copy_nocheck);
diff --git a/arch/alpha/lib/dec_and_lock.c b/arch/alpha/lib/dec_and_lock.c
index f9f5fe830e9f..4221b40167ee 100644
--- a/arch/alpha/lib/dec_and_lock.c
+++ b/arch/alpha/lib/dec_and_lock.c
@@ -7,6 +7,7 @@
7 7
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <linux/atomic.h> 9#include <linux/atomic.h>
10#include <linux/export.h>
10 11
11 asm (".text \n\ 12 asm (".text \n\
12 .global _atomic_dec_and_lock \n\ 13 .global _atomic_dec_and_lock \n\
@@ -39,3 +40,4 @@ static int __used atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock)
39 spin_unlock(lock); 40 spin_unlock(lock);
40 return 0; 41 return 0;
41} 42}
43EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/alpha/lib/divide.S b/arch/alpha/lib/divide.S
index 2d1a0484a99e..1e33bd127621 100644
--- a/arch/alpha/lib/divide.S
+++ b/arch/alpha/lib/divide.S
@@ -45,6 +45,7 @@
45 * $28 - compare status 45 * $28 - compare status
46 */ 46 */
47 47
48#include <asm/export.h>
48#define halt .long 0 49#define halt .long 0
49 50
50/* 51/*
@@ -151,6 +152,7 @@ ufunction:
151 addq $30,STACK,$30 152 addq $30,STACK,$30
152 ret $31,($23),1 153 ret $31,($23),1
153 .end ufunction 154 .end ufunction
155EXPORT_SYMBOL(ufunction)
154 156
155/* 157/*
156 * Uhh.. Ugly signed division. I'd rather not have it at all, but 158 * Uhh.. Ugly signed division. I'd rather not have it at all, but
@@ -193,3 +195,4 @@ sfunction:
193 addq $30,STACK,$30 195 addq $30,STACK,$30
194 ret $31,($23),1 196 ret $31,($23),1
195 .end sfunction 197 .end sfunction
198EXPORT_SYMBOL(sfunction)
diff --git a/arch/alpha/lib/ev6-clear_page.S b/arch/alpha/lib/ev6-clear_page.S
index adf4f7be0e2b..abe99e69a194 100644
--- a/arch/alpha/lib/ev6-clear_page.S
+++ b/arch/alpha/lib/ev6-clear_page.S
@@ -3,7 +3,7 @@
3 * 3 *
4 * Zero an entire page. 4 * Zero an entire page.
5 */ 5 */
6 6#include <asm/export.h>
7 .text 7 .text
8 .align 4 8 .align 4
9 .global clear_page 9 .global clear_page
@@ -52,3 +52,4 @@ clear_page:
52 nop 52 nop
53 53
54 .end clear_page 54 .end clear_page
55 EXPORT_SYMBOL(clear_page)
diff --git a/arch/alpha/lib/ev6-clear_user.S b/arch/alpha/lib/ev6-clear_user.S
index 4f42a16b7f53..05bef6b50598 100644
--- a/arch/alpha/lib/ev6-clear_user.S
+++ b/arch/alpha/lib/ev6-clear_user.S
@@ -43,6 +43,7 @@
43 * want to leave a hole (and we also want to avoid repeating lots of work) 43 * want to leave a hole (and we also want to avoid repeating lots of work)
44 */ 44 */
45 45
46#include <asm/export.h>
46/* Allow an exception for an insn; exit if we get one. */ 47/* Allow an exception for an insn; exit if we get one. */
47#define EX(x,y...) \ 48#define EX(x,y...) \
48 99: x,##y; \ 49 99: x,##y; \
@@ -222,4 +223,4 @@ $exception: # Destination for exception recovery(?)
222 nop # .. E .. .. : 223 nop # .. E .. .. :
223 ret $31, ($28), 1 # L0 .. .. .. : L U L U 224 ret $31, ($28), 1 # L0 .. .. .. : L U L U
224 .end __do_clear_user 225 .end __do_clear_user
225 226 EXPORT_SYMBOL(__do_clear_user)
diff --git a/arch/alpha/lib/ev6-copy_page.S b/arch/alpha/lib/ev6-copy_page.S
index b789db192754..77935061bddb 100644
--- a/arch/alpha/lib/ev6-copy_page.S
+++ b/arch/alpha/lib/ev6-copy_page.S
@@ -56,7 +56,7 @@
56 destination pages are in the dcache, but it is my guess that this is 56 destination pages are in the dcache, but it is my guess that this is
57 less important than the dcache miss case. */ 57 less important than the dcache miss case. */
58 58
59 59#include <asm/export.h>
60 .text 60 .text
61 .align 4 61 .align 4
62 .global copy_page 62 .global copy_page
@@ -201,3 +201,4 @@ copy_page:
201 nop 201 nop
202 202
203 .end copy_page 203 .end copy_page
204 EXPORT_SYMBOL(copy_page)
diff --git a/arch/alpha/lib/ev6-copy_user.S b/arch/alpha/lib/ev6-copy_user.S
index db42ffe9c350..debcc3b6b704 100644
--- a/arch/alpha/lib/ev6-copy_user.S
+++ b/arch/alpha/lib/ev6-copy_user.S
@@ -37,6 +37,7 @@
37 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 37 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1
38 */ 38 */
39 39
40#include <asm/export.h>
40/* Allow an exception for an insn; exit if we get one. */ 41/* Allow an exception for an insn; exit if we get one. */
41#define EXI(x,y...) \ 42#define EXI(x,y...) \
42 99: x,##y; \ 43 99: x,##y; \
@@ -256,4 +257,4 @@ $101:
256 ret $31,($28),1 # L0 257 ret $31,($28),1 # L0
257 258
258 .end __copy_user 259 .end __copy_user
259 260 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 fc0bc399f872..de62627ac4fe 100644
--- a/arch/alpha/lib/ev6-csum_ipv6_magic.S
+++ b/arch/alpha/lib/ev6-csum_ipv6_magic.S
@@ -52,6 +52,7 @@
52 * may cause additional delay in rare cases (load-load replay traps). 52 * may cause additional delay in rare cases (load-load replay traps).
53 */ 53 */
54 54
55#include <asm/export.h>
55 .globl csum_ipv6_magic 56 .globl csum_ipv6_magic
56 .align 4 57 .align 4
57 .ent csum_ipv6_magic 58 .ent csum_ipv6_magic
@@ -148,3 +149,4 @@ csum_ipv6_magic:
148 ret # L0 : L U L U 149 ret # L0 : L U L U
149 150
150 .end csum_ipv6_magic 151 .end csum_ipv6_magic
152 EXPORT_SYMBOL(csum_ipv6_magic)
diff --git a/arch/alpha/lib/ev6-divide.S b/arch/alpha/lib/ev6-divide.S
index 2a82b9be93fa..d18dc0e96e3d 100644
--- a/arch/alpha/lib/ev6-divide.S
+++ b/arch/alpha/lib/ev6-divide.S
@@ -55,6 +55,7 @@
55 * Try not to change the actual algorithm if possible for consistency. 55 * Try not to change the actual algorithm if possible for consistency.
56 */ 56 */
57 57
58#include <asm/export.h>
58#define halt .long 0 59#define halt .long 0
59 60
60/* 61/*
@@ -205,6 +206,7 @@ ufunction:
205 addq $30,STACK,$30 # E : 206 addq $30,STACK,$30 # E :
206 ret $31,($23),1 # L0 : L U U L 207 ret $31,($23),1 # L0 : L U U L
207 .end ufunction 208 .end ufunction
209EXPORT_SYMBOL(ufunction)
208 210
209/* 211/*
210 * Uhh.. Ugly signed division. I'd rather not have it at all, but 212 * Uhh.. Ugly signed division. I'd rather not have it at all, but
@@ -257,3 +259,4 @@ sfunction:
257 addq $30,STACK,$30 # E : 259 addq $30,STACK,$30 # E :
258 ret $31,($23),1 # L0 : L U U L 260 ret $31,($23),1 # L0 : L U U L
259 .end sfunction 261 .end sfunction
262EXPORT_SYMBOL(sfunction)
diff --git a/arch/alpha/lib/ev6-memchr.S b/arch/alpha/lib/ev6-memchr.S
index 1a5f71b9d8b1..419adc53ccb4 100644
--- a/arch/alpha/lib/ev6-memchr.S
+++ b/arch/alpha/lib/ev6-memchr.S
@@ -27,7 +27,7 @@
27 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 27 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1
28 * Try not to change the actual algorithm if possible for consistency. 28 * Try not to change the actual algorithm if possible for consistency.
29 */ 29 */
30 30#include <asm/export.h>
31 .set noreorder 31 .set noreorder
32 .set noat 32 .set noat
33 33
@@ -189,3 +189,4 @@ $not_found:
189 ret # L0 : 189 ret # L0 :
190 190
191 .end memchr 191 .end memchr
192 EXPORT_SYMBOL(memchr)
diff --git a/arch/alpha/lib/ev6-memcpy.S b/arch/alpha/lib/ev6-memcpy.S
index 52b37b0f2af5..b19798b2efc0 100644
--- a/arch/alpha/lib/ev6-memcpy.S
+++ b/arch/alpha/lib/ev6-memcpy.S
@@ -19,7 +19,7 @@
19 * Temp usage notes: 19 * Temp usage notes:
20 * $1,$2, - scratch 20 * $1,$2, - scratch
21 */ 21 */
22 22#include <asm/export.h>
23 .set noreorder 23 .set noreorder
24 .set noat 24 .set noat
25 25
@@ -242,6 +242,7 @@ $nomoredata:
242 nop # E : 242 nop # E :
243 243
244 .end memcpy 244 .end memcpy
245 EXPORT_SYMBOL(memcpy)
245 246
246/* For backwards module compatibility. */ 247/* For backwards module compatibility. */
247__memcpy = memcpy 248__memcpy = memcpy
diff --git a/arch/alpha/lib/ev6-memset.S b/arch/alpha/lib/ev6-memset.S
index 356bb2fdd705..fed21c6893e8 100644
--- a/arch/alpha/lib/ev6-memset.S
+++ b/arch/alpha/lib/ev6-memset.S
@@ -26,7 +26,7 @@
26 * as fixes will need to be made in multiple places. The performance gain 26 * as fixes will need to be made in multiple places. The performance gain
27 * is worth it. 27 * is worth it.
28 */ 28 */
29 29#include <asm/export.h>
30 .set noat 30 .set noat
31 .set noreorder 31 .set noreorder
32.text 32.text
@@ -229,6 +229,7 @@ end_b:
229 nop 229 nop
230 ret $31,($26),1 # L0 : 230 ret $31,($26),1 # L0 :
231 .end ___memset 231 .end ___memset
232 EXPORT_SYMBOL(___memset)
232 233
233 /* 234 /*
234 * This is the original body of code, prior to replication and 235 * This is the original body of code, prior to replication and
@@ -406,6 +407,7 @@ end:
406 nop 407 nop
407 ret $31,($26),1 # L0 : 408 ret $31,($26),1 # L0 :
408 .end __constant_c_memset 409 .end __constant_c_memset
410 EXPORT_SYMBOL(__constant_c_memset)
409 411
410 /* 412 /*
411 * This is a replicant of the __constant_c_memset code, rescheduled 413 * This is a replicant of the __constant_c_memset code, rescheduled
@@ -594,6 +596,9 @@ end_w:
594 ret $31,($26),1 # L0 : 596 ret $31,($26),1 # L0 :
595 597
596 .end __memsetw 598 .end __memsetw
599 EXPORT_SYMBOL(__memsetw)
597 600
598memset = ___memset 601memset = ___memset
599__memset = ___memset 602__memset = ___memset
603 EXPORT_SYMBOL(memset)
604 EXPORT_SYMBOL(__memset)
diff --git a/arch/alpha/lib/ev67-strcat.S b/arch/alpha/lib/ev67-strcat.S
index c426fe3ed72f..b69f60419be1 100644
--- a/arch/alpha/lib/ev67-strcat.S
+++ b/arch/alpha/lib/ev67-strcat.S
@@ -19,7 +19,7 @@
19 * string once. 19 * string once.
20 */ 20 */
21 21
22 22#include <asm/export.h>
23 .text 23 .text
24 24
25 .align 4 25 .align 4
@@ -52,3 +52,4 @@ $found: cttz $2, $3 # U0 :
52 br __stxcpy # L0 : 52 br __stxcpy # L0 :
53 53
54 .end strcat 54 .end strcat
55 EXPORT_SYMBOL(strcat)
diff --git a/arch/alpha/lib/ev67-strchr.S b/arch/alpha/lib/ev67-strchr.S
index fbb7b4ffade9..ea8f2f35db9c 100644
--- a/arch/alpha/lib/ev67-strchr.S
+++ b/arch/alpha/lib/ev67-strchr.S
@@ -15,7 +15,7 @@
15 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 15 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1
16 * Try not to change the actual algorithm if possible for consistency. 16 * Try not to change the actual algorithm if possible for consistency.
17 */ 17 */
18 18#include <asm/export.h>
19#include <asm/regdef.h> 19#include <asm/regdef.h>
20 20
21 .set noreorder 21 .set noreorder
@@ -86,3 +86,4 @@ $found: negq t0, t1 # E : clear all but least set bit
86 ret # L0 : 86 ret # L0 :
87 87
88 .end strchr 88 .end strchr
89 EXPORT_SYMBOL(strchr)
diff --git a/arch/alpha/lib/ev67-strlen.S b/arch/alpha/lib/ev67-strlen.S
index 503928072523..736fd41884a8 100644
--- a/arch/alpha/lib/ev67-strlen.S
+++ b/arch/alpha/lib/ev67-strlen.S
@@ -17,7 +17,7 @@
17 * U - upper subcluster; U0 - subcluster U0; U1 - subcluster U1 17 * U - upper subcluster; U0 - subcluster U0; U1 - subcluster U1
18 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 18 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1
19 */ 19 */
20 20#include <asm/export.h>
21 .set noreorder 21 .set noreorder
22 .set noat 22 .set noat
23 23
@@ -47,3 +47,4 @@ $found:
47 ret $31, ($26) # L0 : 47 ret $31, ($26) # L0 :
48 48
49 .end strlen 49 .end strlen
50 EXPORT_SYMBOL(strlen)
diff --git a/arch/alpha/lib/ev67-strncat.S b/arch/alpha/lib/ev67-strncat.S
index 4ae716cd2bfb..cd35cbade73a 100644
--- a/arch/alpha/lib/ev67-strncat.S
+++ b/arch/alpha/lib/ev67-strncat.S
@@ -20,7 +20,7 @@
20 * Try not to change the actual algorithm if possible for consistency. 20 * Try not to change the actual algorithm if possible for consistency.
21 */ 21 */
22 22
23 23#include <asm/export.h>
24 .text 24 .text
25 25
26 .align 4 26 .align 4
@@ -92,3 +92,4 @@ $zerocount:
92 ret # L0 : 92 ret # L0 :
93 93
94 .end strncat 94 .end strncat
95 EXPORT_SYMBOL(strncat)
diff --git a/arch/alpha/lib/ev67-strrchr.S b/arch/alpha/lib/ev67-strrchr.S
index dd0d8c6b9f59..747455f0328c 100644
--- a/arch/alpha/lib/ev67-strrchr.S
+++ b/arch/alpha/lib/ev67-strrchr.S
@@ -18,7 +18,7 @@
18 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 18 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1
19 */ 19 */
20 20
21 21#include <asm/export.h>
22#include <asm/regdef.h> 22#include <asm/regdef.h>
23 23
24 .set noreorder 24 .set noreorder
@@ -107,3 +107,4 @@ $eos:
107 nop 107 nop
108 108
109 .end strrchr 109 .end strrchr
110 EXPORT_SYMBOL(strrchr)
diff --git a/arch/alpha/lib/fpreg.c b/arch/alpha/lib/fpreg.c
index 05017ba34c3c..4aa6dbfa14ee 100644
--- a/arch/alpha/lib/fpreg.c
+++ b/arch/alpha/lib/fpreg.c
@@ -4,6 +4,9 @@
4 * (C) Copyright 1998 Linus Torvalds 4 * (C) Copyright 1998 Linus Torvalds
5 */ 5 */
6 6
7#include <linux/compiler.h>
8#include <linux/export.h>
9
7#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 10#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
8#define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val)); 11#define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val));
9#else 12#else
@@ -52,6 +55,7 @@ alpha_read_fp_reg (unsigned long reg)
52 } 55 }
53 return val; 56 return val;
54} 57}
58EXPORT_SYMBOL(alpha_read_fp_reg);
55 59
56#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 60#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
57#define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val)); 61#define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val));
@@ -97,6 +101,7 @@ alpha_write_fp_reg (unsigned long reg, unsigned long val)
97 case 31: LDT(31, val); break; 101 case 31: LDT(31, val); break;
98 } 102 }
99} 103}
104EXPORT_SYMBOL(alpha_write_fp_reg);
100 105
101#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 106#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
102#define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val)); 107#define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val));
@@ -146,6 +151,7 @@ alpha_read_fp_reg_s (unsigned long reg)
146 } 151 }
147 return val; 152 return val;
148} 153}
154EXPORT_SYMBOL(alpha_read_fp_reg_s);
149 155
150#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 156#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
151#define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val)); 157#define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val));
@@ -191,3 +197,4 @@ alpha_write_fp_reg_s (unsigned long reg, unsigned long val)
191 case 31: LDS(31, val); break; 197 case 31: LDS(31, val); break;
192 } 198 }
193} 199}
200EXPORT_SYMBOL(alpha_write_fp_reg_s);
diff --git a/arch/alpha/lib/memchr.S b/arch/alpha/lib/memchr.S
index 14427eeb555e..c13d3eca2e05 100644
--- a/arch/alpha/lib/memchr.S
+++ b/arch/alpha/lib/memchr.S
@@ -31,7 +31,7 @@ For correctness consider that:
31 - only minimum number of quadwords may be accessed 31 - only minimum number of quadwords may be accessed
32 - the third argument is an unsigned long 32 - the third argument is an unsigned long
33*/ 33*/
34 34#include <asm/export.h>
35 .set noreorder 35 .set noreorder
36 .set noat 36 .set noat
37 37
@@ -162,3 +162,4 @@ $not_found:
162 ret # .. e1 : 162 ret # .. e1 :
163 163
164 .end memchr 164 .end memchr
165 EXPORT_SYMBOL(memchr)
diff --git a/arch/alpha/lib/memcpy.c b/arch/alpha/lib/memcpy.c
index 64083fc73238..57d9291ad172 100644
--- a/arch/alpha/lib/memcpy.c
+++ b/arch/alpha/lib/memcpy.c
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/export.h>
19 20
20/* 21/*
21 * This should be done in one go with ldq_u*2/mask/stq_u. Do it 22 * This should be done in one go with ldq_u*2/mask/stq_u. Do it
@@ -158,6 +159,4 @@ void * memcpy(void * dest, const void *src, size_t n)
158 __memcpy_unaligned_up ((unsigned long) dest, (unsigned long) src, n); 159 __memcpy_unaligned_up ((unsigned long) dest, (unsigned long) src, n);
159 return dest; 160 return dest;
160} 161}
161 162EXPORT_SYMBOL(memcpy);
162/* For backward modules compatibility, define __memcpy. */
163asm("__memcpy = memcpy; .globl __memcpy");
diff --git a/arch/alpha/lib/memmove.S b/arch/alpha/lib/memmove.S
index eb3b6e02242f..6872c85cb5e5 100644
--- a/arch/alpha/lib/memmove.S
+++ b/arch/alpha/lib/memmove.S
@@ -6,7 +6,7 @@
6 * This is hand-massaged output from the original memcpy.c. We defer to 6 * This is hand-massaged output from the original memcpy.c. We defer to
7 * memcpy whenever possible; the backwards copy loops are not unrolled. 7 * memcpy whenever possible; the backwards copy loops are not unrolled.
8 */ 8 */
9 9#include <asm/export.h>
10 .set noat 10 .set noat
11 .set noreorder 11 .set noreorder
12 .text 12 .text
@@ -179,3 +179,4 @@ $egress:
179 nop 179 nop
180 180
181 .end memmove 181 .end memmove
182 EXPORT_SYMBOL(memmove)
diff --git a/arch/alpha/lib/memset.S b/arch/alpha/lib/memset.S
index 76ccc6d1f364..89a26f5e89de 100644
--- a/arch/alpha/lib/memset.S
+++ b/arch/alpha/lib/memset.S
@@ -13,7 +13,7 @@
13 * The scheduling comments are according to the EV5 documentation (and done by 13 * The scheduling comments are according to the EV5 documentation (and done by
14 * hand, so they might well be incorrect, please do tell me about it..) 14 * hand, so they might well be incorrect, please do tell me about it..)
15 */ 15 */
16 16#include <asm/export.h>
17 .set noat 17 .set noat
18 .set noreorder 18 .set noreorder
19.text 19.text
@@ -106,6 +106,8 @@ within_one_quad:
106end: 106end:
107 ret $31,($26),1 /* E1 */ 107 ret $31,($26),1 /* E1 */
108 .end ___memset 108 .end ___memset
109EXPORT_SYMBOL(___memset)
110EXPORT_SYMBOL(__constant_c_memset)
109 111
110 .align 5 112 .align 5
111 .ent __memsetw 113 .ent __memsetw
@@ -122,6 +124,9 @@ __memsetw:
122 br __constant_c_memset /* .. E1 */ 124 br __constant_c_memset /* .. E1 */
123 125
124 .end __memsetw 126 .end __memsetw
127EXPORT_SYMBOL(__memsetw)
125 128
126memset = ___memset 129memset = ___memset
127__memset = ___memset 130__memset = ___memset
131 EXPORT_SYMBOL(memset)
132 EXPORT_SYMBOL(__memset)
diff --git a/arch/alpha/lib/strcat.S b/arch/alpha/lib/strcat.S
index 393f50384878..249837b03d4b 100644
--- a/arch/alpha/lib/strcat.S
+++ b/arch/alpha/lib/strcat.S
@@ -4,6 +4,7 @@
4 * 4 *
5 * Append a null-terminated string from SRC to DST. 5 * Append a null-terminated string from SRC to DST.
6 */ 6 */
7#include <asm/export.h>
7 8
8 .text 9 .text
9 10
@@ -50,3 +51,4 @@ $found: negq $2, $3 # clear all but least set bit
50 br __stxcpy 51 br __stxcpy
51 52
52 .end strcat 53 .end strcat
54EXPORT_SYMBOL(strcat);
diff --git a/arch/alpha/lib/strchr.S b/arch/alpha/lib/strchr.S
index 011a175e8329..7412a173ea39 100644
--- a/arch/alpha/lib/strchr.S
+++ b/arch/alpha/lib/strchr.S
@@ -5,7 +5,7 @@
5 * Return the address of a given character within a null-terminated 5 * Return the address of a given character within a null-terminated
6 * string, or null if it is not found. 6 * string, or null if it is not found.
7 */ 7 */
8 8#include <asm/export.h>
9#include <asm/regdef.h> 9#include <asm/regdef.h>
10 10
11 .set noreorder 11 .set noreorder
@@ -68,3 +68,4 @@ $retnull:
68 ret # .. e1 : 68 ret # .. e1 :
69 69
70 .end strchr 70 .end strchr
71 EXPORT_SYMBOL(strchr)
diff --git a/arch/alpha/lib/strcpy.S b/arch/alpha/lib/strcpy.S
index e0728e4ad21f..98deae1e4d08 100644
--- a/arch/alpha/lib/strcpy.S
+++ b/arch/alpha/lib/strcpy.S
@@ -5,7 +5,7 @@
5 * Copy a null-terminated string from SRC to DST. Return a pointer 5 * Copy a null-terminated string from SRC to DST. Return a pointer
6 * to the null-terminator in the source. 6 * to the null-terminator in the source.
7 */ 7 */
8 8#include <asm/export.h>
9 .text 9 .text
10 10
11 .align 3 11 .align 3
@@ -21,3 +21,4 @@ strcpy:
21 br __stxcpy # do the copy 21 br __stxcpy # do the copy
22 22
23 .end strcpy 23 .end strcpy
24 EXPORT_SYMBOL(strcpy)
diff --git a/arch/alpha/lib/strlen.S b/arch/alpha/lib/strlen.S
index fe63353de152..79c416f71bac 100644
--- a/arch/alpha/lib/strlen.S
+++ b/arch/alpha/lib/strlen.S
@@ -11,7 +11,7 @@
11 * do this instead of the 9 instructions that 11 * do this instead of the 9 instructions that
12 * binary search needs). 12 * binary search needs).
13 */ 13 */
14 14#include <asm/export.h>
15 .set noreorder 15 .set noreorder
16 .set noat 16 .set noat
17 17
@@ -55,3 +55,4 @@ done: subq $0, $16, $0
55 ret $31, ($26) 55 ret $31, ($26)
56 56
57 .end strlen 57 .end strlen
58 EXPORT_SYMBOL(strlen)
diff --git a/arch/alpha/lib/strncat.S b/arch/alpha/lib/strncat.S
index a8278163c972..6c29ea60869a 100644
--- a/arch/alpha/lib/strncat.S
+++ b/arch/alpha/lib/strncat.S
@@ -9,7 +9,7 @@
9 * past count, whereas libc may write to count+1. This follows the generic 9 * past count, whereas libc may write to count+1. This follows the generic
10 * implementation in lib/string.c and is, IMHO, more sensible. 10 * implementation in lib/string.c and is, IMHO, more sensible.
11 */ 11 */
12 12#include <asm/export.h>
13 .text 13 .text
14 14
15 .align 3 15 .align 3
@@ -82,3 +82,4 @@ $zerocount:
82 ret 82 ret
83 83
84 .end strncat 84 .end strncat
85 EXPORT_SYMBOL(strncat)
diff --git a/arch/alpha/lib/strncpy.S b/arch/alpha/lib/strncpy.S
index a46f7f3ad8c7..e102cf1567dd 100644
--- a/arch/alpha/lib/strncpy.S
+++ b/arch/alpha/lib/strncpy.S
@@ -10,7 +10,7 @@
10 * version has cropped that bit o' nastiness as well as assuming that 10 * version has cropped that bit o' nastiness as well as assuming that
11 * __stxncpy is in range of a branch. 11 * __stxncpy is in range of a branch.
12 */ 12 */
13 13#include <asm/export.h>
14 .set noat 14 .set noat
15 .set noreorder 15 .set noreorder
16 16
@@ -79,3 +79,4 @@ $zerolen:
79 ret 79 ret
80 80
81 .end strncpy 81 .end strncpy
82 EXPORT_SYMBOL(strncpy)
diff --git a/arch/alpha/lib/strrchr.S b/arch/alpha/lib/strrchr.S
index 1970dc07cfd1..4bc6cb4b9812 100644
--- a/arch/alpha/lib/strrchr.S
+++ b/arch/alpha/lib/strrchr.S
@@ -5,7 +5,7 @@
5 * Return the address of the last occurrence of a given character 5 * Return the address of the last occurrence of a given character
6 * within a null-terminated string, or null if it is not found. 6 * within a null-terminated string, or null if it is not found.
7 */ 7 */
8 8#include <asm/export.h>
9#include <asm/regdef.h> 9#include <asm/regdef.h>
10 10
11 .set noreorder 11 .set noreorder
@@ -85,3 +85,4 @@ $retnull:
85 ret # .. e1 : 85 ret # .. e1 :
86 86
87 .end strrchr 87 .end strrchr
88 EXPORT_SYMBOL(strrchr)
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 55e0e3ea9cb6..0745538b26d3 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -8,6 +8,7 @@ generic-y += early_ioremap.h
8generic-y += emergency-restart.h 8generic-y += emergency-restart.h
9generic-y += errno.h 9generic-y += errno.h
10generic-y += exec.h 10generic-y += exec.h
11generic-y += export.h
11generic-y += ioctl.h 12generic-y += ioctl.h
12generic-y += ipcbuf.h 13generic-y += ipcbuf.h
13generic-y += irq_regs.h 14generic-y += irq_regs.h
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index ad325a8c7e1e..68c2c097cffe 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -33,7 +33,7 @@ endif
33obj-$(CONFIG_CPU_IDLE) += cpuidle.o 33obj-$(CONFIG_CPU_IDLE) += cpuidle.o
34obj-$(CONFIG_ISA_DMA_API) += dma.o 34obj-$(CONFIG_ISA_DMA_API) += dma.o
35obj-$(CONFIG_FIQ) += fiq.o fiqasm.o 35obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
36obj-$(CONFIG_MODULES) += armksyms.o module.o 36obj-$(CONFIG_MODULES) += module.o
37obj-$(CONFIG_ARM_MODULE_PLTS) += module-plts.o 37obj-$(CONFIG_ARM_MODULE_PLTS) += module-plts.o
38obj-$(CONFIG_ISA_DMA) += dma-isa.o 38obj-$(CONFIG_ISA_DMA) += dma-isa.o
39obj-$(CONFIG_PCI) += bios32.o isa.o 39obj-$(CONFIG_PCI) += bios32.o isa.o
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
deleted file mode 100644
index 7e45f69a0ddc..000000000000
--- a/arch/arm/kernel/armksyms.c
+++ /dev/null
@@ -1,183 +0,0 @@
1/*
2 * linux/arch/arm/kernel/armksyms.c
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/export.h>
11#include <linux/sched.h>
12#include <linux/string.h>
13#include <linux/cryptohash.h>
14#include <linux/delay.h>
15#include <linux/in6.h>
16#include <linux/syscalls.h>
17#include <linux/uaccess.h>
18#include <linux/io.h>
19#include <linux/arm-smccc.h>
20
21#include <asm/checksum.h>
22#include <asm/ftrace.h>
23
24/*
25 * libgcc functions - functions that are used internally by the
26 * compiler... (prototypes are not correct though, but that
27 * doesn't really matter since they're not versioned).
28 */
29extern void __ashldi3(void);
30extern void __ashrdi3(void);
31extern void __divsi3(void);
32extern void __lshrdi3(void);
33extern void __modsi3(void);
34extern void __muldi3(void);
35extern void __ucmpdi2(void);
36extern void __udivsi3(void);
37extern void __umodsi3(void);
38extern void __do_div64(void);
39extern void __bswapsi2(void);
40extern void __bswapdi2(void);
41
42extern void __aeabi_idiv(void);
43extern void __aeabi_idivmod(void);
44extern void __aeabi_lasr(void);
45extern void __aeabi_llsl(void);
46extern void __aeabi_llsr(void);
47extern void __aeabi_lmul(void);
48extern void __aeabi_uidiv(void);
49extern void __aeabi_uidivmod(void);
50extern void __aeabi_ulcmp(void);
51
52extern void fpundefinstr(void);
53
54void mmioset(void *, unsigned int, size_t);
55void mmiocpy(void *, const void *, size_t);
56
57 /* platform dependent support */
58EXPORT_SYMBOL(arm_delay_ops);
59
60 /* networking */
61EXPORT_SYMBOL(csum_partial);
62EXPORT_SYMBOL(csum_partial_copy_from_user);
63EXPORT_SYMBOL(csum_partial_copy_nocheck);
64EXPORT_SYMBOL(__csum_ipv6_magic);
65
66 /* io */
67#ifndef __raw_readsb
68EXPORT_SYMBOL(__raw_readsb);
69#endif
70#ifndef __raw_readsw
71EXPORT_SYMBOL(__raw_readsw);
72#endif
73#ifndef __raw_readsl
74EXPORT_SYMBOL(__raw_readsl);
75#endif
76#ifndef __raw_writesb
77EXPORT_SYMBOL(__raw_writesb);
78#endif
79#ifndef __raw_writesw
80EXPORT_SYMBOL(__raw_writesw);
81#endif
82#ifndef __raw_writesl
83EXPORT_SYMBOL(__raw_writesl);
84#endif
85
86 /* string / mem functions */
87EXPORT_SYMBOL(strchr);
88EXPORT_SYMBOL(strrchr);
89EXPORT_SYMBOL(memset);
90EXPORT_SYMBOL(memcpy);
91EXPORT_SYMBOL(memmove);
92EXPORT_SYMBOL(memchr);
93EXPORT_SYMBOL(__memzero);
94
95EXPORT_SYMBOL(mmioset);
96EXPORT_SYMBOL(mmiocpy);
97
98#ifdef CONFIG_MMU
99EXPORT_SYMBOL(copy_page);
100
101EXPORT_SYMBOL(arm_copy_from_user);
102EXPORT_SYMBOL(arm_copy_to_user);
103EXPORT_SYMBOL(arm_clear_user);
104
105EXPORT_SYMBOL(__get_user_1);
106EXPORT_SYMBOL(__get_user_2);
107EXPORT_SYMBOL(__get_user_4);
108EXPORT_SYMBOL(__get_user_8);
109
110#ifdef __ARMEB__
111EXPORT_SYMBOL(__get_user_64t_1);
112EXPORT_SYMBOL(__get_user_64t_2);
113EXPORT_SYMBOL(__get_user_64t_4);
114EXPORT_SYMBOL(__get_user_32t_8);
115#endif
116
117EXPORT_SYMBOL(__put_user_1);
118EXPORT_SYMBOL(__put_user_2);
119EXPORT_SYMBOL(__put_user_4);
120EXPORT_SYMBOL(__put_user_8);
121#endif
122
123 /* gcc lib functions */
124EXPORT_SYMBOL(__ashldi3);
125EXPORT_SYMBOL(__ashrdi3);
126EXPORT_SYMBOL(__divsi3);
127EXPORT_SYMBOL(__lshrdi3);
128EXPORT_SYMBOL(__modsi3);
129EXPORT_SYMBOL(__muldi3);
130EXPORT_SYMBOL(__ucmpdi2);
131EXPORT_SYMBOL(__udivsi3);
132EXPORT_SYMBOL(__umodsi3);
133EXPORT_SYMBOL(__do_div64);
134EXPORT_SYMBOL(__bswapsi2);
135EXPORT_SYMBOL(__bswapdi2);
136
137#ifdef CONFIG_AEABI
138EXPORT_SYMBOL(__aeabi_idiv);
139EXPORT_SYMBOL(__aeabi_idivmod);
140EXPORT_SYMBOL(__aeabi_lasr);
141EXPORT_SYMBOL(__aeabi_llsl);
142EXPORT_SYMBOL(__aeabi_llsr);
143EXPORT_SYMBOL(__aeabi_lmul);
144EXPORT_SYMBOL(__aeabi_uidiv);
145EXPORT_SYMBOL(__aeabi_uidivmod);
146EXPORT_SYMBOL(__aeabi_ulcmp);
147#endif
148
149 /* bitops */
150EXPORT_SYMBOL(_set_bit);
151EXPORT_SYMBOL(_test_and_set_bit);
152EXPORT_SYMBOL(_clear_bit);
153EXPORT_SYMBOL(_test_and_clear_bit);
154EXPORT_SYMBOL(_change_bit);
155EXPORT_SYMBOL(_test_and_change_bit);
156EXPORT_SYMBOL(_find_first_zero_bit_le);
157EXPORT_SYMBOL(_find_next_zero_bit_le);
158EXPORT_SYMBOL(_find_first_bit_le);
159EXPORT_SYMBOL(_find_next_bit_le);
160
161#ifdef __ARMEB__
162EXPORT_SYMBOL(_find_first_zero_bit_be);
163EXPORT_SYMBOL(_find_next_zero_bit_be);
164EXPORT_SYMBOL(_find_first_bit_be);
165EXPORT_SYMBOL(_find_next_bit_be);
166#endif
167
168#ifdef CONFIG_FUNCTION_TRACER
169#ifdef CONFIG_OLD_MCOUNT
170EXPORT_SYMBOL(mcount);
171#endif
172EXPORT_SYMBOL(__gnu_mcount_nc);
173#endif
174
175#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
176EXPORT_SYMBOL(__pv_phys_pfn_offset);
177EXPORT_SYMBOL(__pv_offset);
178#endif
179
180#ifdef CONFIG_HAVE_ARM_SMCCC
181EXPORT_SYMBOL(arm_smccc_smc);
182EXPORT_SYMBOL(arm_smccc_hvc);
183#endif
diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S
index c73c4030ca5d..b629d3f11c3d 100644
--- a/arch/arm/kernel/entry-ftrace.S
+++ b/arch/arm/kernel/entry-ftrace.S
@@ -7,6 +7,7 @@
7#include <asm/assembler.h> 7#include <asm/assembler.h>
8#include <asm/ftrace.h> 8#include <asm/ftrace.h>
9#include <asm/unwind.h> 9#include <asm/unwind.h>
10#include <asm/export.h>
10 11
11#include "entry-header.S" 12#include "entry-header.S"
12 13
@@ -153,6 +154,7 @@ ENTRY(mcount)
153 __mcount _old 154 __mcount _old
154#endif 155#endif
155ENDPROC(mcount) 156ENDPROC(mcount)
157EXPORT_SYMBOL(mcount)
156 158
157#ifdef CONFIG_DYNAMIC_FTRACE 159#ifdef CONFIG_DYNAMIC_FTRACE
158ENTRY(ftrace_caller_old) 160ENTRY(ftrace_caller_old)
@@ -205,6 +207,7 @@ UNWIND(.fnstart)
205#endif 207#endif
206UNWIND(.fnend) 208UNWIND(.fnend)
207ENDPROC(__gnu_mcount_nc) 209ENDPROC(__gnu_mcount_nc)
210EXPORT_SYMBOL(__gnu_mcount_nc)
208 211
209#ifdef CONFIG_DYNAMIC_FTRACE 212#ifdef CONFIG_DYNAMIC_FTRACE
210ENTRY(ftrace_caller) 213ENTRY(ftrace_caller)
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 04286fd9e09c..f41cee4c5746 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -22,6 +22,7 @@
22#include <asm/memory.h> 22#include <asm/memory.h>
23#include <asm/thread_info.h> 23#include <asm/thread_info.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25#include <asm/export.h>
25 26
26#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING) 27#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
27#include CONFIG_DEBUG_LL_INCLUDE 28#include CONFIG_DEBUG_LL_INCLUDE
@@ -727,6 +728,8 @@ __pv_phys_pfn_offset:
727__pv_offset: 728__pv_offset:
728 .quad 0 729 .quad 0
729 .size __pv_offset, . -__pv_offset 730 .size __pv_offset, . -__pv_offset
731EXPORT_SYMBOL(__pv_phys_pfn_offset)
732EXPORT_SYMBOL(__pv_offset)
730#endif 733#endif
731 734
732#include "head-common.S" 735#include "head-common.S"
diff --git a/arch/arm/kernel/smccc-call.S b/arch/arm/kernel/smccc-call.S
index 2e48b674aab1..37669e7e13af 100644
--- a/arch/arm/kernel/smccc-call.S
+++ b/arch/arm/kernel/smccc-call.S
@@ -16,6 +16,7 @@
16#include <asm/opcodes-sec.h> 16#include <asm/opcodes-sec.h>
17#include <asm/opcodes-virt.h> 17#include <asm/opcodes-virt.h>
18#include <asm/unwind.h> 18#include <asm/unwind.h>
19#include <asm/export.h>
19 20
20 /* 21 /*
21 * Wrap c macros in asm macros to delay expansion until after the 22 * Wrap c macros in asm macros to delay expansion until after the
@@ -51,6 +52,7 @@ UNWIND( .fnend)
51ENTRY(arm_smccc_smc) 52ENTRY(arm_smccc_smc)
52 SMCCC SMCCC_SMC 53 SMCCC SMCCC_SMC
53ENDPROC(arm_smccc_smc) 54ENDPROC(arm_smccc_smc)
55EXPORT_SYMBOL(arm_smccc_smc)
54 56
55/* 57/*
56 * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, 58 * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
@@ -60,3 +62,4 @@ ENDPROC(arm_smccc_smc)
60ENTRY(arm_smccc_hvc) 62ENTRY(arm_smccc_hvc)
61 SMCCC SMCCC_HVC 63 SMCCC SMCCC_HVC
62ENDPROC(arm_smccc_hvc) 64ENDPROC(arm_smccc_hvc)
65EXPORT_SYMBOL(arm_smccc_hvc)
diff --git a/arch/arm/lib/ashldi3.S b/arch/arm/lib/ashldi3.S
index b05e95840651..a7e7de89bd75 100644
--- a/arch/arm/lib/ashldi3.S
+++ b/arch/arm/lib/ashldi3.S
@@ -28,6 +28,7 @@ Boston, MA 02110-1301, USA. */
28 28
29#include <linux/linkage.h> 29#include <linux/linkage.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/export.h>
31 32
32#ifdef __ARMEB__ 33#ifdef __ARMEB__
33#define al r1 34#define al r1
@@ -52,3 +53,5 @@ ENTRY(__aeabi_llsl)
52 53
53ENDPROC(__ashldi3) 54ENDPROC(__ashldi3)
54ENDPROC(__aeabi_llsl) 55ENDPROC(__aeabi_llsl)
56EXPORT_SYMBOL(__ashldi3)
57EXPORT_SYMBOL(__aeabi_llsl)
diff --git a/arch/arm/lib/ashrdi3.S b/arch/arm/lib/ashrdi3.S
index 275d7d2341a4..490336e42518 100644
--- a/arch/arm/lib/ashrdi3.S
+++ b/arch/arm/lib/ashrdi3.S
@@ -28,6 +28,7 @@ Boston, MA 02110-1301, USA. */
28 28
29#include <linux/linkage.h> 29#include <linux/linkage.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/export.h>
31 32
32#ifdef __ARMEB__ 33#ifdef __ARMEB__
33#define al r1 34#define al r1
@@ -52,3 +53,5 @@ ENTRY(__aeabi_lasr)
52 53
53ENDPROC(__ashrdi3) 54ENDPROC(__ashrdi3)
54ENDPROC(__aeabi_lasr) 55ENDPROC(__aeabi_lasr)
56EXPORT_SYMBOL(__ashrdi3)
57EXPORT_SYMBOL(__aeabi_lasr)
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 7d807cfd8ef5..df06638b327c 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,5 +1,6 @@
1#include <asm/assembler.h> 1#include <asm/assembler.h>
2#include <asm/unwind.h> 2#include <asm/unwind.h>
3#include <asm/export.h>
3 4
4#if __LINUX_ARM_ARCH__ >= 6 5#if __LINUX_ARM_ARCH__ >= 6
5 .macro bitop, name, instr 6 .macro bitop, name, instr
@@ -25,6 +26,7 @@ UNWIND( .fnstart )
25 bx lr 26 bx lr
26UNWIND( .fnend ) 27UNWIND( .fnend )
27ENDPROC(\name ) 28ENDPROC(\name )
29EXPORT_SYMBOL(\name )
28 .endm 30 .endm
29 31
30 .macro testop, name, instr, store 32 .macro testop, name, instr, store
@@ -55,6 +57,7 @@ UNWIND( .fnstart )
552: bx lr 572: bx lr
56UNWIND( .fnend ) 58UNWIND( .fnend )
57ENDPROC(\name ) 59ENDPROC(\name )
60EXPORT_SYMBOL(\name )
58 .endm 61 .endm
59#else 62#else
60 .macro bitop, name, instr 63 .macro bitop, name, instr
@@ -74,6 +77,7 @@ UNWIND( .fnstart )
74 ret lr 77 ret lr
75UNWIND( .fnend ) 78UNWIND( .fnend )
76ENDPROC(\name ) 79ENDPROC(\name )
80EXPORT_SYMBOL(\name )
77 .endm 81 .endm
78 82
79/** 83/**
@@ -102,5 +106,6 @@ UNWIND( .fnstart )
102 ret lr 106 ret lr
103UNWIND( .fnend ) 107UNWIND( .fnend )
104ENDPROC(\name ) 108ENDPROC(\name )
109EXPORT_SYMBOL(\name )
105 .endm 110 .endm
106#endif 111#endif
diff --git a/arch/arm/lib/bswapsdi2.S b/arch/arm/lib/bswapsdi2.S
index 07cda737bb11..f05f78247304 100644
--- a/arch/arm/lib/bswapsdi2.S
+++ b/arch/arm/lib/bswapsdi2.S
@@ -1,5 +1,6 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/assembler.h> 2#include <asm/assembler.h>
3#include <asm/export.h>
3 4
4#if __LINUX_ARM_ARCH__ >= 6 5#if __LINUX_ARM_ARCH__ >= 6
5ENTRY(__bswapsi2) 6ENTRY(__bswapsi2)
@@ -35,3 +36,5 @@ ENTRY(__bswapdi2)
35 ret lr 36 ret lr
36ENDPROC(__bswapdi2) 37ENDPROC(__bswapdi2)
37#endif 38#endif
39EXPORT_SYMBOL(__bswapsi2)
40EXPORT_SYMBOL(__bswapdi2)
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
index e936352ccb00..b566154f5cf4 100644
--- a/arch/arm/lib/clear_user.S
+++ b/arch/arm/lib/clear_user.S
@@ -10,6 +10,7 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/unwind.h> 12#include <asm/unwind.h>
13#include <asm/export.h>
13 14
14 .text 15 .text
15 16
@@ -50,6 +51,9 @@ USER( strnebt r2, [r0])
50UNWIND(.fnend) 51UNWIND(.fnend)
51ENDPROC(arm_clear_user) 52ENDPROC(arm_clear_user)
52ENDPROC(__clear_user_std) 53ENDPROC(__clear_user_std)
54#ifndef CONFIG_UACCESS_WITH_MEMCPY
55EXPORT_SYMBOL(arm_clear_user)
56#endif
53 57
54 .pushsection .text.fixup,"ax" 58 .pushsection .text.fixup,"ax"
55 .align 0 59 .align 0
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
index 1512bebfbf1b..f549c57ea435 100644
--- a/arch/arm/lib/copy_from_user.S
+++ b/arch/arm/lib/copy_from_user.S
@@ -13,6 +13,7 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/unwind.h> 15#include <asm/unwind.h>
16#include <asm/export.h>
16 17
17/* 18/*
18 * Prototype: 19 * Prototype:
@@ -94,6 +95,7 @@ ENTRY(arm_copy_from_user)
94#include "copy_template.S" 95#include "copy_template.S"
95 96
96ENDPROC(arm_copy_from_user) 97ENDPROC(arm_copy_from_user)
98EXPORT_SYMBOL(arm_copy_from_user)
97 99
98 .pushsection .fixup,"ax" 100 .pushsection .fixup,"ax"
99 .align 0 101 .align 0
diff --git a/arch/arm/lib/copy_page.S b/arch/arm/lib/copy_page.S
index 6ee2f6706f86..d97851d4af7a 100644
--- a/arch/arm/lib/copy_page.S
+++ b/arch/arm/lib/copy_page.S
@@ -13,6 +13,7 @@
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/asm-offsets.h> 14#include <asm/asm-offsets.h>
15#include <asm/cache.h> 15#include <asm/cache.h>
16#include <asm/export.h>
16 17
17#define COPY_COUNT (PAGE_SZ / (2 * L1_CACHE_BYTES) PLD( -1 )) 18#define COPY_COUNT (PAGE_SZ / (2 * L1_CACHE_BYTES) PLD( -1 ))
18 19
@@ -45,3 +46,4 @@ ENTRY(copy_page)
45 PLD( beq 2b ) 46 PLD( beq 2b )
46 ldmfd sp!, {r4, pc} @ 3 47 ldmfd sp!, {r4, pc} @ 3
47ENDPROC(copy_page) 48ENDPROC(copy_page)
49EXPORT_SYMBOL(copy_page)
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
index caf5019d8161..592c179112d1 100644
--- a/arch/arm/lib/copy_to_user.S
+++ b/arch/arm/lib/copy_to_user.S
@@ -13,6 +13,7 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/unwind.h> 15#include <asm/unwind.h>
16#include <asm/export.h>
16 17
17/* 18/*
18 * Prototype: 19 * Prototype:
@@ -99,6 +100,9 @@ WEAK(arm_copy_to_user)
99 100
100ENDPROC(arm_copy_to_user) 101ENDPROC(arm_copy_to_user)
101ENDPROC(__copy_to_user_std) 102ENDPROC(__copy_to_user_std)
103#ifndef CONFIG_UACCESS_WITH_MEMCPY
104EXPORT_SYMBOL(arm_copy_to_user)
105#endif
102 106
103 .pushsection .text.fixup,"ax" 107 .pushsection .text.fixup,"ax"
104 .align 0 108 .align 0
diff --git a/arch/arm/lib/csumipv6.S b/arch/arm/lib/csumipv6.S
index 3ac6ef01bc43..68603b5ee537 100644
--- a/arch/arm/lib/csumipv6.S
+++ b/arch/arm/lib/csumipv6.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13 .text 14 .text
14 15
@@ -30,4 +31,4 @@ ENTRY(__csum_ipv6_magic)
30 adcs r0, r0, #0 31 adcs r0, r0, #0
31 ldmfd sp!, {pc} 32 ldmfd sp!, {pc}
32ENDPROC(__csum_ipv6_magic) 33ENDPROC(__csum_ipv6_magic)
33 34EXPORT_SYMBOL(__csum_ipv6_magic)
diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S
index 984e0f29d548..830b20e81c37 100644
--- a/arch/arm/lib/csumpartial.S
+++ b/arch/arm/lib/csumpartial.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13 .text 14 .text
14 15
@@ -140,3 +141,4 @@ ENTRY(csum_partial)
140 bne 4b 141 bne 4b
141 b .Lless4 142 b .Lless4
142ENDPROC(csum_partial) 143ENDPROC(csum_partial)
144EXPORT_SYMBOL(csum_partial)
diff --git a/arch/arm/lib/csumpartialcopy.S b/arch/arm/lib/csumpartialcopy.S
index d03fc71fc88c..9c3383fed129 100644
--- a/arch/arm/lib/csumpartialcopy.S
+++ b/arch/arm/lib/csumpartialcopy.S
@@ -49,5 +49,6 @@
49 49
50#define FN_ENTRY ENTRY(csum_partial_copy_nocheck) 50#define FN_ENTRY ENTRY(csum_partial_copy_nocheck)
51#define FN_EXIT ENDPROC(csum_partial_copy_nocheck) 51#define FN_EXIT ENDPROC(csum_partial_copy_nocheck)
52#define FN_EXPORT EXPORT_SYMBOL(csum_partial_copy_nocheck)
52 53
53#include "csumpartialcopygeneric.S" 54#include "csumpartialcopygeneric.S"
diff --git a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S
index 10b45909610c..8b94d20e51d1 100644
--- a/arch/arm/lib/csumpartialcopygeneric.S
+++ b/arch/arm/lib/csumpartialcopygeneric.S
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <asm/assembler.h> 10#include <asm/assembler.h>
11#include <asm/export.h>
11 12
12/* 13/*
13 * unsigned int 14 * unsigned int
@@ -331,3 +332,4 @@ FN_ENTRY
331 mov r5, r4, get_byte_1 332 mov r5, r4, get_byte_1
332 b .Lexit 333 b .Lexit
333FN_EXIT 334FN_EXIT
335FN_EXPORT
diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S
index 1712f132b80d..5d495edf3d83 100644
--- a/arch/arm/lib/csumpartialcopyuser.S
+++ b/arch/arm/lib/csumpartialcopyuser.S
@@ -73,6 +73,7 @@
73 73
74#define FN_ENTRY ENTRY(csum_partial_copy_from_user) 74#define FN_ENTRY ENTRY(csum_partial_copy_from_user)
75#define FN_EXIT ENDPROC(csum_partial_copy_from_user) 75#define FN_EXIT ENDPROC(csum_partial_copy_from_user)
76#define FN_EXPORT EXPORT_SYMBOL(csum_partial_copy_from_user)
76 77
77#include "csumpartialcopygeneric.S" 78#include "csumpartialcopygeneric.S"
78 79
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index 2cef11884857..69aad80a3af4 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/export.h>
27#include <linux/timex.h> 28#include <linux/timex.h>
28 29
29/* 30/*
@@ -34,6 +35,7 @@ struct arm_delay_ops arm_delay_ops __ro_after_init = {
34 .const_udelay = __loop_const_udelay, 35 .const_udelay = __loop_const_udelay,
35 .udelay = __loop_udelay, 36 .udelay = __loop_udelay,
36}; 37};
38EXPORT_SYMBOL(arm_delay_ops);
37 39
38static const struct delay_timer *delay_timer; 40static const struct delay_timer *delay_timer;
39static bool delay_calibrated; 41static bool delay_calibrated;
diff --git a/arch/arm/lib/div64.S b/arch/arm/lib/div64.S
index a9eafe4981eb..0c9e1c18fc9e 100644
--- a/arch/arm/lib/div64.S
+++ b/arch/arm/lib/div64.S
@@ -15,6 +15,7 @@
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <asm/assembler.h> 16#include <asm/assembler.h>
17#include <asm/unwind.h> 17#include <asm/unwind.h>
18#include <asm/export.h>
18 19
19#ifdef __ARMEB__ 20#ifdef __ARMEB__
20#define xh r0 21#define xh r0
@@ -210,3 +211,4 @@ Ldiv0_64:
210 211
211UNWIND(.fnend) 212UNWIND(.fnend)
212ENDPROC(__do_div64) 213ENDPROC(__do_div64)
214EXPORT_SYMBOL(__do_div64)
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S
index 7848780e8834..26302b8cd38f 100644
--- a/arch/arm/lib/findbit.S
+++ b/arch/arm/lib/findbit.S
@@ -15,6 +15,7 @@
15 */ 15 */
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <asm/assembler.h> 17#include <asm/assembler.h>
18#include <asm/export.h>
18 .text 19 .text
19 20
20/* 21/*
@@ -37,6 +38,7 @@ ENTRY(_find_first_zero_bit_le)
373: mov r0, r1 @ no free bits 383: mov r0, r1 @ no free bits
38 ret lr 39 ret lr
39ENDPROC(_find_first_zero_bit_le) 40ENDPROC(_find_first_zero_bit_le)
41EXPORT_SYMBOL(_find_first_zero_bit_le)
40 42
41/* 43/*
42 * Purpose : Find next 'zero' bit 44 * Purpose : Find next 'zero' bit
@@ -57,6 +59,7 @@ ENTRY(_find_next_zero_bit_le)
57 add r2, r2, #1 @ align bit pointer 59 add r2, r2, #1 @ align bit pointer
58 b 2b @ loop for next bit 60 b 2b @ loop for next bit
59ENDPROC(_find_next_zero_bit_le) 61ENDPROC(_find_next_zero_bit_le)
62EXPORT_SYMBOL(_find_next_zero_bit_le)
60 63
61/* 64/*
62 * Purpose : Find a 'one' bit 65 * Purpose : Find a 'one' bit
@@ -78,6 +81,7 @@ ENTRY(_find_first_bit_le)
783: mov r0, r1 @ no free bits 813: mov r0, r1 @ no free bits
79 ret lr 82 ret lr
80ENDPROC(_find_first_bit_le) 83ENDPROC(_find_first_bit_le)
84EXPORT_SYMBOL(_find_first_bit_le)
81 85
82/* 86/*
83 * Purpose : Find next 'one' bit 87 * Purpose : Find next 'one' bit
@@ -97,6 +101,7 @@ ENTRY(_find_next_bit_le)
97 add r2, r2, #1 @ align bit pointer 101 add r2, r2, #1 @ align bit pointer
98 b 2b @ loop for next bit 102 b 2b @ loop for next bit
99ENDPROC(_find_next_bit_le) 103ENDPROC(_find_next_bit_le)
104EXPORT_SYMBOL(_find_next_bit_le)
100 105
101#ifdef __ARMEB__ 106#ifdef __ARMEB__
102 107
@@ -116,6 +121,7 @@ ENTRY(_find_first_zero_bit_be)
1163: mov r0, r1 @ no free bits 1213: mov r0, r1 @ no free bits
117 ret lr 122 ret lr
118ENDPROC(_find_first_zero_bit_be) 123ENDPROC(_find_first_zero_bit_be)
124EXPORT_SYMBOL(_find_first_zero_bit_be)
119 125
120ENTRY(_find_next_zero_bit_be) 126ENTRY(_find_next_zero_bit_be)
121 teq r1, #0 127 teq r1, #0
@@ -133,6 +139,7 @@ ENTRY(_find_next_zero_bit_be)
133 add r2, r2, #1 @ align bit pointer 139 add r2, r2, #1 @ align bit pointer
134 b 2b @ loop for next bit 140 b 2b @ loop for next bit
135ENDPROC(_find_next_zero_bit_be) 141ENDPROC(_find_next_zero_bit_be)
142EXPORT_SYMBOL(_find_next_zero_bit_be)
136 143
137ENTRY(_find_first_bit_be) 144ENTRY(_find_first_bit_be)
138 teq r1, #0 145 teq r1, #0
@@ -150,6 +157,7 @@ ENTRY(_find_first_bit_be)
1503: mov r0, r1 @ no free bits 1573: mov r0, r1 @ no free bits
151 ret lr 158 ret lr
152ENDPROC(_find_first_bit_be) 159ENDPROC(_find_first_bit_be)
160EXPORT_SYMBOL(_find_first_bit_be)
153 161
154ENTRY(_find_next_bit_be) 162ENTRY(_find_next_bit_be)
155 teq r1, #0 163 teq r1, #0
@@ -166,6 +174,7 @@ ENTRY(_find_next_bit_be)
166 add r2, r2, #1 @ align bit pointer 174 add r2, r2, #1 @ align bit pointer
167 b 2b @ loop for next bit 175 b 2b @ loop for next bit
168ENDPROC(_find_next_bit_be) 176ENDPROC(_find_next_bit_be)
177EXPORT_SYMBOL(_find_next_bit_be)
169 178
170#endif 179#endif
171 180
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S
index 8ecfd15c3a02..9d09a38e73af 100644
--- a/arch/arm/lib/getuser.S
+++ b/arch/arm/lib/getuser.S
@@ -31,6 +31,7 @@
31#include <asm/assembler.h> 31#include <asm/assembler.h>
32#include <asm/errno.h> 32#include <asm/errno.h>
33#include <asm/domain.h> 33#include <asm/domain.h>
34#include <asm/export.h>
34 35
35ENTRY(__get_user_1) 36ENTRY(__get_user_1)
36 check_uaccess r0, 1, r1, r2, __get_user_bad 37 check_uaccess r0, 1, r1, r2, __get_user_bad
@@ -38,6 +39,7 @@ ENTRY(__get_user_1)
38 mov r0, #0 39 mov r0, #0
39 ret lr 40 ret lr
40ENDPROC(__get_user_1) 41ENDPROC(__get_user_1)
42EXPORT_SYMBOL(__get_user_1)
41 43
42ENTRY(__get_user_2) 44ENTRY(__get_user_2)
43 check_uaccess r0, 2, r1, r2, __get_user_bad 45 check_uaccess r0, 2, r1, r2, __get_user_bad
@@ -58,6 +60,7 @@ rb .req r0
58 mov r0, #0 60 mov r0, #0
59 ret lr 61 ret lr
60ENDPROC(__get_user_2) 62ENDPROC(__get_user_2)
63EXPORT_SYMBOL(__get_user_2)
61 64
62ENTRY(__get_user_4) 65ENTRY(__get_user_4)
63 check_uaccess r0, 4, r1, r2, __get_user_bad 66 check_uaccess r0, 4, r1, r2, __get_user_bad
@@ -65,6 +68,7 @@ ENTRY(__get_user_4)
65 mov r0, #0 68 mov r0, #0
66 ret lr 69 ret lr
67ENDPROC(__get_user_4) 70ENDPROC(__get_user_4)
71EXPORT_SYMBOL(__get_user_4)
68 72
69ENTRY(__get_user_8) 73ENTRY(__get_user_8)
70 check_uaccess r0, 8, r1, r2, __get_user_bad 74 check_uaccess r0, 8, r1, r2, __get_user_bad
@@ -78,6 +82,7 @@ ENTRY(__get_user_8)
78 mov r0, #0 82 mov r0, #0
79 ret lr 83 ret lr
80ENDPROC(__get_user_8) 84ENDPROC(__get_user_8)
85EXPORT_SYMBOL(__get_user_8)
81 86
82#ifdef __ARMEB__ 87#ifdef __ARMEB__
83ENTRY(__get_user_32t_8) 88ENTRY(__get_user_32t_8)
@@ -91,6 +96,7 @@ ENTRY(__get_user_32t_8)
91 mov r0, #0 96 mov r0, #0
92 ret lr 97 ret lr
93ENDPROC(__get_user_32t_8) 98ENDPROC(__get_user_32t_8)
99EXPORT_SYMBOL(__get_user_32t_8)
94 100
95ENTRY(__get_user_64t_1) 101ENTRY(__get_user_64t_1)
96 check_uaccess r0, 1, r1, r2, __get_user_bad8 102 check_uaccess r0, 1, r1, r2, __get_user_bad8
@@ -98,6 +104,7 @@ ENTRY(__get_user_64t_1)
98 mov r0, #0 104 mov r0, #0
99 ret lr 105 ret lr
100ENDPROC(__get_user_64t_1) 106ENDPROC(__get_user_64t_1)
107EXPORT_SYMBOL(__get_user_64t_1)
101 108
102ENTRY(__get_user_64t_2) 109ENTRY(__get_user_64t_2)
103 check_uaccess r0, 2, r1, r2, __get_user_bad8 110 check_uaccess r0, 2, r1, r2, __get_user_bad8
@@ -114,6 +121,7 @@ rb .req r0
114 mov r0, #0 121 mov r0, #0
115 ret lr 122 ret lr
116ENDPROC(__get_user_64t_2) 123ENDPROC(__get_user_64t_2)
124EXPORT_SYMBOL(__get_user_64t_2)
117 125
118ENTRY(__get_user_64t_4) 126ENTRY(__get_user_64t_4)
119 check_uaccess r0, 4, r1, r2, __get_user_bad8 127 check_uaccess r0, 4, r1, r2, __get_user_bad8
@@ -121,6 +129,7 @@ ENTRY(__get_user_64t_4)
121 mov r0, #0 129 mov r0, #0
122 ret lr 130 ret lr
123ENDPROC(__get_user_64t_4) 131ENDPROC(__get_user_64t_4)
132EXPORT_SYMBOL(__get_user_64t_4)
124#endif 133#endif
125 134
126__get_user_bad8: 135__get_user_bad8:
diff --git a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S
index c31b2f3153f1..3dff7a3a2aef 100644
--- a/arch/arm/lib/io-readsb.S
+++ b/arch/arm/lib/io-readsb.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13.Linsb_align: rsb ip, ip, #4 14.Linsb_align: rsb ip, ip, #4
14 cmp ip, r2 15 cmp ip, r2
@@ -121,3 +122,4 @@ ENTRY(__raw_readsb)
121 122
122 ldmfd sp!, {r4 - r6, pc} 123 ldmfd sp!, {r4 - r6, pc}
123ENDPROC(__raw_readsb) 124ENDPROC(__raw_readsb)
125EXPORT_SYMBOL(__raw_readsb)
diff --git a/arch/arm/lib/io-readsl.S b/arch/arm/lib/io-readsl.S
index 2ed86fa5465f..bfd39682325b 100644
--- a/arch/arm/lib/io-readsl.S
+++ b/arch/arm/lib/io-readsl.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13ENTRY(__raw_readsl) 14ENTRY(__raw_readsl)
14 teq r2, #0 @ do we have to check for the zero len? 15 teq r2, #0 @ do we have to check for the zero len?
@@ -77,3 +78,4 @@ ENTRY(__raw_readsl)
77 strb r3, [r1, #0] 78 strb r3, [r1, #0]
78 ret lr 79 ret lr
79ENDPROC(__raw_readsl) 80ENDPROC(__raw_readsl)
81EXPORT_SYMBOL(__raw_readsl)
diff --git a/arch/arm/lib/io-readsw-armv3.S b/arch/arm/lib/io-readsw-armv3.S
index 413da9914529..b3af3db6caac 100644
--- a/arch/arm/lib/io-readsw-armv3.S
+++ b/arch/arm/lib/io-readsw-armv3.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13.Linsw_bad_alignment: 14.Linsw_bad_alignment:
14 adr r0, .Linsw_bad_align_msg 15 adr r0, .Linsw_bad_align_msg
@@ -103,4 +104,4 @@ ENTRY(__raw_readsw)
103 104
104 ldmfd sp!, {r4, r5, r6, pc} 105 ldmfd sp!, {r4, r5, r6, pc}
105 106
106 107EXPORT_SYMBOL(__raw_readsw)
diff --git a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S
index d9a45e9692ae..3c7a7a40b33e 100644
--- a/arch/arm/lib/io-readsw-armv4.S
+++ b/arch/arm/lib/io-readsw-armv4.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13 .macro pack, rd, hw1, hw2 14 .macro pack, rd, hw1, hw2
14#ifndef __ARMEB__ 15#ifndef __ARMEB__
@@ -129,3 +130,4 @@ ENTRY(__raw_readsw)
129 strneb ip, [r1] 130 strneb ip, [r1]
130 ldmfd sp!, {r4, pc} 131 ldmfd sp!, {r4, pc}
131ENDPROC(__raw_readsw) 132ENDPROC(__raw_readsw)
133EXPORT_SYMBOL(__raw_readsw)
diff --git a/arch/arm/lib/io-writesb.S b/arch/arm/lib/io-writesb.S
index a46bbc9b168b..fa3633594415 100644
--- a/arch/arm/lib/io-writesb.S
+++ b/arch/arm/lib/io-writesb.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13 .macro outword, rd 14 .macro outword, rd
14#ifndef __ARMEB__ 15#ifndef __ARMEB__
@@ -92,3 +93,4 @@ ENTRY(__raw_writesb)
92 93
93 ldmfd sp!, {r4, r5, pc} 94 ldmfd sp!, {r4, r5, pc}
94ENDPROC(__raw_writesb) 95ENDPROC(__raw_writesb)
96EXPORT_SYMBOL(__raw_writesb)
diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S
index 4ea2435988c1..98ed6aec0b47 100644
--- a/arch/arm/lib/io-writesl.S
+++ b/arch/arm/lib/io-writesl.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13ENTRY(__raw_writesl) 14ENTRY(__raw_writesl)
14 teq r2, #0 @ do we have to check for the zero len? 15 teq r2, #0 @ do we have to check for the zero len?
@@ -65,3 +66,4 @@ ENTRY(__raw_writesl)
65 bne 6b 66 bne 6b
66 ret lr 67 ret lr
67ENDPROC(__raw_writesl) 68ENDPROC(__raw_writesl)
69EXPORT_SYMBOL(__raw_writesl)
diff --git a/arch/arm/lib/io-writesw-armv3.S b/arch/arm/lib/io-writesw-armv3.S
index 121789eb6802..577184c082bb 100644
--- a/arch/arm/lib/io-writesw-armv3.S
+++ b/arch/arm/lib/io-writesw-armv3.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13.Loutsw_bad_alignment: 14.Loutsw_bad_alignment:
14 adr r0, .Loutsw_bad_align_msg 15 adr r0, .Loutsw_bad_align_msg
@@ -124,3 +125,4 @@ ENTRY(__raw_writesw)
124 strne ip, [r0] 125 strne ip, [r0]
125 126
126 ldmfd sp!, {r4, r5, r6, pc} 127 ldmfd sp!, {r4, r5, r6, pc}
128EXPORT_SYMBOL(__raw_writesw)
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
index 269f90c51ad2..e335f489d1fc 100644
--- a/arch/arm/lib/io-writesw-armv4.S
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/export.h>
12 13
13 .macro outword, rd 14 .macro outword, rd
14#ifndef __ARMEB__ 15#ifndef __ARMEB__
@@ -98,3 +99,4 @@ ENTRY(__raw_writesw)
98 strneh ip, [r0] 99 strneh ip, [r0]
99 ret lr 100 ret lr
100ENDPROC(__raw_writesw) 101ENDPROC(__raw_writesw)
102EXPORT_SYMBOL(__raw_writesw)
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
index 9397b2e532af..f541bc013bff 100644
--- a/arch/arm/lib/lib1funcs.S
+++ b/arch/arm/lib/lib1funcs.S
@@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */
36#include <linux/linkage.h> 36#include <linux/linkage.h>
37#include <asm/assembler.h> 37#include <asm/assembler.h>
38#include <asm/unwind.h> 38#include <asm/unwind.h>
39#include <asm/export.h>
39 40
40.macro ARM_DIV_BODY dividend, divisor, result, curbit 41.macro ARM_DIV_BODY dividend, divisor, result, curbit
41 42
@@ -238,6 +239,8 @@ UNWIND(.fnstart)
238UNWIND(.fnend) 239UNWIND(.fnend)
239ENDPROC(__udivsi3) 240ENDPROC(__udivsi3)
240ENDPROC(__aeabi_uidiv) 241ENDPROC(__aeabi_uidiv)
242EXPORT_SYMBOL(__udivsi3)
243EXPORT_SYMBOL(__aeabi_uidiv)
241 244
242ENTRY(__umodsi3) 245ENTRY(__umodsi3)
243UNWIND(.fnstart) 246UNWIND(.fnstart)
@@ -256,6 +259,7 @@ UNWIND(.fnstart)
256 259
257UNWIND(.fnend) 260UNWIND(.fnend)
258ENDPROC(__umodsi3) 261ENDPROC(__umodsi3)
262EXPORT_SYMBOL(__umodsi3)
259 263
260#ifdef CONFIG_ARM_PATCH_IDIV 264#ifdef CONFIG_ARM_PATCH_IDIV
261 .align 3 265 .align 3
@@ -303,6 +307,8 @@ UNWIND(.fnstart)
303UNWIND(.fnend) 307UNWIND(.fnend)
304ENDPROC(__divsi3) 308ENDPROC(__divsi3)
305ENDPROC(__aeabi_idiv) 309ENDPROC(__aeabi_idiv)
310EXPORT_SYMBOL(__divsi3)
311EXPORT_SYMBOL(__aeabi_idiv)
306 312
307ENTRY(__modsi3) 313ENTRY(__modsi3)
308UNWIND(.fnstart) 314UNWIND(.fnstart)
@@ -327,6 +333,7 @@ UNWIND(.fnstart)
327 333
328UNWIND(.fnend) 334UNWIND(.fnend)
329ENDPROC(__modsi3) 335ENDPROC(__modsi3)
336EXPORT_SYMBOL(__modsi3)
330 337
331#ifdef CONFIG_AEABI 338#ifdef CONFIG_AEABI
332 339
@@ -343,6 +350,7 @@ UNWIND(.save {r0, r1, ip, lr} )
343 350
344UNWIND(.fnend) 351UNWIND(.fnend)
345ENDPROC(__aeabi_uidivmod) 352ENDPROC(__aeabi_uidivmod)
353EXPORT_SYMBOL(__aeabi_uidivmod)
346 354
347ENTRY(__aeabi_idivmod) 355ENTRY(__aeabi_idivmod)
348UNWIND(.fnstart) 356UNWIND(.fnstart)
@@ -356,6 +364,7 @@ UNWIND(.save {r0, r1, ip, lr} )
356 364
357UNWIND(.fnend) 365UNWIND(.fnend)
358ENDPROC(__aeabi_idivmod) 366ENDPROC(__aeabi_idivmod)
367EXPORT_SYMBOL(__aeabi_idivmod)
359 368
360#endif 369#endif
361 370
diff --git a/arch/arm/lib/lshrdi3.S b/arch/arm/lib/lshrdi3.S
index 922dcd88b02b..e40833981417 100644
--- a/arch/arm/lib/lshrdi3.S
+++ b/arch/arm/lib/lshrdi3.S
@@ -28,6 +28,7 @@ Boston, MA 02110-1301, USA. */
28 28
29#include <linux/linkage.h> 29#include <linux/linkage.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/export.h>
31 32
32#ifdef __ARMEB__ 33#ifdef __ARMEB__
33#define al r1 34#define al r1
@@ -52,3 +53,5 @@ ENTRY(__aeabi_llsr)
52 53
53ENDPROC(__lshrdi3) 54ENDPROC(__lshrdi3)
54ENDPROC(__aeabi_llsr) 55ENDPROC(__aeabi_llsr)
56EXPORT_SYMBOL(__lshrdi3)
57EXPORT_SYMBOL(__aeabi_llsr)
diff --git a/arch/arm/lib/memchr.S b/arch/arm/lib/memchr.S
index 74a5bed6d999..44182bf686a5 100644
--- a/arch/arm/lib/memchr.S
+++ b/arch/arm/lib/memchr.S
@@ -11,6 +11,7 @@
11 */ 11 */
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/export.h>
14 15
15 .text 16 .text
16 .align 5 17 .align 5
@@ -24,3 +25,4 @@ ENTRY(memchr)
242: movne r0, #0 252: movne r0, #0
25 ret lr 26 ret lr
26ENDPROC(memchr) 27ENDPROC(memchr)
28EXPORT_SYMBOL(memchr)
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index 64111bd4440b..1be5b6ddf37c 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -13,6 +13,7 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/unwind.h> 15#include <asm/unwind.h>
16#include <asm/export.h>
16 17
17#define LDR1W_SHIFT 0 18#define LDR1W_SHIFT 0
18#define STR1W_SHIFT 0 19#define STR1W_SHIFT 0
@@ -68,3 +69,5 @@ ENTRY(memcpy)
68 69
69ENDPROC(memcpy) 70ENDPROC(memcpy)
70ENDPROC(mmiocpy) 71ENDPROC(mmiocpy)
72EXPORT_SYMBOL(memcpy)
73EXPORT_SYMBOL(mmiocpy)
diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S
index 69a9d47fc5ab..71dcc5400d02 100644
--- a/arch/arm/lib/memmove.S
+++ b/arch/arm/lib/memmove.S
@@ -13,6 +13,7 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/unwind.h> 15#include <asm/unwind.h>
16#include <asm/export.h>
16 17
17 .text 18 .text
18 19
@@ -225,3 +226,4 @@ ENTRY(memmove)
22518: backward_copy_shift push=24 pull=8 22618: backward_copy_shift push=24 pull=8
226 227
227ENDPROC(memmove) 228ENDPROC(memmove)
229EXPORT_SYMBOL(memmove)
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
index 3c65e3bd790f..7b72044cba62 100644
--- a/arch/arm/lib/memset.S
+++ b/arch/arm/lib/memset.S
@@ -12,6 +12,7 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/unwind.h> 14#include <asm/unwind.h>
15#include <asm/export.h>
15 16
16 .text 17 .text
17 .align 5 18 .align 5
@@ -135,3 +136,5 @@ UNWIND( .fnstart )
135UNWIND( .fnend ) 136UNWIND( .fnend )
136ENDPROC(memset) 137ENDPROC(memset)
137ENDPROC(mmioset) 138ENDPROC(mmioset)
139EXPORT_SYMBOL(memset)
140EXPORT_SYMBOL(mmioset)
diff --git a/arch/arm/lib/memzero.S b/arch/arm/lib/memzero.S
index 0eded952e089..6dec26ed5bcc 100644
--- a/arch/arm/lib/memzero.S
+++ b/arch/arm/lib/memzero.S
@@ -10,6 +10,7 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/unwind.h> 12#include <asm/unwind.h>
13#include <asm/export.h>
13 14
14 .text 15 .text
15 .align 5 16 .align 5
@@ -135,3 +136,4 @@ UNWIND( .fnstart )
135 ret lr @ 1 136 ret lr @ 1
136UNWIND( .fnend ) 137UNWIND( .fnend )
137ENDPROC(__memzero) 138ENDPROC(__memzero)
139EXPORT_SYMBOL(__memzero)
diff --git a/arch/arm/lib/muldi3.S b/arch/arm/lib/muldi3.S
index 204305956925..b8f12388ccac 100644
--- a/arch/arm/lib/muldi3.S
+++ b/arch/arm/lib/muldi3.S
@@ -12,6 +12,7 @@
12 12
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/export.h>
15 16
16#ifdef __ARMEB__ 17#ifdef __ARMEB__
17#define xh r0 18#define xh r0
@@ -46,3 +47,5 @@ ENTRY(__aeabi_lmul)
46 47
47ENDPROC(__muldi3) 48ENDPROC(__muldi3)
48ENDPROC(__aeabi_lmul) 49ENDPROC(__aeabi_lmul)
50EXPORT_SYMBOL(__muldi3)
51EXPORT_SYMBOL(__aeabi_lmul)
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S
index 38d660d3705f..11de126e2ed6 100644
--- a/arch/arm/lib/putuser.S
+++ b/arch/arm/lib/putuser.S
@@ -31,6 +31,7 @@
31#include <asm/assembler.h> 31#include <asm/assembler.h>
32#include <asm/errno.h> 32#include <asm/errno.h>
33#include <asm/domain.h> 33#include <asm/domain.h>
34#include <asm/export.h>
34 35
35ENTRY(__put_user_1) 36ENTRY(__put_user_1)
36 check_uaccess r0, 1, r1, ip, __put_user_bad 37 check_uaccess r0, 1, r1, ip, __put_user_bad
@@ -38,6 +39,7 @@ ENTRY(__put_user_1)
38 mov r0, #0 39 mov r0, #0
39 ret lr 40 ret lr
40ENDPROC(__put_user_1) 41ENDPROC(__put_user_1)
42EXPORT_SYMBOL(__put_user_1)
41 43
42ENTRY(__put_user_2) 44ENTRY(__put_user_2)
43 check_uaccess r0, 2, r1, ip, __put_user_bad 45 check_uaccess r0, 2, r1, ip, __put_user_bad
@@ -62,6 +64,7 @@ ENTRY(__put_user_2)
62 mov r0, #0 64 mov r0, #0
63 ret lr 65 ret lr
64ENDPROC(__put_user_2) 66ENDPROC(__put_user_2)
67EXPORT_SYMBOL(__put_user_2)
65 68
66ENTRY(__put_user_4) 69ENTRY(__put_user_4)
67 check_uaccess r0, 4, r1, ip, __put_user_bad 70 check_uaccess r0, 4, r1, ip, __put_user_bad
@@ -69,6 +72,7 @@ ENTRY(__put_user_4)
69 mov r0, #0 72 mov r0, #0
70 ret lr 73 ret lr
71ENDPROC(__put_user_4) 74ENDPROC(__put_user_4)
75EXPORT_SYMBOL(__put_user_4)
72 76
73ENTRY(__put_user_8) 77ENTRY(__put_user_8)
74 check_uaccess r0, 8, r1, ip, __put_user_bad 78 check_uaccess r0, 8, r1, ip, __put_user_bad
@@ -82,6 +86,7 @@ ENTRY(__put_user_8)
82 mov r0, #0 86 mov r0, #0
83 ret lr 87 ret lr
84ENDPROC(__put_user_8) 88ENDPROC(__put_user_8)
89EXPORT_SYMBOL(__put_user_8)
85 90
86__put_user_bad: 91__put_user_bad:
87 mov r0, #-EFAULT 92 mov r0, #-EFAULT
diff --git a/arch/arm/lib/strchr.S b/arch/arm/lib/strchr.S
index 013d64c71e8d..7301f6e6046c 100644
--- a/arch/arm/lib/strchr.S
+++ b/arch/arm/lib/strchr.S
@@ -11,6 +11,7 @@
11 */ 11 */
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/export.h>
14 15
15 .text 16 .text
16 .align 5 17 .align 5
@@ -25,3 +26,4 @@ ENTRY(strchr)
25 subeq r0, r0, #1 26 subeq r0, r0, #1
26 ret lr 27 ret lr
27ENDPROC(strchr) 28ENDPROC(strchr)
29EXPORT_SYMBOL(strchr)
diff --git a/arch/arm/lib/strrchr.S b/arch/arm/lib/strrchr.S
index 3cec1c7482c4..aaf9fd98b754 100644
--- a/arch/arm/lib/strrchr.S
+++ b/arch/arm/lib/strrchr.S
@@ -11,6 +11,7 @@
11 */ 11 */
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/export.h>
14 15
15 .text 16 .text
16 .align 5 17 .align 5
@@ -24,3 +25,4 @@ ENTRY(strrchr)
24 mov r0, r3 25 mov r0, r3
25 ret lr 26 ret lr
26ENDPROC(strrchr) 27ENDPROC(strrchr)
28EXPORT_SYMBOL(strrchr)
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
index 6bd1089b07e0..1626e3a551a1 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
@@ -19,6 +19,7 @@
19#include <linux/gfp.h> 19#include <linux/gfp.h>
20#include <linux/highmem.h> 20#include <linux/highmem.h>
21#include <linux/hugetlb.h> 21#include <linux/hugetlb.h>
22#include <linux/export.h>
22#include <asm/current.h> 23#include <asm/current.h>
23#include <asm/page.h> 24#include <asm/page.h>
24 25
@@ -156,6 +157,7 @@ arm_copy_to_user(void __user *to, const void *from, unsigned long n)
156 } 157 }
157 return n; 158 return n;
158} 159}
160EXPORT_SYMBOL(arm_copy_to_user);
159 161
160static unsigned long noinline 162static unsigned long noinline
161__clear_user_memset(void __user *addr, unsigned long n) 163__clear_user_memset(void __user *addr, unsigned long n)
@@ -213,6 +215,7 @@ unsigned long arm_clear_user(void __user *addr, unsigned long n)
213 } 215 }
214 return n; 216 return n;
215} 217}
218EXPORT_SYMBOL(arm_clear_user);
216 219
217#if 0 220#if 0
218 221
diff --git a/arch/arm/lib/ucmpdi2.S b/arch/arm/lib/ucmpdi2.S
index ad4a6309141a..127a91af46f3 100644
--- a/arch/arm/lib/ucmpdi2.S
+++ b/arch/arm/lib/ucmpdi2.S
@@ -12,6 +12,7 @@
12 12
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/export.h>
15 16
16#ifdef __ARMEB__ 17#ifdef __ARMEB__
17#define xh r0 18#define xh r0
@@ -35,6 +36,7 @@ ENTRY(__ucmpdi2)
35 ret lr 36 ret lr
36 37
37ENDPROC(__ucmpdi2) 38ENDPROC(__ucmpdi2)
39EXPORT_SYMBOL(__ucmpdi2)
38 40
39#ifdef CONFIG_AEABI 41#ifdef CONFIG_AEABI
40 42
@@ -48,6 +50,7 @@ ENTRY(__aeabi_ulcmp)
48 ret lr 50 ret lr
49 51
50ENDPROC(__aeabi_ulcmp) 52ENDPROC(__aeabi_ulcmp)
53EXPORT_SYMBOL(__aeabi_ulcmp)
51 54
52#endif 55#endif
53 56
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index cab128913e72..737450fe790c 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -32,7 +32,6 @@ endif
32 32
33ifdef CONFIG_SND_IMX_SOC 33ifdef CONFIG_SND_IMX_SOC
34obj-y += ssi-fiq.o 34obj-y += ssi-fiq.o
35obj-y += ssi-fiq-ksym.o
36endif 35endif
37 36
38# i.MX21 based machines 37# i.MX21 based machines
diff --git a/arch/arm/mach-imx/ssi-fiq-ksym.c b/arch/arm/mach-imx/ssi-fiq-ksym.c
deleted file mode 100644
index 792090f9a032..000000000000
--- a/arch/arm/mach-imx/ssi-fiq-ksym.c
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Exported ksyms for the SSI FIQ handler
3 *
4 * Copyright (C) 2009, Sascha Hauer <s.hauer@pengutronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12
13#include <linux/platform_data/asoc-imx-ssi.h>
14
15EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer);
16EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer);
17EXPORT_SYMBOL(imx_ssi_fiq_start);
18EXPORT_SYMBOL(imx_ssi_fiq_end);
19EXPORT_SYMBOL(imx_ssi_fiq_base);
20
diff --git a/arch/arm/mach-imx/ssi-fiq.S b/arch/arm/mach-imx/ssi-fiq.S
index a8b93c5f29b5..fd7917f1c204 100644
--- a/arch/arm/mach-imx/ssi-fiq.S
+++ b/arch/arm/mach-imx/ssi-fiq.S
@@ -8,6 +8,7 @@
8 8
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/assembler.h> 10#include <asm/assembler.h>
11#include <asm/export.h>
11 12
12/* 13/*
13 * r8 = bit 0-15: tx offset, bit 16-31: tx buffer size 14 * r8 = bit 0-15: tx offset, bit 16-31: tx buffer size
@@ -144,4 +145,8 @@ imx_ssi_fiq_tx_buffer:
144 .word 0x0 145 .word 0x0
145.L_imx_ssi_fiq_end: 146.L_imx_ssi_fiq_end:
146imx_ssi_fiq_end: 147imx_ssi_fiq_end:
147 148EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer)
149EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer)
150EXPORT_SYMBOL(imx_ssi_fiq_start)
151EXPORT_SYMBOL(imx_ssi_fiq_end)
152EXPORT_SYMBOL(imx_ssi_fiq_base)
diff --git a/arch/ia64/hp/sim/boot/Makefile b/arch/ia64/hp/sim/boot/Makefile
index 2e805e0cc560..df6e9968c845 100644
--- a/arch/ia64/hp/sim/boot/Makefile
+++ b/arch/ia64/hp/sim/boot/Makefile
@@ -33,5 +33,5 @@ $(obj)/vmlinux.bin: vmlinux FORCE
33LDFLAGS_bootloader = -static -T 33LDFLAGS_bootloader = -static -T
34 34
35$(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o $(obj)/boot_head.o $(obj)/fw-emu.o \ 35$(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o $(obj)/boot_head.o $(obj)/fw-emu.o \
36 lib/lib.a arch/ia64/lib/built-in.o arch/ia64/lib/lib.a FORCE 36 lib/lib.a arch/ia64/lib/lib.a FORCE
37 $(call if_changed,ld) 37 $(call if_changed,ld)
diff --git a/arch/ia64/include/asm/export.h b/arch/ia64/include/asm/export.h
new file mode 100644
index 000000000000..ad18c6583252
--- /dev/null
+++ b/arch/ia64/include/asm/export.h
@@ -0,0 +1,3 @@
1/* EXPORT_DATA_SYMBOL != EXPORT_SYMBOL here */
2#define KSYM_FUNC(name) @fptr(name)
3#include <asm-generic/export.h>
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index cfaa7b25084c..6f27a663177c 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -48,6 +48,7 @@
48#include <asm/thread_info.h> 48#include <asm/thread_info.h>
49#include <asm/unistd.h> 49#include <asm/unistd.h>
50#include <asm/ftrace.h> 50#include <asm/ftrace.h>
51#include <asm/export.h>
51 52
52#include "minstate.h" 53#include "minstate.h"
53 54
@@ -1345,12 +1346,14 @@ GLOBAL_ENTRY(unw_init_running)
1345 mov rp=loc0 1346 mov rp=loc0
1346 br.ret.sptk.many rp 1347 br.ret.sptk.many rp
1347END(unw_init_running) 1348END(unw_init_running)
1349EXPORT_SYMBOL(unw_init_running)
1348 1350
1349#ifdef CONFIG_FUNCTION_TRACER 1351#ifdef CONFIG_FUNCTION_TRACER
1350#ifdef CONFIG_DYNAMIC_FTRACE 1352#ifdef CONFIG_DYNAMIC_FTRACE
1351GLOBAL_ENTRY(_mcount) 1353GLOBAL_ENTRY(_mcount)
1352 br ftrace_stub 1354 br ftrace_stub
1353END(_mcount) 1355END(_mcount)
1356EXPORT_SYMBOL(_mcount)
1354 1357
1355.here: 1358.here:
1356 br.ret.sptk.many b0 1359 br.ret.sptk.many b0
diff --git a/arch/ia64/kernel/esi_stub.S b/arch/ia64/kernel/esi_stub.S
index 6b3d6c1f99b6..2c369bf77c4b 100644
--- a/arch/ia64/kernel/esi_stub.S
+++ b/arch/ia64/kernel/esi_stub.S
@@ -35,6 +35,7 @@
35 35
36#include <asm/processor.h> 36#include <asm/processor.h>
37#include <asm/asmmacro.h> 37#include <asm/asmmacro.h>
38#include <asm/export.h>
38 39
39/* 40/*
40 * Inputs: 41 * Inputs:
@@ -94,3 +95,4 @@ GLOBAL_ENTRY(esi_call_phys)
94 mov gp=loc2 95 mov gp=loc2
95 br.ret.sptk.many rp 96 br.ret.sptk.many rp
96END(esi_call_phys) 97END(esi_call_phys)
98EXPORT_SYMBOL_GPL(esi_call_phys)
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index bb748c596443..c9b5e942f671 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -32,6 +32,7 @@
32#include <asm/mca_asm.h> 32#include <asm/mca_asm.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/linkage.h> 34#include <linux/linkage.h>
35#include <asm/export.h>
35 36
36#ifdef CONFIG_HOTPLUG_CPU 37#ifdef CONFIG_HOTPLUG_CPU
37#define SAL_PSR_BITS_TO_SET \ 38#define SAL_PSR_BITS_TO_SET \
@@ -168,6 +169,7 @@ RestRR: \
168 __PAGE_ALIGNED_DATA 169 __PAGE_ALIGNED_DATA
169 170
170 .global empty_zero_page 171 .global empty_zero_page
172EXPORT_DATA_SYMBOL_GPL(empty_zero_page)
171empty_zero_page: 173empty_zero_page:
172 .skip PAGE_SIZE 174 .skip PAGE_SIZE
173 175
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index 096731049538..d111248af719 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -1,101 +1,11 @@
1/* 1/*
2 * Architecture-specific kernel symbols 2 * Architecture-specific kernel symbols
3 *
4 * Don't put any exports here unless it's defined in an assembler file.
5 * All other exports should be put directly after the definition.
6 */ 3 */
7 4
8#include <linux/module.h>
9
10#include <linux/string.h>
11EXPORT_SYMBOL(memset);
12EXPORT_SYMBOL(memcpy);
13EXPORT_SYMBOL(strlen);
14
15#include <asm/pgtable.h>
16EXPORT_SYMBOL_GPL(empty_zero_page);
17
18#include <asm/checksum.h>
19EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */
20EXPORT_SYMBOL(csum_ipv6_magic);
21
22#include <asm/page.h>
23EXPORT_SYMBOL(clear_page);
24EXPORT_SYMBOL(copy_page);
25
26#ifdef CONFIG_VIRTUAL_MEM_MAP 5#ifdef CONFIG_VIRTUAL_MEM_MAP
6#include <linux/compiler.h>
7#include <linux/export.h>
27#include <linux/bootmem.h> 8#include <linux/bootmem.h>
28EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported by generic code */ 9EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported by generic code */
29EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */ 10EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */
30#endif 11#endif
31
32#include <asm/processor.h>
33EXPORT_SYMBOL(ia64_cpu_info);
34#ifdef CONFIG_SMP
35EXPORT_SYMBOL(local_per_cpu_offset);
36#endif
37
38#include <asm/uaccess.h>
39EXPORT_SYMBOL(__copy_user);
40EXPORT_SYMBOL(__do_clear_user);
41EXPORT_SYMBOL(__strlen_user);
42EXPORT_SYMBOL(__strncpy_from_user);
43EXPORT_SYMBOL(__strnlen_user);
44
45/* from arch/ia64/lib */
46extern void __divsi3(void);
47extern void __udivsi3(void);
48extern void __modsi3(void);
49extern void __umodsi3(void);
50extern void __divdi3(void);
51extern void __udivdi3(void);
52extern void __moddi3(void);
53extern void __umoddi3(void);
54
55EXPORT_SYMBOL(__divsi3);
56EXPORT_SYMBOL(__udivsi3);
57EXPORT_SYMBOL(__modsi3);
58EXPORT_SYMBOL(__umodsi3);
59EXPORT_SYMBOL(__divdi3);
60EXPORT_SYMBOL(__udivdi3);
61EXPORT_SYMBOL(__moddi3);
62EXPORT_SYMBOL(__umoddi3);
63
64#if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE)
65extern void xor_ia64_2(void);
66extern void xor_ia64_3(void);
67extern void xor_ia64_4(void);
68extern void xor_ia64_5(void);
69
70EXPORT_SYMBOL(xor_ia64_2);
71EXPORT_SYMBOL(xor_ia64_3);
72EXPORT_SYMBOL(xor_ia64_4);
73EXPORT_SYMBOL(xor_ia64_5);
74#endif
75
76#include <asm/pal.h>
77EXPORT_SYMBOL(ia64_pal_call_phys_stacked);
78EXPORT_SYMBOL(ia64_pal_call_phys_static);
79EXPORT_SYMBOL(ia64_pal_call_stacked);
80EXPORT_SYMBOL(ia64_pal_call_static);
81EXPORT_SYMBOL(ia64_load_scratch_fpregs);
82EXPORT_SYMBOL(ia64_save_scratch_fpregs);
83
84#include <asm/unwind.h>
85EXPORT_SYMBOL(unw_init_running);
86
87#if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE)
88extern void esi_call_phys (void);
89EXPORT_SYMBOL_GPL(esi_call_phys);
90#endif
91extern char ia64_ivt[];
92EXPORT_SYMBOL(ia64_ivt);
93
94#include <asm/ftrace.h>
95#ifdef CONFIG_FUNCTION_TRACER
96/* mcount is defined in assembly */
97EXPORT_SYMBOL(_mcount);
98#endif
99
100#include <asm/cacheflush.h>
101EXPORT_SYMBOL_GPL(flush_icache_range);
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index b1c3cfc93e71..44a103a5de2b 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -57,6 +57,7 @@
57#include <asm/thread_info.h> 57#include <asm/thread_info.h>
58#include <asm/unistd.h> 58#include <asm/unistd.h>
59#include <asm/errno.h> 59#include <asm/errno.h>
60#include <asm/export.h>
60 61
61#if 0 62#if 0
62# define PSR_DEFAULT_BITS psr.ac 63# define PSR_DEFAULT_BITS psr.ac
@@ -85,6 +86,7 @@
85 86
86 .align 32768 // align on 32KB boundary 87 .align 32768 // align on 32KB boundary
87 .global ia64_ivt 88 .global ia64_ivt
89 EXPORT_DATA_SYMBOL(ia64_ivt)
88ia64_ivt: 90ia64_ivt:
89///////////////////////////////////////////////////////////////////////////////////////// 91/////////////////////////////////////////////////////////////////////////////////////////
90// 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47) 92// 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 0b533441c3c9..94fb2e395498 100644
--- a/arch/ia64/kernel/pal.S
+++ b/arch/ia64/kernel/pal.S
@@ -14,6 +14,7 @@
14 14
15#include <asm/asmmacro.h> 15#include <asm/asmmacro.h>
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <asm/export.h>
17 18
18 .data 19 .data
19pal_entry_point: 20pal_entry_point:
@@ -87,6 +88,7 @@ GLOBAL_ENTRY(ia64_pal_call_static)
87 srlz.d // seralize restoration of psr.l 88 srlz.d // seralize restoration of psr.l
88 br.ret.sptk.many b0 89 br.ret.sptk.many b0
89END(ia64_pal_call_static) 90END(ia64_pal_call_static)
91EXPORT_SYMBOL(ia64_pal_call_static)
90 92
91/* 93/*
92 * Make a PAL call using the stacked registers calling convention. 94 * Make a PAL call using the stacked registers calling convention.
@@ -122,6 +124,7 @@ GLOBAL_ENTRY(ia64_pal_call_stacked)
122 srlz.d // serialize restoration of psr.l 124 srlz.d // serialize restoration of psr.l
123 br.ret.sptk.many b0 125 br.ret.sptk.many b0
124END(ia64_pal_call_stacked) 126END(ia64_pal_call_stacked)
127EXPORT_SYMBOL(ia64_pal_call_stacked)
125 128
126/* 129/*
127 * Make a physical mode PAL call using the static registers calling convention. 130 * Make a physical mode PAL call using the static registers calling convention.
@@ -193,6 +196,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
193 srlz.d // seralize restoration of psr.l 196 srlz.d // seralize restoration of psr.l
194 br.ret.sptk.many b0 197 br.ret.sptk.many b0
195END(ia64_pal_call_phys_static) 198END(ia64_pal_call_phys_static)
199EXPORT_SYMBOL(ia64_pal_call_phys_static)
196 200
197/* 201/*
198 * Make a PAL call using the stacked registers in physical mode. 202 * Make a PAL call using the stacked registers in physical mode.
@@ -250,6 +254,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
250 srlz.d // seralize restoration of psr.l 254 srlz.d // seralize restoration of psr.l
251 br.ret.sptk.many b0 255 br.ret.sptk.many b0
252END(ia64_pal_call_phys_stacked) 256END(ia64_pal_call_phys_stacked)
257EXPORT_SYMBOL(ia64_pal_call_phys_stacked)
253 258
254/* 259/*
255 * Save scratch fp scratch regs which aren't saved in pt_regs already 260 * Save scratch fp scratch regs which aren't saved in pt_regs already
@@ -275,6 +280,7 @@ GLOBAL_ENTRY(ia64_save_scratch_fpregs)
275 stf.spill [r2] = f15,32 280 stf.spill [r2] = f15,32
276 br.ret.sptk.many rp 281 br.ret.sptk.many rp
277END(ia64_save_scratch_fpregs) 282END(ia64_save_scratch_fpregs)
283EXPORT_SYMBOL(ia64_save_scratch_fpregs)
278 284
279/* 285/*
280 * Load scratch fp scratch regs (fp10-fp15) 286 * Load scratch fp scratch regs (fp10-fp15)
@@ -296,3 +302,4 @@ GLOBAL_ENTRY(ia64_load_scratch_fpregs)
296 ldf.fill f15 = [r2],32 302 ldf.fill f15 = [r2],32
297 br.ret.sptk.many rp 303 br.ret.sptk.many rp
298END(ia64_load_scratch_fpregs) 304END(ia64_load_scratch_fpregs)
305EXPORT_SYMBOL(ia64_load_scratch_fpregs)
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index afddb3e80a29..7ec7acc844c2 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -71,7 +71,11 @@ EXPORT_SYMBOL(__per_cpu_offset);
71#endif 71#endif
72 72
73DEFINE_PER_CPU(struct cpuinfo_ia64, ia64_cpu_info); 73DEFINE_PER_CPU(struct cpuinfo_ia64, ia64_cpu_info);
74EXPORT_SYMBOL(ia64_cpu_info);
74DEFINE_PER_CPU(unsigned long, local_per_cpu_offset); 75DEFINE_PER_CPU(unsigned long, local_per_cpu_offset);
76#ifdef CONFIG_SMP
77EXPORT_SYMBOL(local_per_cpu_offset);
78#endif
75unsigned long ia64_cycles_per_usec; 79unsigned long ia64_cycles_per_usec;
76struct ia64_boot_param *ia64_boot_param; 80struct ia64_boot_param *ia64_boot_param;
77struct screen_info screen_info; 81struct screen_info screen_info;
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 98771e2a78af..1f3d3877618f 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -2,17 +2,15 @@
2# Makefile for ia64-specific library routines.. 2# Makefile for ia64-specific library routines..
3# 3#
4 4
5obj-y := io.o 5lib-y := io.o __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
6
7lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
8 __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ 6 __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \
9 checksum.o clear_page.o csum_partial_copy.o \ 7 checksum.o clear_page.o csum_partial_copy.o \
10 clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ 8 clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \
11 flush.o ip_fast_csum.o do_csum.o \ 9 flush.o ip_fast_csum.o do_csum.o \
12 memset.o strlen.o xor.o 10 memset.o strlen.o xor.o
13 11
14obj-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o 12lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
15obj-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o 13lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
16lib-$(CONFIG_PERFMON) += carta_random.o 14lib-$(CONFIG_PERFMON) += carta_random.o
17 15
18AFLAGS___divdi3.o = 16AFLAGS___divdi3.o =
diff --git a/arch/ia64/lib/clear_page.S b/arch/ia64/lib/clear_page.S
index 2d814e7ed191..3cf5b76e587f 100644
--- a/arch/ia64/lib/clear_page.S
+++ b/arch/ia64/lib/clear_page.S
@@ -11,6 +11,7 @@
11 11
12#include <asm/asmmacro.h> 12#include <asm/asmmacro.h>
13#include <asm/page.h> 13#include <asm/page.h>
14#include <asm/export.h>
14 15
15#ifdef CONFIG_ITANIUM 16#ifdef CONFIG_ITANIUM
16# define L3_LINE_SIZE 64 // Itanium L3 line size 17# define L3_LINE_SIZE 64 // Itanium L3 line size
@@ -74,3 +75,4 @@ GLOBAL_ENTRY(clear_page)
74 mov ar.lc = saved_lc // restore lc 75 mov ar.lc = saved_lc // restore lc
75 br.ret.sptk.many rp 76 br.ret.sptk.many rp
76END(clear_page) 77END(clear_page)
78EXPORT_SYMBOL(clear_page)
diff --git a/arch/ia64/lib/clear_user.S b/arch/ia64/lib/clear_user.S
index eecd8577b209..7b40731ee5d8 100644
--- a/arch/ia64/lib/clear_user.S
+++ b/arch/ia64/lib/clear_user.S
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <asm/asmmacro.h> 14#include <asm/asmmacro.h>
15#include <asm/export.h>
15 16
16// 17//
17// arguments 18// arguments
@@ -207,3 +208,4 @@ GLOBAL_ENTRY(__do_clear_user)
207 mov ar.lc=saved_lc 208 mov ar.lc=saved_lc
208 br.ret.sptk.many rp 209 br.ret.sptk.many rp
209END(__do_clear_user) 210END(__do_clear_user)
211EXPORT_SYMBOL(__do_clear_user)
diff --git a/arch/ia64/lib/copy_page.S b/arch/ia64/lib/copy_page.S
index 127d1d050d78..cbdb9e323ffb 100644
--- a/arch/ia64/lib/copy_page.S
+++ b/arch/ia64/lib/copy_page.S
@@ -16,6 +16,7 @@
16 */ 16 */
17#include <asm/asmmacro.h> 17#include <asm/asmmacro.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/export.h>
19 20
20#define PIPE_DEPTH 3 21#define PIPE_DEPTH 3
21#define EPI p[PIPE_DEPTH-1] 22#define EPI p[PIPE_DEPTH-1]
@@ -96,3 +97,4 @@ GLOBAL_ENTRY(copy_page)
96 mov ar.lc=saved_lc 97 mov ar.lc=saved_lc
97 br.ret.sptk.many rp 98 br.ret.sptk.many rp
98END(copy_page) 99END(copy_page)
100EXPORT_SYMBOL(copy_page)
diff --git a/arch/ia64/lib/copy_page_mck.S b/arch/ia64/lib/copy_page_mck.S
index 3c45d60a81b4..c13f69036876 100644
--- a/arch/ia64/lib/copy_page_mck.S
+++ b/arch/ia64/lib/copy_page_mck.S
@@ -61,6 +61,7 @@
61 */ 61 */
62#include <asm/asmmacro.h> 62#include <asm/asmmacro.h>
63#include <asm/page.h> 63#include <asm/page.h>
64#include <asm/export.h>
64 65
65#define PREFETCH_DIST 8 // McKinley sustains 16 outstanding L2 misses (8 ld, 8 st) 66#define PREFETCH_DIST 8 // McKinley sustains 16 outstanding L2 misses (8 ld, 8 st)
66 67
@@ -183,3 +184,4 @@ GLOBAL_ENTRY(copy_page)
183 mov pr = saved_pr, -1 184 mov pr = saved_pr, -1
184 br.ret.sptk.many rp 185 br.ret.sptk.many rp
185END(copy_page) 186END(copy_page)
187EXPORT_SYMBOL(copy_page)
diff --git a/arch/ia64/lib/copy_user.S b/arch/ia64/lib/copy_user.S
index c952bdc6a093..66facd52e8d0 100644
--- a/arch/ia64/lib/copy_user.S
+++ b/arch/ia64/lib/copy_user.S
@@ -30,6 +30,7 @@
30 */ 30 */
31 31
32#include <asm/asmmacro.h> 32#include <asm/asmmacro.h>
33#include <asm/export.h>
33 34
34// 35//
35// Tuneable parameters 36// Tuneable parameters
@@ -608,3 +609,4 @@ GLOBAL_ENTRY(__copy_user)
608 mov ar.pfs=saved_pfs 609 mov ar.pfs=saved_pfs
609 br.ret.sptk.many rp 610 br.ret.sptk.many rp
610END(__copy_user) 611END(__copy_user)
612EXPORT_SYMBOL(__copy_user)
diff --git a/arch/ia64/lib/flush.S b/arch/ia64/lib/flush.S
index 1d8c88860063..9a5a2f9fad13 100644
--- a/arch/ia64/lib/flush.S
+++ b/arch/ia64/lib/flush.S
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#include <asm/asmmacro.h> 10#include <asm/asmmacro.h>
11#include <asm/export.h>
11 12
12 13
13 /* 14 /*
@@ -60,6 +61,7 @@ GLOBAL_ENTRY(flush_icache_range)
60 mov ar.lc=r3 // restore ar.lc 61 mov ar.lc=r3 // restore ar.lc
61 br.ret.sptk.many rp 62 br.ret.sptk.many rp
62END(flush_icache_range) 63END(flush_icache_range)
64EXPORT_SYMBOL_GPL(flush_icache_range)
63 65
64 /* 66 /*
65 * clflush_cache_range(start,size) 67 * clflush_cache_range(start,size)
diff --git a/arch/ia64/lib/idiv32.S b/arch/ia64/lib/idiv32.S
index c91b5b0129ff..715aed79a9ce 100644
--- a/arch/ia64/lib/idiv32.S
+++ b/arch/ia64/lib/idiv32.S
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <asm/asmmacro.h> 17#include <asm/asmmacro.h>
18#include <asm/export.h>
18 19
19#ifdef MODULO 20#ifdef MODULO
20# define OP mod 21# define OP mod
@@ -81,3 +82,4 @@ GLOBAL_ENTRY(NAME)
81 getf.sig r8 = f6 // transfer result to result register 82 getf.sig r8 = f6 // transfer result to result register
82 br.ret.sptk.many rp 83 br.ret.sptk.many rp
83END(NAME) 84END(NAME)
85EXPORT_SYMBOL(NAME)
diff --git a/arch/ia64/lib/idiv64.S b/arch/ia64/lib/idiv64.S
index 627573c4ceb1..25840f697753 100644
--- a/arch/ia64/lib/idiv64.S
+++ b/arch/ia64/lib/idiv64.S
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <asm/asmmacro.h> 17#include <asm/asmmacro.h>
18#include <asm/export.h>
18 19
19#ifdef MODULO 20#ifdef MODULO
20# define OP mod 21# define OP mod
@@ -78,3 +79,4 @@ GLOBAL_ENTRY(NAME)
78 getf.sig r8 = f11 // transfer result to result register 79 getf.sig r8 = f11 // transfer result to result register
79 br.ret.sptk.many rp 80 br.ret.sptk.many rp
80END(NAME) 81END(NAME)
82EXPORT_SYMBOL(NAME)
diff --git a/arch/ia64/lib/ip_fast_csum.S b/arch/ia64/lib/ip_fast_csum.S
index 620d9dc5220f..648e0d4a4839 100644
--- a/arch/ia64/lib/ip_fast_csum.S
+++ b/arch/ia64/lib/ip_fast_csum.S
@@ -13,6 +13,7 @@
13 */ 13 */
14 14
15#include <asm/asmmacro.h> 15#include <asm/asmmacro.h>
16#include <asm/export.h>
16 17
17/* 18/*
18 * Since we know that most likely this function is called with buf aligned 19 * Since we know that most likely this function is called with buf aligned
@@ -92,6 +93,7 @@ GLOBAL_ENTRY(ip_fast_csum)
92 mov b0=r34 93 mov b0=r34
93 br.ret.sptk.many b0 94 br.ret.sptk.many b0
94END(ip_fast_csum) 95END(ip_fast_csum)
96EXPORT_SYMBOL(ip_fast_csum)
95 97
96GLOBAL_ENTRY(csum_ipv6_magic) 98GLOBAL_ENTRY(csum_ipv6_magic)
97 ld4 r20=[in0],4 99 ld4 r20=[in0],4
@@ -142,3 +144,4 @@ GLOBAL_ENTRY(csum_ipv6_magic)
142 andcm r8=r9,r8 144 andcm r8=r9,r8
143 br.ret.sptk.many b0 145 br.ret.sptk.many b0
144END(csum_ipv6_magic) 146END(csum_ipv6_magic)
147EXPORT_SYMBOL(csum_ipv6_magic)
diff --git a/arch/ia64/lib/memcpy.S b/arch/ia64/lib/memcpy.S
index 448908d80b69..ba172fd6acf4 100644
--- a/arch/ia64/lib/memcpy.S
+++ b/arch/ia64/lib/memcpy.S
@@ -14,6 +14,7 @@
14 * David Mosberger-Tang <davidm@hpl.hp.com> 14 * David Mosberger-Tang <davidm@hpl.hp.com>
15 */ 15 */
16#include <asm/asmmacro.h> 16#include <asm/asmmacro.h>
17#include <asm/export.h>
17 18
18GLOBAL_ENTRY(memcpy) 19GLOBAL_ENTRY(memcpy)
19 20
@@ -299,3 +300,4 @@ GLOBAL_ENTRY(memcpy)
299 COPY(56, 0) 300 COPY(56, 0)
300 301
301END(memcpy) 302END(memcpy)
303EXPORT_SYMBOL(memcpy)
diff --git a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S
index ab0f87639729..b264b6a7967b 100644
--- a/arch/ia64/lib/memcpy_mck.S
+++ b/arch/ia64/lib/memcpy_mck.S
@@ -15,6 +15,7 @@
15 */ 15 */
16#include <asm/asmmacro.h> 16#include <asm/asmmacro.h>
17#include <asm/page.h> 17#include <asm/page.h>
18#include <asm/export.h>
18 19
19#define EK(y...) EX(y) 20#define EK(y...) EX(y)
20 21
@@ -78,6 +79,7 @@ GLOBAL_ENTRY(memcpy)
78 br.cond.sptk .common_code 79 br.cond.sptk .common_code
79 ;; 80 ;;
80END(memcpy) 81END(memcpy)
82EXPORT_SYMBOL(memcpy)
81GLOBAL_ENTRY(__copy_user) 83GLOBAL_ENTRY(__copy_user)
82 .prologue 84 .prologue
83// check dest alignment 85// check dest alignment
@@ -664,3 +666,4 @@ EK(.ex_handler, (p17) st8 [dst1]=r39,8); \
664 666
665/* end of McKinley specific optimization */ 667/* end of McKinley specific optimization */
666END(__copy_user) 668END(__copy_user)
669EXPORT_SYMBOL(__copy_user)
diff --git a/arch/ia64/lib/memset.S b/arch/ia64/lib/memset.S
index f26c16aefb1c..87b974704075 100644
--- a/arch/ia64/lib/memset.S
+++ b/arch/ia64/lib/memset.S
@@ -18,6 +18,7 @@
18 to get peak speed when value = 0. */ 18 to get peak speed when value = 0. */
19 19
20#include <asm/asmmacro.h> 20#include <asm/asmmacro.h>
21#include <asm/export.h>
21#undef ret 22#undef ret
22 23
23#define dest in0 24#define dest in0
@@ -360,3 +361,4 @@ GLOBAL_ENTRY(memset)
360 br.ret.sptk.many rp 361 br.ret.sptk.many rp
361} 362}
362END(memset) 363END(memset)
364EXPORT_SYMBOL(memset)
diff --git a/arch/ia64/lib/strlen.S b/arch/ia64/lib/strlen.S
index e0cdac0a85b8..1a6e17c657b4 100644
--- a/arch/ia64/lib/strlen.S
+++ b/arch/ia64/lib/strlen.S
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <asm/asmmacro.h> 19#include <asm/asmmacro.h>
20#include <asm/export.h>
20 21
21// 22//
22// 23//
@@ -190,3 +191,4 @@ GLOBAL_ENTRY(strlen)
190 mov ar.pfs=saved_pfs // because of ar.ec, restore no matter what 191 mov ar.pfs=saved_pfs // because of ar.ec, restore no matter what
191 br.ret.sptk.many rp // end of successful recovery code 192 br.ret.sptk.many rp // end of successful recovery code
192END(strlen) 193END(strlen)
194EXPORT_SYMBOL(strlen)
diff --git a/arch/ia64/lib/strlen_user.S b/arch/ia64/lib/strlen_user.S
index c71eded4285e..9d257684e733 100644
--- a/arch/ia64/lib/strlen_user.S
+++ b/arch/ia64/lib/strlen_user.S
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include <asm/asmmacro.h> 18#include <asm/asmmacro.h>
19#include <asm/export.h>
19 20
20// 21//
21// int strlen_user(char *) 22// int strlen_user(char *)
@@ -196,3 +197,4 @@ GLOBAL_ENTRY(__strlen_user)
196 mov ar.pfs=saved_pfs // because of ar.ec, restore no matter what 197 mov ar.pfs=saved_pfs // because of ar.ec, restore no matter what
197 br.ret.sptk.many rp 198 br.ret.sptk.many rp
198END(__strlen_user) 199END(__strlen_user)
200EXPORT_SYMBOL(__strlen_user)
diff --git a/arch/ia64/lib/strncpy_from_user.S b/arch/ia64/lib/strncpy_from_user.S
index a504381f31eb..ca9ccf280e2e 100644
--- a/arch/ia64/lib/strncpy_from_user.S
+++ b/arch/ia64/lib/strncpy_from_user.S
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <asm/asmmacro.h> 19#include <asm/asmmacro.h>
20#include <asm/export.h>
20 21
21GLOBAL_ENTRY(__strncpy_from_user) 22GLOBAL_ENTRY(__strncpy_from_user)
22 alloc r2=ar.pfs,3,0,0,0 23 alloc r2=ar.pfs,3,0,0,0
@@ -42,3 +43,4 @@ GLOBAL_ENTRY(__strncpy_from_user)
42[.Lexit:] 43[.Lexit:]
43 br.ret.sptk.many rp 44 br.ret.sptk.many rp
44END(__strncpy_from_user) 45END(__strncpy_from_user)
46EXPORT_SYMBOL(__strncpy_from_user)
diff --git a/arch/ia64/lib/strnlen_user.S b/arch/ia64/lib/strnlen_user.S
index d09066b1e49d..80a5dfd1d402 100644
--- a/arch/ia64/lib/strnlen_user.S
+++ b/arch/ia64/lib/strnlen_user.S
@@ -13,6 +13,7 @@
13 */ 13 */
14 14
15#include <asm/asmmacro.h> 15#include <asm/asmmacro.h>
16#include <asm/export.h>
16 17
17GLOBAL_ENTRY(__strnlen_user) 18GLOBAL_ENTRY(__strnlen_user)
18 .prologue 19 .prologue
@@ -43,3 +44,4 @@ GLOBAL_ENTRY(__strnlen_user)
43 mov ar.lc=r16 // restore ar.lc 44 mov ar.lc=r16 // restore ar.lc
44 br.ret.sptk.many rp 45 br.ret.sptk.many rp
45END(__strnlen_user) 46END(__strnlen_user)
47EXPORT_SYMBOL(__strnlen_user)
diff --git a/arch/ia64/lib/xor.S b/arch/ia64/lib/xor.S
index 54e3f7eab8e9..c83f1c410691 100644
--- a/arch/ia64/lib/xor.S
+++ b/arch/ia64/lib/xor.S
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <asm/asmmacro.h> 16#include <asm/asmmacro.h>
17#include <asm/export.h>
17 18
18GLOBAL_ENTRY(xor_ia64_2) 19GLOBAL_ENTRY(xor_ia64_2)
19 .prologue 20 .prologue
@@ -51,6 +52,7 @@ GLOBAL_ENTRY(xor_ia64_2)
51 mov pr = r29, -1 52 mov pr = r29, -1
52 br.ret.sptk.few rp 53 br.ret.sptk.few rp
53END(xor_ia64_2) 54END(xor_ia64_2)
55EXPORT_SYMBOL(xor_ia64_2)
54 56
55GLOBAL_ENTRY(xor_ia64_3) 57GLOBAL_ENTRY(xor_ia64_3)
56 .prologue 58 .prologue
@@ -91,6 +93,7 @@ GLOBAL_ENTRY(xor_ia64_3)
91 mov pr = r29, -1 93 mov pr = r29, -1
92 br.ret.sptk.few rp 94 br.ret.sptk.few rp
93END(xor_ia64_3) 95END(xor_ia64_3)
96EXPORT_SYMBOL(xor_ia64_3)
94 97
95GLOBAL_ENTRY(xor_ia64_4) 98GLOBAL_ENTRY(xor_ia64_4)
96 .prologue 99 .prologue
@@ -134,6 +137,7 @@ GLOBAL_ENTRY(xor_ia64_4)
134 mov pr = r29, -1 137 mov pr = r29, -1
135 br.ret.sptk.few rp 138 br.ret.sptk.few rp
136END(xor_ia64_4) 139END(xor_ia64_4)
140EXPORT_SYMBOL(xor_ia64_4)
137 141
138GLOBAL_ENTRY(xor_ia64_5) 142GLOBAL_ENTRY(xor_ia64_5)
139 .prologue 143 .prologue
@@ -182,3 +186,4 @@ GLOBAL_ENTRY(xor_ia64_5)
182 mov pr = r29, -1 186 mov pr = r29, -1
183 br.ret.sptk.few rp 187 br.ret.sptk.few rp
184END(xor_ia64_5) 188END(xor_ia64_5)
189EXPORT_SYMBOL(xor_ia64_5)
diff --git a/arch/m68k/include/asm/export.h b/arch/m68k/include/asm/export.h
new file mode 100644
index 000000000000..0af20f48bd07
--- /dev/null
+++ b/arch/m68k/include/asm/export.h
@@ -0,0 +1,3 @@
1#define KSYM_ALIGN 2
2#define KCRC_ALIGN 2
3#include <asm-generic/export.h>
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index 8a1c4d3f91c8..74c898ced8cc 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -13,7 +13,7 @@ extra-$(CONFIG_SUN3X) := head.o
13extra-$(CONFIG_SUN3) := sun3-head.o 13extra-$(CONFIG_SUN3) := sun3-head.o
14extra-y += vmlinux.lds 14extra-y += vmlinux.lds
15 15
16obj-y := entry.o irq.o m68k_ksyms.o module.o process.o ptrace.o 16obj-y := entry.o irq.o module.o process.o ptrace.o
17obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o 17obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o
18 18
19obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o 19obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
deleted file mode 100644
index 774c1bd59c36..000000000000
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ /dev/null
@@ -1,32 +0,0 @@
1#include <linux/module.h>
2
3asmlinkage long long __ashldi3 (long long, int);
4asmlinkage long long __ashrdi3 (long long, int);
5asmlinkage long long __lshrdi3 (long long, int);
6asmlinkage long long __muldi3 (long long, long long);
7
8/* The following are special because they're not called
9 explicitly (the C compiler generates them). Fortunately,
10 their interface isn't gonna change any time soon now, so
11 it's OK to leave it out of version control. */
12EXPORT_SYMBOL(__ashldi3);
13EXPORT_SYMBOL(__ashrdi3);
14EXPORT_SYMBOL(__lshrdi3);
15EXPORT_SYMBOL(__muldi3);
16
17#if defined(CONFIG_CPU_HAS_NO_MULDIV64)
18/*
19 * Simpler 68k and ColdFire parts also need a few other gcc functions.
20 */
21extern long long __divsi3(long long, long long);
22extern long long __modsi3(long long, long long);
23extern long long __mulsi3(long long, long long);
24extern long long __udivsi3(long long, long long);
25extern long long __umodsi3(long long, long long);
26
27EXPORT_SYMBOL(__divsi3);
28EXPORT_SYMBOL(__modsi3);
29EXPORT_SYMBOL(__mulsi3);
30EXPORT_SYMBOL(__udivsi3);
31EXPORT_SYMBOL(__umodsi3);
32#endif
diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c
index 37234c2df47f..8dffd36ec4f2 100644
--- a/arch/m68k/lib/ashldi3.c
+++ b/arch/m68k/lib/ashldi3.c
@@ -13,6 +13,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details. */ 14GNU General Public License for more details. */
15 15
16#include <linux/compiler.h>
17#include <linux/export.h>
18
16#define BITS_PER_UNIT 8 19#define BITS_PER_UNIT 8
17 20
18typedef int SItype __attribute__ ((mode (SI))); 21typedef int SItype __attribute__ ((mode (SI)));
@@ -55,3 +58,4 @@ __ashldi3 (DItype u, word_type b)
55 58
56 return w.ll; 59 return w.ll;
57} 60}
61EXPORT_SYMBOL(__ashldi3);
diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c
index 1d59345f36c6..e6565a3ee2c3 100644
--- a/arch/m68k/lib/ashrdi3.c
+++ b/arch/m68k/lib/ashrdi3.c
@@ -13,6 +13,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details. */ 14GNU General Public License for more details. */
15 15
16#include <linux/compiler.h>
17#include <linux/export.h>
18
16#define BITS_PER_UNIT 8 19#define BITS_PER_UNIT 8
17 20
18typedef int SItype __attribute__ ((mode (SI))); 21typedef int SItype __attribute__ ((mode (SI)));
@@ -56,3 +59,4 @@ __ashrdi3 (DItype u, word_type b)
56 59
57 return w.ll; 60 return w.ll;
58} 61}
62EXPORT_SYMBOL(__ashrdi3);
diff --git a/arch/m68k/lib/divsi3.S b/arch/m68k/lib/divsi3.S
index 2c0ec85ac661..3a2143f51631 100644
--- a/arch/m68k/lib/divsi3.S
+++ b/arch/m68k/lib/divsi3.S
@@ -33,6 +33,8 @@ General Public License for more details. */
33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
34*/ 34*/
35 35
36#include <asm/export.h>
37
36/* These are predefined by new versions of GNU cpp. */ 38/* These are predefined by new versions of GNU cpp. */
37 39
38#ifndef __USER_LABEL_PREFIX__ 40#ifndef __USER_LABEL_PREFIX__
@@ -118,3 +120,4 @@ L2: movel d1, sp@-
118L3: movel sp@+, d2 120L3: movel sp@+, d2
119 rts 121 rts
120 122
123 EXPORT_SYMBOL(__divsi3)
diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c
index 49e1ec8f2cc2..039779737c7d 100644
--- a/arch/m68k/lib/lshrdi3.c
+++ b/arch/m68k/lib/lshrdi3.c
@@ -13,6 +13,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details. */ 14GNU General Public License for more details. */
15 15
16#include <linux/compiler.h>
17#include <linux/export.h>
18
16#define BITS_PER_UNIT 8 19#define BITS_PER_UNIT 8
17 20
18typedef int SItype __attribute__ ((mode (SI))); 21typedef int SItype __attribute__ ((mode (SI)));
@@ -55,3 +58,4 @@ __lshrdi3 (DItype u, word_type b)
55 58
56 return w.ll; 59 return w.ll;
57} 60}
61EXPORT_SYMBOL(__lshrdi3);
diff --git a/arch/m68k/lib/modsi3.S b/arch/m68k/lib/modsi3.S
index 1d9e0efdf31d..1c967649a4e0 100644
--- a/arch/m68k/lib/modsi3.S
+++ b/arch/m68k/lib/modsi3.S
@@ -33,6 +33,8 @@ General Public License for more details. */
33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
34*/ 34*/
35 35
36#include <asm/export.h>
37
36/* These are predefined by new versions of GNU cpp. */ 38/* These are predefined by new versions of GNU cpp. */
37 39
38#ifndef __USER_LABEL_PREFIX__ 40#ifndef __USER_LABEL_PREFIX__
@@ -106,3 +108,4 @@ SYM (__modsi3):
106 movel d1, d0 108 movel d1, d0
107 rts 109 rts
108 110
111 EXPORT_SYMBOL(__modsi3)
diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c
index 9006d15b8721..6459af5b2af0 100644
--- a/arch/m68k/lib/muldi3.c
+++ b/arch/m68k/lib/muldi3.c
@@ -14,6 +14,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details. */ 15GNU General Public License for more details. */
16 16
17#include <linux/compiler.h>
18#include <linux/export.h>
19
17#ifdef CONFIG_CPU_HAS_NO_MULDIV64 20#ifdef CONFIG_CPU_HAS_NO_MULDIV64
18 21
19#define SI_TYPE_SIZE 32 22#define SI_TYPE_SIZE 32
@@ -90,3 +93,4 @@ __muldi3 (DItype u, DItype v)
90 93
91 return w.ll; 94 return w.ll;
92} 95}
96EXPORT_SYMBOL(__muldi3);
diff --git a/arch/m68k/lib/mulsi3.S b/arch/m68k/lib/mulsi3.S
index c39ad4e738e9..855675e69a8a 100644
--- a/arch/m68k/lib/mulsi3.S
+++ b/arch/m68k/lib/mulsi3.S
@@ -32,7 +32,7 @@ General Public License for more details. */
32 Some of this code comes from MINIX, via the folks at ericsson. 32 Some of this code comes from MINIX, via the folks at ericsson.
33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
34*/ 34*/
35 35#include <asm/export.h>
36/* These are predefined by new versions of GNU cpp. */ 36/* These are predefined by new versions of GNU cpp. */
37 37
38#ifndef __USER_LABEL_PREFIX__ 38#ifndef __USER_LABEL_PREFIX__
@@ -102,4 +102,4 @@ SYM (__mulsi3):
102 addl d1, d0 102 addl d1, d0
103 103
104 rts 104 rts
105 105 EXPORT_SYMBOL(__mulsi3)
diff --git a/arch/m68k/lib/udivsi3.S b/arch/m68k/lib/udivsi3.S
index 35a5446572a5..78440ae513bf 100644
--- a/arch/m68k/lib/udivsi3.S
+++ b/arch/m68k/lib/udivsi3.S
@@ -32,7 +32,7 @@ General Public License for more details. */
32 Some of this code comes from MINIX, via the folks at ericsson. 32 Some of this code comes from MINIX, via the folks at ericsson.
33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
34*/ 34*/
35 35#include <asm/export.h>
36/* These are predefined by new versions of GNU cpp. */ 36/* These are predefined by new versions of GNU cpp. */
37 37
38#ifndef __USER_LABEL_PREFIX__ 38#ifndef __USER_LABEL_PREFIX__
@@ -154,4 +154,4 @@ L2: subql IMM (1),d4
154 unlk a6 | and return 154 unlk a6 | and return
155 rts 155 rts
156#endif /* __mcf5200__ || __mcoldfire__ */ 156#endif /* __mcf5200__ || __mcoldfire__ */
157 157 EXPORT_SYMBOL(__udivsi3)
diff --git a/arch/m68k/lib/umodsi3.S b/arch/m68k/lib/umodsi3.S
index 099da514a8fd..b6fd11f58948 100644
--- a/arch/m68k/lib/umodsi3.S
+++ b/arch/m68k/lib/umodsi3.S
@@ -32,7 +32,7 @@ General Public License for more details. */
32 Some of this code comes from MINIX, via the folks at ericsson. 32 Some of this code comes from MINIX, via the folks at ericsson.
33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 33 D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
34*/ 34*/
35 35#include <asm/export.h>
36/* These are predefined by new versions of GNU cpp. */ 36/* These are predefined by new versions of GNU cpp. */
37 37
38#ifndef __USER_LABEL_PREFIX__ 38#ifndef __USER_LABEL_PREFIX__
@@ -105,4 +105,4 @@ SYM (__umodsi3):
105 subl d0, d1 /* d1 = a - (a/b)*b */ 105 subl d0, d1 /* d1 = a - (a/b)*b */
106 movel d1, d0 106 movel d1, d0
107 rts 107 rts
108 108 EXPORT_SYMBOL(__umodsi3)
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index ab9f4e0ed4cf..5c4fbc80dc6c 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -1,5 +1,6 @@
1generic-y += clkdev.h 1generic-y += clkdev.h
2generic-y += div64.h 2generic-y += div64.h
3generic-y += export.h
3generic-y += irq_regs.h 4generic-y += irq_regs.h
4generic-y += irq_work.h 5generic-y += irq_work.h
5generic-y += local64.h 6generic-y += local64.h
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index aded29ad2e8f..6913f6725ce1 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -90,10 +90,6 @@ obj-$(CONFIG_RELOCATABLE) += reloc_$(BITS).o
90obj-$(CONFIG_PPC32) += entry_32.o setup_32.o 90obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
91obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o 91obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
92obj-$(CONFIG_KGDB) += kgdb.o 92obj-$(CONFIG_KGDB) += kgdb.o
93obj-$(CONFIG_MODULES) += ppc_ksyms.o
94ifeq ($(CONFIG_PPC32),y)
95obj-$(CONFIG_MODULES) += ppc_ksyms_32.o
96endif
97obj-$(CONFIG_BOOTX_TEXT) += btext.o 93obj-$(CONFIG_BOOTX_TEXT) += btext.o
98obj-$(CONFIG_SMP) += smp.o 94obj-$(CONFIG_SMP) += smp.o
99obj-$(CONFIG_KPROBES) += kprobes.o 95obj-$(CONFIG_KPROBES) += kprobes.o
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 83428a283fa0..3841d749a430 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -33,6 +33,7 @@
33#include <asm/unistd.h> 33#include <asm/unistd.h>
34#include <asm/ftrace.h> 34#include <asm/ftrace.h>
35#include <asm/ptrace.h> 35#include <asm/ptrace.h>
36#include <asm/export.h>
36 37
37/* 38/*
38 * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. 39 * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
@@ -1358,6 +1359,7 @@ _GLOBAL(_mcount)
1358 MCOUNT_RESTORE_FRAME 1359 MCOUNT_RESTORE_FRAME
1359 bctr 1360 bctr
1360#endif 1361#endif
1362EXPORT_SYMBOL(_mcount)
1361 1363
1362_GLOBAL(ftrace_stub) 1364_GLOBAL(ftrace_stub)
1363 blr 1365 blr
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 51df82b61084..6432d4bf08c8 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -38,6 +38,7 @@
38#include <asm/context_tracking.h> 38#include <asm/context_tracking.h>
39#include <asm/tm.h> 39#include <asm/tm.h>
40#include <asm/ppc-opcode.h> 40#include <asm/ppc-opcode.h>
41#include <asm/export.h>
41 42
42/* 43/*
43 * System calls. 44 * System calls.
@@ -1177,6 +1178,7 @@ _GLOBAL(enter_prom)
1177#ifdef CONFIG_DYNAMIC_FTRACE 1178#ifdef CONFIG_DYNAMIC_FTRACE
1178_GLOBAL(mcount) 1179_GLOBAL(mcount)
1179_GLOBAL(_mcount) 1180_GLOBAL(_mcount)
1181EXPORT_SYMBOL(_mcount)
1180 mflr r12 1182 mflr r12
1181 mtctr r12 1183 mtctr r12
1182 mtlr r0 1184 mtlr r0
@@ -1413,6 +1415,7 @@ livepatch_handler:
1413 1415
1414#else 1416#else
1415_GLOBAL_TOC(_mcount) 1417_GLOBAL_TOC(_mcount)
1418EXPORT_SYMBOL(_mcount)
1416 /* Taken from output of objdump from lib64/glibc */ 1419 /* Taken from output of objdump from lib64/glibc */
1417 mflr r3 1420 mflr r3
1418 ld r11, 0(r1) 1421 ld r11, 0(r1)
diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
index 9f1ebf7338f1..52ca2471ee1a 100644
--- a/arch/powerpc/kernel/epapr_hcalls.S
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -16,6 +16,7 @@
16#include <asm/ppc_asm.h> 16#include <asm/ppc_asm.h>
17#include <asm/asm-compat.h> 17#include <asm/asm-compat.h>
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19#include <asm/export.h>
19 20
20#ifndef CONFIG_PPC64 21#ifndef CONFIG_PPC64
21/* epapr_ev_idle() was derived from e500_idle() */ 22/* epapr_ev_idle() was derived from e500_idle() */
@@ -53,3 +54,4 @@ epapr_hypercall_start:
53 nop 54 nop
54 nop 55 nop
55 blr 56 blr
57EXPORT_SYMBOL(epapr_hypercall_start)
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index 08d14b096eb9..6c509f39bbde 100644
--- a/arch/powerpc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -24,6 +24,7 @@
24#include <asm/ppc_asm.h> 24#include <asm/ppc_asm.h>
25#include <asm/asm-offsets.h> 25#include <asm/asm-offsets.h>
26#include <asm/ptrace.h> 26#include <asm/ptrace.h>
27#include <asm/export.h>
27 28
28#ifdef CONFIG_VSX 29#ifdef CONFIG_VSX
29#define __REST_32FPVSRS(n,c,base) \ 30#define __REST_32FPVSRS(n,c,base) \
@@ -59,6 +60,7 @@ _GLOBAL(load_fp_state)
59 MTFSF_L(fr0) 60 MTFSF_L(fr0)
60 REST_32FPVSRS(0, R4, R3) 61 REST_32FPVSRS(0, R4, R3)
61 blr 62 blr
63EXPORT_SYMBOL(load_fp_state)
62 64
63/* 65/*
64 * Store FP state into memory, including FPSCR 66 * Store FP state into memory, including FPSCR
@@ -69,6 +71,7 @@ _GLOBAL(store_fp_state)
69 mffs fr0 71 mffs fr0
70 stfd fr0,FPSTATE_FPSCR(r3) 72 stfd fr0,FPSTATE_FPSCR(r3)
71 blr 73 blr
74EXPORT_SYMBOL(store_fp_state)
72 75
73/* 76/*
74 * This task wants to use the FPU now. 77 * This task wants to use the FPU now.
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index a3f821eb7e9a..9d963547d243 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -34,6 +34,7 @@
34#include <asm/ptrace.h> 34#include <asm/ptrace.h>
35#include <asm/bug.h> 35#include <asm/bug.h>
36#include <asm/kvm_book3s_asm.h> 36#include <asm/kvm_book3s_asm.h>
37#include <asm/export.h>
37 38
38/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 39/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
39#define LOAD_BAT(n, reg, RA, RB) \ 40#define LOAD_BAT(n, reg, RA, RB) \
@@ -738,6 +739,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
738 739
739 .globl mol_trampoline 740 .globl mol_trampoline
740 .set mol_trampoline, i0x2f00 741 .set mol_trampoline, i0x2f00
742 EXPORT_SYMBOL(mol_trampoline)
741 743
742 . = 0x3000 744 . = 0x3000
743 745
@@ -1045,6 +1047,7 @@ _ENTRY(switch_mmu_context)
10454: trap 10474: trap
1046 EMIT_BUG_ENTRY 4b,__FILE__,__LINE__,0 1048 EMIT_BUG_ENTRY 4b,__FILE__,__LINE__,0
1047 blr 1049 blr
1050EXPORT_SYMBOL(switch_mmu_context)
1048 1051
1049/* 1052/*
1050 * An undocumented "feature" of 604e requires that the v bit 1053 * An undocumented "feature" of 604e requires that the v bit
@@ -1272,6 +1275,7 @@ sdata:
1272 .globl empty_zero_page 1275 .globl empty_zero_page
1273empty_zero_page: 1276empty_zero_page:
1274 .space 4096 1277 .space 4096
1278EXPORT_SYMBOL(empty_zero_page)
1275 1279
1276 .globl swapper_pg_dir 1280 .globl swapper_pg_dir
1277swapper_pg_dir: 1281swapper_pg_dir:
@@ -1285,6 +1289,7 @@ intercept_table:
1285 .long 0, 0, 0, 0, 0, 0, 0, 0 1289 .long 0, 0, 0, 0, 0, 0, 0, 0
1286 .long 0, 0, 0, 0, 0, 0, 0, 0 1290 .long 0, 0, 0, 0, 0, 0, 0, 0
1287 .long 0, 0, 0, 0, 0, 0, 0, 0 1291 .long 0, 0, 0, 0, 0, 0, 0, 0
1292EXPORT_SYMBOL(intercept_table)
1288 1293
1289/* Room for two PTE pointers, usually the kernel and current user pointers 1294/* Room for two PTE pointers, usually the kernel and current user pointers
1290 * to their respective root page table. 1295 * to their respective root page table.
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 7d7d8635227a..41374a468d1c 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -41,6 +41,7 @@
41#include <asm/ppc_asm.h> 41#include <asm/ppc_asm.h>
42#include <asm/asm-offsets.h> 42#include <asm/asm-offsets.h>
43#include <asm/ptrace.h> 43#include <asm/ptrace.h>
44#include <asm/export.h>
44 45
45/* As with the other PowerPC ports, it is expected that when code 46/* As with the other PowerPC ports, it is expected that when code
46 * execution begins here, the following registers contain valid, yet 47 * execution begins here, the following registers contain valid, yet
@@ -971,6 +972,7 @@ sdata:
971 .globl empty_zero_page 972 .globl empty_zero_page
972empty_zero_page: 973empty_zero_page:
973 .space 4096 974 .space 4096
975EXPORT_SYMBOL(empty_zero_page)
974 .globl swapper_pg_dir 976 .globl swapper_pg_dir
975swapper_pg_dir: 977swapper_pg_dir:
976 .space PGD_TABLE_SIZE 978 .space PGD_TABLE_SIZE
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 9cdf5c71e426..37e4a7cf0065 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -39,6 +39,7 @@
39#include <asm/asm-offsets.h> 39#include <asm/asm-offsets.h>
40#include <asm/ptrace.h> 40#include <asm/ptrace.h>
41#include <asm/synch.h> 41#include <asm/synch.h>
42#include <asm/export.h>
42#include "head_booke.h" 43#include "head_booke.h"
43 44
44 45
@@ -1254,6 +1255,7 @@ sdata:
1254 .globl empty_zero_page 1255 .globl empty_zero_page
1255empty_zero_page: 1256empty_zero_page:
1256 .space PAGE_SIZE 1257 .space PAGE_SIZE
1258EXPORT_SYMBOL(empty_zero_page)
1257 1259
1258/* 1260/*
1259 * To support >32-bit physical addresses, we use an 8KB pgdir. 1261 * To support >32-bit physical addresses, we use an 8KB pgdir.
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 79da0641bae2..04c546e20cc0 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -43,6 +43,7 @@
43#include <asm/hw_irq.h> 43#include <asm/hw_irq.h>
44#include <asm/cputhreads.h> 44#include <asm/cputhreads.h>
45#include <asm/ppc-opcode.h> 45#include <asm/ppc-opcode.h>
46#include <asm/export.h>
46 47
47/* The physical memory is laid out such that the secondary processor 48/* The physical memory is laid out such that the secondary processor
48 * spin code sits at 0x0000...0x00ff. On server, the vectors follow 49 * spin code sits at 0x0000...0x00ff. On server, the vectors follow
@@ -1002,3 +1003,4 @@ swapper_pg_dir:
1002 .globl empty_zero_page 1003 .globl empty_zero_page
1003empty_zero_page: 1004empty_zero_page:
1004 .space PAGE_SIZE 1005 .space PAGE_SIZE
1006EXPORT_SYMBOL(empty_zero_page)
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 033a6b735487..fb133a163263 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -31,6 +31,7 @@
31#include <asm/asm-offsets.h> 31#include <asm/asm-offsets.h>
32#include <asm/ptrace.h> 32#include <asm/ptrace.h>
33#include <asm/fixmap.h> 33#include <asm/fixmap.h>
34#include <asm/export.h>
34 35
35/* Macro to make the code more readable. */ 36/* Macro to make the code more readable. */
36#ifdef CONFIG_8xx_CPU6 37#ifdef CONFIG_8xx_CPU6
@@ -884,6 +885,7 @@ sdata:
884 .align PAGE_SHIFT 885 .align PAGE_SHIFT
885empty_zero_page: 886empty_zero_page:
886 .space PAGE_SIZE 887 .space PAGE_SIZE
888EXPORT_SYMBOL(empty_zero_page)
887 889
888 .globl swapper_pg_dir 890 .globl swapper_pg_dir
889swapper_pg_dir: 891swapper_pg_dir:
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 3bfa3150911f..bf4c6021515f 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -42,6 +42,7 @@
42#include <asm/asm-offsets.h> 42#include <asm/asm-offsets.h>
43#include <asm/cache.h> 43#include <asm/cache.h>
44#include <asm/ptrace.h> 44#include <asm/ptrace.h>
45#include <asm/export.h>
45#include "head_booke.h" 46#include "head_booke.h"
46 47
47/* As with the other PowerPC ports, it is expected that when code 48/* As with the other PowerPC ports, it is expected that when code
@@ -1223,6 +1224,7 @@ sdata:
1223 .globl empty_zero_page 1224 .globl empty_zero_page
1224empty_zero_page: 1225empty_zero_page:
1225 .space 4096 1226 .space 4096
1227EXPORT_SYMBOL(empty_zero_page)
1226 .globl swapper_pg_dir 1228 .globl swapper_pg_dir
1227swapper_pg_dir: 1229swapper_pg_dir:
1228 .space PGD_TABLE_SIZE 1230 .space PGD_TABLE_SIZE
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 0d432194c018..384357cb8bc0 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -18,6 +18,7 @@
18#include <asm/unistd.h> 18#include <asm/unistd.h>
19#include <asm/asm-compat.h> 19#include <asm/asm-compat.h>
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/export.h>
21 22
22 .text 23 .text
23 24
@@ -118,3 +119,4 @@ _GLOBAL(longjmp)
118_GLOBAL(current_stack_pointer) 119_GLOBAL(current_stack_pointer)
119 PPC_LL r3,0(r1) 120 PPC_LL r3,0(r1)
120 blr 121 blr
122EXPORT_SYMBOL(current_stack_pointer)
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 03756ffdcd71..93cf7a5846a6 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -33,6 +33,7 @@
33#include <asm/kexec.h> 33#include <asm/kexec.h>
34#include <asm/bug.h> 34#include <asm/bug.h>
35#include <asm/ptrace.h> 35#include <asm/ptrace.h>
36#include <asm/export.h>
36 37
37 .text 38 .text
38 39
@@ -319,6 +320,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_UNIFIED_ID_CACHE)
319#endif /* CONFIG_4xx */ 320#endif /* CONFIG_4xx */
320 isync 321 isync
321 blr 322 blr
323EXPORT_SYMBOL(flush_instruction_cache)
322#endif /* CONFIG_PPC_8xx */ 324#endif /* CONFIG_PPC_8xx */
323 325
324/* 326/*
@@ -359,6 +361,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
359 isync 361 isync
360 blr 362 blr
361_ASM_NOKPROBE_SYMBOL(flush_icache_range) 363_ASM_NOKPROBE_SYMBOL(flush_icache_range)
364EXPORT_SYMBOL(flush_icache_range)
362 365
363/* 366/*
364 * Flush a particular page from the data cache to RAM. 367 * Flush a particular page from the data cache to RAM.
@@ -497,6 +500,7 @@ _GLOBAL(copy_page)
497 li r0,MAX_COPY_PREFETCH 500 li r0,MAX_COPY_PREFETCH
498 li r11,4 501 li r11,4
499 b 2b 502 b 2b
503EXPORT_SYMBOL(copy_page)
500 504
501/* 505/*
502 * Extended precision shifts. 506 * Extended precision shifts.
@@ -524,6 +528,7 @@ _GLOBAL(__ashrdi3)
524 sraw r3,r3,r5 # MSW = MSW >> count 528 sraw r3,r3,r5 # MSW = MSW >> count
525 or r4,r4,r7 # LSW |= t2 529 or r4,r4,r7 # LSW |= t2
526 blr 530 blr
531EXPORT_SYMBOL(__ashrdi3)
527 532
528_GLOBAL(__ashldi3) 533_GLOBAL(__ashldi3)
529 subfic r6,r5,32 534 subfic r6,r5,32
@@ -535,6 +540,7 @@ _GLOBAL(__ashldi3)
535 slw r4,r4,r5 # LSW = LSW << count 540 slw r4,r4,r5 # LSW = LSW << count
536 or r3,r3,r7 # MSW |= t2 541 or r3,r3,r7 # MSW |= t2
537 blr 542 blr
543EXPORT_SYMBOL(__ashldi3)
538 544
539_GLOBAL(__lshrdi3) 545_GLOBAL(__lshrdi3)
540 subfic r6,r5,32 546 subfic r6,r5,32
@@ -546,6 +552,7 @@ _GLOBAL(__lshrdi3)
546 srw r3,r3,r5 # MSW = MSW >> count 552 srw r3,r3,r5 # MSW = MSW >> count
547 or r4,r4,r7 # LSW |= t2 553 or r4,r4,r7 # LSW |= t2
548 blr 554 blr
555EXPORT_SYMBOL(__lshrdi3)
549 556
550/* 557/*
551 * 64-bit comparison: __cmpdi2(s64 a, s64 b) 558 * 64-bit comparison: __cmpdi2(s64 a, s64 b)
@@ -561,6 +568,7 @@ _GLOBAL(__cmpdi2)
561 bltlr 568 bltlr
562 li r3,2 569 li r3,2
563 blr 570 blr
571EXPORT_SYMBOL(__cmpdi2)
564/* 572/*
565 * 64-bit comparison: __ucmpdi2(u64 a, u64 b) 573 * 64-bit comparison: __ucmpdi2(u64 a, u64 b)
566 * Returns 0 if a < b, 1 if a == b, 2 if a > b. 574 * Returns 0 if a < b, 1 if a == b, 2 if a > b.
@@ -575,6 +583,7 @@ _GLOBAL(__ucmpdi2)
575 bltlr 583 bltlr
576 li r3,2 584 li r3,2
577 blr 585 blr
586EXPORT_SYMBOL(__ucmpdi2)
578 587
579_GLOBAL(__bswapdi2) 588_GLOBAL(__bswapdi2)
580 rotlwi r9,r4,8 589 rotlwi r9,r4,8
@@ -586,6 +595,7 @@ _GLOBAL(__bswapdi2)
586 mr r3,r9 595 mr r3,r9
587 mr r4,r10 596 mr r4,r10
588 blr 597 blr
598EXPORT_SYMBOL(__bswapdi2)
589 599
590#ifdef CONFIG_SMP 600#ifdef CONFIG_SMP
591_GLOBAL(start_secondary_resume) 601_GLOBAL(start_secondary_resume)
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index 9f0bed214bcb..4f178671f230 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -27,6 +27,7 @@
27#include <asm/kexec.h> 27#include <asm/kexec.h>
28#include <asm/ptrace.h> 28#include <asm/ptrace.h>
29#include <asm/mmu.h> 29#include <asm/mmu.h>
30#include <asm/export.h>
30 31
31 .text 32 .text
32 33
@@ -110,6 +111,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
110 isync 111 isync
111 blr 112 blr
112_ASM_NOKPROBE_SYMBOL(flush_icache_range) 113_ASM_NOKPROBE_SYMBOL(flush_icache_range)
114EXPORT_SYMBOL(flush_icache_range)
113 115
114/* 116/*
115 * Like above, but only do the D-cache. 117 * Like above, but only do the D-cache.
@@ -140,6 +142,7 @@ _GLOBAL(flush_dcache_range)
140 bdnz 0b 142 bdnz 0b
141 sync 143 sync
142 blr 144 blr
145EXPORT_SYMBOL(flush_dcache_range)
143 146
144/* 147/*
145 * Like above, but works on non-mapped physical addresses. 148 * Like above, but works on non-mapped physical addresses.
@@ -243,6 +246,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
243 blr 246 blr
244 247
245_GLOBAL(__bswapdi2) 248_GLOBAL(__bswapdi2)
249EXPORT_SYMBOL(__bswapdi2)
246 srdi r8,r3,32 250 srdi r8,r3,32
247 rlwinm r7,r3,8,0xffffffff 251 rlwinm r7,r3,8,0xffffffff
248 rlwimi r7,r3,24,0,7 252 rlwimi r7,r3,24,0,7
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 95d3769a2e26..74bec5498972 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -56,6 +56,7 @@ static DECLARE_BITMAP(phb_bitmap, MAX_PHBS);
56 56
57/* ISA Memory physical address */ 57/* ISA Memory physical address */
58resource_size_t isa_mem_base; 58resource_size_t isa_mem_base;
59EXPORT_SYMBOL(isa_mem_base);
59 60
60 61
61static struct dma_map_ops *pci_dma_ops = &dma_direct_ops; 62static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 1f7930037cb7..678f87a63645 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -32,6 +32,8 @@
32unsigned long isa_io_base = 0; 32unsigned long isa_io_base = 0;
33unsigned long pci_dram_offset = 0; 33unsigned long pci_dram_offset = 0;
34int pcibios_assign_bus_offset = 1; 34int pcibios_assign_bus_offset = 1;
35EXPORT_SYMBOL(isa_io_base);
36EXPORT_SYMBOL(pci_dram_offset);
35 37
36void pcibios_make_OF_bus_map(void); 38void pcibios_make_OF_bus_map(void);
37 39
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
deleted file mode 100644
index 9f01e28ecef3..000000000000
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ /dev/null
@@ -1,37 +0,0 @@
1#include <linux/ftrace.h>
2#include <linux/mm.h>
3
4#include <asm/processor.h>
5#include <asm/switch_to.h>
6#include <asm/cacheflush.h>
7#include <asm/epapr_hcalls.h>
8
9#ifdef CONFIG_PPC64
10EXPORT_SYMBOL(flush_dcache_range);
11#endif
12EXPORT_SYMBOL(flush_icache_range);
13
14EXPORT_SYMBOL(empty_zero_page);
15
16long long __bswapdi2(long long);
17EXPORT_SYMBOL(__bswapdi2);
18
19#ifdef CONFIG_FUNCTION_TRACER
20EXPORT_SYMBOL(_mcount);
21#endif
22
23#ifdef CONFIG_PPC_FPU
24EXPORT_SYMBOL(load_fp_state);
25EXPORT_SYMBOL(store_fp_state);
26#endif
27
28#ifdef CONFIG_ALTIVEC
29EXPORT_SYMBOL(load_vr_state);
30EXPORT_SYMBOL(store_vr_state);
31#endif
32
33#ifdef CONFIG_EPAPR_PARAVIRT
34EXPORT_SYMBOL(epapr_hypercall_start);
35#endif
36
37EXPORT_SYMBOL(current_stack_pointer);
diff --git a/arch/powerpc/kernel/ppc_ksyms_32.c b/arch/powerpc/kernel/ppc_ksyms_32.c
deleted file mode 100644
index 2bfaafe5be99..000000000000
--- a/arch/powerpc/kernel/ppc_ksyms_32.c
+++ /dev/null
@@ -1,60 +0,0 @@
1#include <linux/export.h>
2#include <linux/smp.h>
3
4#include <asm/page.h>
5#include <asm/dma.h>
6#include <asm/io.h>
7#include <asm/hw_irq.h>
8#include <asm/time.h>
9#include <asm/mmu_context.h>
10#include <asm/pgtable.h>
11#include <asm/dcr.h>
12
13EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
14EXPORT_SYMBOL(DMA_MODE_READ);
15EXPORT_SYMBOL(DMA_MODE_WRITE);
16
17#if defined(CONFIG_PCI)
18EXPORT_SYMBOL(isa_io_base);
19EXPORT_SYMBOL(isa_mem_base);
20EXPORT_SYMBOL(pci_dram_offset);
21#endif
22
23#ifdef CONFIG_SMP
24EXPORT_SYMBOL(smp_hw_index);
25#endif
26
27long long __ashrdi3(long long, int);
28long long __ashldi3(long long, int);
29long long __lshrdi3(long long, int);
30int __ucmpdi2(unsigned long long, unsigned long long);
31int __cmpdi2(long long, long long);
32EXPORT_SYMBOL(__ashrdi3);
33EXPORT_SYMBOL(__ashldi3);
34EXPORT_SYMBOL(__lshrdi3);
35EXPORT_SYMBOL(__ucmpdi2);
36EXPORT_SYMBOL(__cmpdi2);
37
38EXPORT_SYMBOL(timer_interrupt);
39EXPORT_SYMBOL(tb_ticks_per_jiffy);
40
41EXPORT_SYMBOL(switch_mmu_context);
42
43#ifdef CONFIG_PPC_STD_MMU_32
44extern long mol_trampoline;
45EXPORT_SYMBOL(mol_trampoline); /* For MOL */
46EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
47#ifdef CONFIG_SMP
48extern int mmu_hash_lock;
49EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
50#endif /* CONFIG_SMP */
51extern long *intercept_table;
52EXPORT_SYMBOL(intercept_table);
53#endif /* CONFIG_PPC_STD_MMU_32 */
54
55#ifdef CONFIG_PPC_DCR_NATIVE
56EXPORT_SYMBOL(__mtdcr);
57EXPORT_SYMBOL(__mfdcr);
58#endif
59
60EXPORT_SYMBOL(flush_instruction_cache);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 24ec3ea4b3a2..5fe79182f0fa 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -16,6 +16,7 @@
16#include <linux/cpu.h> 16#include <linux/cpu.h>
17#include <linux/console.h> 17#include <linux/console.h>
18#include <linux/memblock.h> 18#include <linux/memblock.h>
19#include <linux/export.h>
19 20
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/prom.h> 22#include <asm/prom.h>
@@ -47,11 +48,16 @@ int boot_cpuid_phys;
47EXPORT_SYMBOL_GPL(boot_cpuid_phys); 48EXPORT_SYMBOL_GPL(boot_cpuid_phys);
48 49
49int smp_hw_index[NR_CPUS]; 50int smp_hw_index[NR_CPUS];
51EXPORT_SYMBOL(smp_hw_index);
50 52
51unsigned long ISA_DMA_THRESHOLD; 53unsigned long ISA_DMA_THRESHOLD;
52unsigned int DMA_MODE_READ; 54unsigned int DMA_MODE_READ;
53unsigned int DMA_MODE_WRITE; 55unsigned int DMA_MODE_WRITE;
54 56
57EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
58EXPORT_SYMBOL(DMA_MODE_READ);
59EXPORT_SYMBOL(DMA_MODE_WRITE);
60
55/* 61/*
56 * These are used in binfmt_elf.c to put aux entries on the stack 62 * These are used in binfmt_elf.c to put aux entries on the stack
57 * for each elf executable being started. 63 * for each elf executable being started.
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 67859b7d1c97..bc3f7d0d7b79 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -596,6 +596,7 @@ void timer_interrupt(struct pt_regs * regs)
596 irq_exit(); 596 irq_exit();
597 set_irq_regs(old_regs); 597 set_irq_regs(old_regs);
598} 598}
599EXPORT_SYMBOL(timer_interrupt);
599 600
600/* 601/*
601 * Hypervisor decrementer interrupts shouldn't occur but are sometimes 602 * Hypervisor decrementer interrupts shouldn't occur but are sometimes
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index bc85bdff4e01..0c123f3406cd 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -6,6 +6,7 @@
6#include <asm/thread_info.h> 6#include <asm/thread_info.h>
7#include <asm/page.h> 7#include <asm/page.h>
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <asm/export.h>
9 10
10/* 11/*
11 * Load state from memory into VMX registers including VSCR. 12 * Load state from memory into VMX registers including VSCR.
@@ -17,6 +18,7 @@ _GLOBAL(load_vr_state)
17 mtvscr v0 18 mtvscr v0
18 REST_32VRS(0,r4,r3) 19 REST_32VRS(0,r4,r3)
19 blr 20 blr
21EXPORT_SYMBOL(load_vr_state)
20 22
21/* 23/*
22 * Store VMX state into memory, including VSCR. 24 * Store VMX state into memory, including VSCR.
@@ -28,6 +30,7 @@ _GLOBAL(store_vr_state)
28 li r4, VRSTATE_VSCR 30 li r4, VRSTATE_VSCR
29 stvx v0, r4, r3 31 stvx v0, r4, r3
30 blr 32 blr
33EXPORT_SYMBOL(store_vr_state)
31 34
32/* 35/*
33 * Disable VMX for the task which had it previously, 36 * Disable VMX for the task which had it previously,
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index ad5290005ca4..309361e86523 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -9,7 +9,7 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
9CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) 9CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE)
10CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE) 10CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)
11 11
12obj-y += string.o alloc.o crtsavres.o ppc_ksyms.o code-patching.o \ 12obj-y += string.o alloc.o crtsavres.o code-patching.o \
13 feature-fixups.o 13 feature-fixups.o
14 14
15obj-$(CONFIG_PPC32) += div64.o copy_32.o 15obj-$(CONFIG_PPC32) += div64.o copy_32.o
diff --git a/arch/powerpc/lib/checksum_32.S b/arch/powerpc/lib/checksum_32.S
index aa8214f30c92..ea29a5d67743 100644
--- a/arch/powerpc/lib/checksum_32.S
+++ b/arch/powerpc/lib/checksum_32.S
@@ -17,6 +17,7 @@
17#include <asm/cache.h> 17#include <asm/cache.h>
18#include <asm/errno.h> 18#include <asm/errno.h>
19#include <asm/ppc_asm.h> 19#include <asm/ppc_asm.h>
20#include <asm/export.h>
20 21
21 .text 22 .text
22 23
@@ -68,6 +69,7 @@ _GLOBAL(__csum_partial)
68 adde r5,r5,r0 69 adde r5,r5,r0
695: addze r3,r5 /* add in final carry */ 705: addze r3,r5 /* add in final carry */
70 blr 71 blr
72EXPORT_SYMBOL(__csum_partial)
71 73
72/* 74/*
73 * Computes the checksum of a memory block at src, length len, 75 * Computes the checksum of a memory block at src, length len,
@@ -297,3 +299,4 @@ dst_error:
297 .long 41b,dst_error 299 .long 41b,dst_error
298 .long 50b,src_error 300 .long 50b,src_error
299 .long 51b,dst_error 301 .long 51b,dst_error
302EXPORT_SYMBOL(csum_partial_copy_generic)
diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S
index fdec6e613e95..fd9176671f9f 100644
--- a/arch/powerpc/lib/checksum_64.S
+++ b/arch/powerpc/lib/checksum_64.S
@@ -16,6 +16,7 @@
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <asm/errno.h> 17#include <asm/errno.h>
18#include <asm/ppc_asm.h> 18#include <asm/ppc_asm.h>
19#include <asm/export.h>
19 20
20/* 21/*
21 * Computes the checksum of a memory block at buff, length len, 22 * Computes the checksum of a memory block at buff, length len,
@@ -176,6 +177,7 @@ _GLOBAL(__csum_partial)
176 add r3,r4,r0 177 add r3,r4,r0
177 srdi r3,r3,32 178 srdi r3,r3,32
178 blr 179 blr
180EXPORT_SYMBOL(__csum_partial)
179 181
180 182
181 .macro srcnr 183 .macro srcnr
@@ -430,3 +432,4 @@ dstnr; stb r6,0(r4)
430 li r6,-EFAULT 432 li r6,-EFAULT
431 stw r6,0(r8) 433 stw r6,0(r8)
432 blr 434 blr
435EXPORT_SYMBOL(csum_partial_copy_generic)
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
index 99f37f24185c..40cce33b08d6 100644
--- a/arch/powerpc/lib/copy_32.S
+++ b/arch/powerpc/lib/copy_32.S
@@ -12,6 +12,7 @@
12#include <asm/cache.h> 12#include <asm/cache.h>
13#include <asm/errno.h> 13#include <asm/errno.h>
14#include <asm/ppc_asm.h> 14#include <asm/ppc_asm.h>
15#include <asm/export.h>
15 16
16#define COPY_16_BYTES \ 17#define COPY_16_BYTES \
17 lwz r7,4(r4); \ 18 lwz r7,4(r4); \
@@ -92,6 +93,7 @@ _GLOBAL(memset)
92 subf r6,r0,r6 93 subf r6,r0,r6
93 cmplwi 0,r4,0 94 cmplwi 0,r4,0
94 bne 2f /* Use normal procedure if r4 is not zero */ 95 bne 2f /* Use normal procedure if r4 is not zero */
96EXPORT_SYMBOL(memset)
95_GLOBAL(memset_nocache_branch) 97_GLOBAL(memset_nocache_branch)
96 b 2f /* Skip optimised bloc until cache is enabled */ 98 b 2f /* Skip optimised bloc until cache is enabled */
97 99
@@ -216,6 +218,8 @@ _GLOBAL(memcpy)
216 stbu r0,1(r6) 218 stbu r0,1(r6)
217 bdnz 40b 219 bdnz 40b
21865: blr 22065: blr
221EXPORT_SYMBOL(memcpy)
222EXPORT_SYMBOL(memmove)
219 223
220generic_memcpy: 224generic_memcpy:
221 srwi. r7,r5,3 225 srwi. r7,r5,3
@@ -507,3 +511,4 @@ _GLOBAL(__copy_tofrom_user)
507 .long 112b,120b 511 .long 112b,120b
508 .long 114b,120b 512 .long 114b,120b
509 .text 513 .text
514EXPORT_SYMBOL(__copy_tofrom_user)
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index a3c4dc4defdd..21367b3a8146 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -10,6 +10,7 @@
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/ppc_asm.h> 11#include <asm/ppc_asm.h>
12#include <asm/asm-offsets.h> 12#include <asm/asm-offsets.h>
13#include <asm/export.h>
13 14
14 .section ".toc","aw" 15 .section ".toc","aw"
15PPC64_CACHES: 16PPC64_CACHES:
@@ -110,3 +111,4 @@ END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
110 std r11,120(r3) 111 std r11,120(r3)
111 std r12,128(r3) 112 std r12,128(r3)
112 blr 113 blr
114EXPORT_SYMBOL(copy_page)
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index 7b22624f332c..60386b2c99bb 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -8,6 +8,7 @@
8 */ 8 */
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/ppc_asm.h> 10#include <asm/ppc_asm.h>
11#include <asm/export.h>
11 12
12#ifdef __BIG_ENDIAN__ 13#ifdef __BIG_ENDIAN__
13#define sLd sld /* Shift towards low-numbered address. */ 14#define sLd sld /* Shift towards low-numbered address. */
@@ -671,3 +672,4 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
671 .llong 89b,100b 672 .llong 89b,100b
672 .llong 90b,100b 673 .llong 90b,100b
673 .llong 91b,100b 674 .llong 91b,100b
675EXPORT_SYMBOL(__copy_tofrom_user)
diff --git a/arch/powerpc/lib/hweight_64.S b/arch/powerpc/lib/hweight_64.S
index 19e66001a4f9..3de7ac154f24 100644
--- a/arch/powerpc/lib/hweight_64.S
+++ b/arch/powerpc/lib/hweight_64.S
@@ -19,6 +19,7 @@
19 */ 19 */
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/ppc_asm.h> 21#include <asm/ppc_asm.h>
22#include <asm/export.h>
22 23
23/* Note: This code relies on -mminimal-toc */ 24/* Note: This code relies on -mminimal-toc */
24 25
@@ -32,6 +33,7 @@ FTR_SECTION_ELSE
32 clrldi r3,r3,64-8 33 clrldi r3,r3,64-8
33 blr 34 blr
34ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) 35ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB)
36EXPORT_SYMBOL(__arch_hweight8)
35 37
36_GLOBAL(__arch_hweight16) 38_GLOBAL(__arch_hweight16)
37BEGIN_FTR_SECTION 39BEGIN_FTR_SECTION
@@ -54,6 +56,7 @@ FTR_SECTION_ELSE
54 blr 56 blr
55 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 50) 57 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 50)
56ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) 58ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB)
59EXPORT_SYMBOL(__arch_hweight16)
57 60
58_GLOBAL(__arch_hweight32) 61_GLOBAL(__arch_hweight32)
59BEGIN_FTR_SECTION 62BEGIN_FTR_SECTION
@@ -79,6 +82,7 @@ FTR_SECTION_ELSE
79 blr 82 blr
80 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 51) 83 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 51)
81ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) 84ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB)
85EXPORT_SYMBOL(__arch_hweight32)
82 86
83_GLOBAL(__arch_hweight64) 87_GLOBAL(__arch_hweight64)
84BEGIN_FTR_SECTION 88BEGIN_FTR_SECTION
@@ -108,3 +112,4 @@ FTR_SECTION_ELSE
108 blr 112 blr
109 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 52) 113 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 52)
110ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) 114ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB)
115EXPORT_SYMBOL(__arch_hweight64)
diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
index eda7a96161ab..85fa9869aec5 100644
--- a/arch/powerpc/lib/mem_64.S
+++ b/arch/powerpc/lib/mem_64.S
@@ -11,6 +11,7 @@
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/errno.h> 12#include <asm/errno.h>
13#include <asm/ppc_asm.h> 13#include <asm/ppc_asm.h>
14#include <asm/export.h>
14 15
15_GLOBAL(memset) 16_GLOBAL(memset)
16 neg r0,r3 17 neg r0,r3
@@ -77,6 +78,7 @@ _GLOBAL(memset)
7710: bflr 31 7810: bflr 31
78 stb r4,0(r6) 79 stb r4,0(r6)
79 blr 80 blr
81EXPORT_SYMBOL(memset)
80 82
81_GLOBAL_TOC(memmove) 83_GLOBAL_TOC(memmove)
82 cmplw 0,r3,r4 84 cmplw 0,r3,r4
@@ -119,3 +121,4 @@ _GLOBAL(backwards_memcpy)
119 beq 2b 121 beq 2b
120 mtctr r7 122 mtctr r7
121 b 1b 123 b 1b
124EXPORT_SYMBOL(memmove)
diff --git a/arch/powerpc/lib/memcmp_64.S b/arch/powerpc/lib/memcmp_64.S
index 8953d2382a65..d75d18b7bd55 100644
--- a/arch/powerpc/lib/memcmp_64.S
+++ b/arch/powerpc/lib/memcmp_64.S
@@ -8,6 +8,7 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10#include <asm/ppc_asm.h> 10#include <asm/ppc_asm.h>
11#include <asm/export.h>
11 12
12#define off8 r6 13#define off8 r6
13#define off16 r7 14#define off16 r7
@@ -231,3 +232,4 @@ _GLOBAL(memcmp)
231 ld r28,-32(r1) 232 ld r28,-32(r1)
232 ld r27,-40(r1) 233 ld r27,-40(r1)
233 blr 234 blr
235EXPORT_SYMBOL(memcmp)
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S
index 32a06ec395d2..f4d6088e2d53 100644
--- a/arch/powerpc/lib/memcpy_64.S
+++ b/arch/powerpc/lib/memcpy_64.S
@@ -8,6 +8,7 @@
8 */ 8 */
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/ppc_asm.h> 10#include <asm/ppc_asm.h>
11#include <asm/export.h>
11 12
12 .align 7 13 .align 7
13_GLOBAL_TOC(memcpy) 14_GLOBAL_TOC(memcpy)
@@ -219,3 +220,4 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
2194: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */ 2204: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */
220 blr 221 blr
221#endif 222#endif
223EXPORT_SYMBOL(memcpy)
diff --git a/arch/powerpc/lib/ppc_ksyms.c b/arch/powerpc/lib/ppc_ksyms.c
deleted file mode 100644
index ae69d846a841..000000000000
--- a/arch/powerpc/lib/ppc_ksyms.c
+++ /dev/null
@@ -1,29 +0,0 @@
1#include <linux/string.h>
2#include <linux/uaccess.h>
3#include <linux/bitops.h>
4#include <net/checksum.h>
5
6EXPORT_SYMBOL(memcpy);
7EXPORT_SYMBOL(memset);
8EXPORT_SYMBOL(memmove);
9EXPORT_SYMBOL(memcmp);
10EXPORT_SYMBOL(memchr);
11
12EXPORT_SYMBOL(strncpy);
13EXPORT_SYMBOL(strncmp);
14
15#ifndef CONFIG_GENERIC_CSUM
16EXPORT_SYMBOL(__csum_partial);
17EXPORT_SYMBOL(csum_partial_copy_generic);
18#endif
19
20EXPORT_SYMBOL(__copy_tofrom_user);
21EXPORT_SYMBOL(__clear_user);
22EXPORT_SYMBOL(copy_page);
23
24#ifdef CONFIG_PPC64
25EXPORT_SYMBOL(__arch_hweight8);
26EXPORT_SYMBOL(__arch_hweight16);
27EXPORT_SYMBOL(__arch_hweight32);
28EXPORT_SYMBOL(__arch_hweight64);
29#endif
diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S
index beabc68d9a1e..d13e07603519 100644
--- a/arch/powerpc/lib/string.S
+++ b/arch/powerpc/lib/string.S
@@ -11,6 +11,7 @@
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/errno.h> 12#include <asm/errno.h>
13#include <asm/ppc_asm.h> 13#include <asm/ppc_asm.h>
14#include <asm/export.h>
14 15
15 .section __ex_table,"a" 16 .section __ex_table,"a"
16 PPC_LONG_ALIGN 17 PPC_LONG_ALIGN
@@ -36,6 +37,7 @@ _GLOBAL(strncpy)
362: stbu r0,1(r6) /* clear it out if so */ 372: stbu r0,1(r6) /* clear it out if so */
37 bdnz 2b 38 bdnz 2b
38 blr 39 blr
40EXPORT_SYMBOL(strncpy)
39 41
40_GLOBAL(strncmp) 42_GLOBAL(strncmp)
41 PPC_LCMPI 0,r5,0 43 PPC_LCMPI 0,r5,0
@@ -53,6 +55,7 @@ _GLOBAL(strncmp)
53 blr 55 blr
542: li r3,0 562: li r3,0
55 blr 57 blr
58EXPORT_SYMBOL(strncmp)
56 59
57#ifdef CONFIG_PPC32 60#ifdef CONFIG_PPC32
58_GLOBAL(memcmp) 61_GLOBAL(memcmp)
@@ -68,6 +71,7 @@ _GLOBAL(memcmp)
68 blr 71 blr
692: li r3,0 722: li r3,0
70 blr 73 blr
74EXPORT_SYMBOL(memcmp)
71#endif 75#endif
72 76
73_GLOBAL(memchr) 77_GLOBAL(memchr)
@@ -82,6 +86,7 @@ _GLOBAL(memchr)
82 beqlr 86 beqlr
832: li r3,0 872: li r3,0
84 blr 88 blr
89EXPORT_SYMBOL(memchr)
85 90
86#ifdef CONFIG_PPC32 91#ifdef CONFIG_PPC32
87_GLOBAL(__clear_user) 92_GLOBAL(__clear_user)
@@ -125,4 +130,5 @@ _GLOBAL(__clear_user)
125 PPC_LONG 1b,91b 130 PPC_LONG 1b,91b
126 PPC_LONG 8b,92b 131 PPC_LONG 8b,92b
127 .text 132 .text
133EXPORT_SYMBOL(__clear_user)
128#endif 134#endif
diff --git a/arch/powerpc/lib/string_64.S b/arch/powerpc/lib/string_64.S
index 7bd9549a90a2..57ace356c949 100644
--- a/arch/powerpc/lib/string_64.S
+++ b/arch/powerpc/lib/string_64.S
@@ -20,6 +20,7 @@
20 20
21#include <asm/ppc_asm.h> 21#include <asm/ppc_asm.h>
22#include <asm/asm-offsets.h> 22#include <asm/asm-offsets.h>
23#include <asm/export.h>
23 24
24 .section ".toc","aw" 25 .section ".toc","aw"
25PPC64_CACHES: 26PPC64_CACHES:
@@ -200,3 +201,4 @@ err1; dcbz r0,r3
200 cmpdi r4,32 201 cmpdi r4,32
201 blt .Lshort_clear 202 blt .Lshort_clear
202 b .Lmedium_clear 203 b .Lmedium_clear
204EXPORT_SYMBOL(__clear_user)
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index 115347f74ce5..09cc50c8dace 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -26,6 +26,7 @@
26#include <asm/ppc_asm.h> 26#include <asm/ppc_asm.h>
27#include <asm/thread_info.h> 27#include <asm/thread_info.h>
28#include <asm/asm-offsets.h> 28#include <asm/asm-offsets.h>
29#include <asm/export.h>
29 30
30#ifdef CONFIG_SMP 31#ifdef CONFIG_SMP
31 .section .bss 32 .section .bss
@@ -33,6 +34,7 @@
33 .globl mmu_hash_lock 34 .globl mmu_hash_lock
34mmu_hash_lock: 35mmu_hash_lock:
35 .space 4 36 .space 4
37EXPORT_SYMBOL(mmu_hash_lock)
36#endif /* CONFIG_SMP */ 38#endif /* CONFIG_SMP */
37 39
38/* 40/*
@@ -575,6 +577,7 @@ _GLOBAL(flush_hash_pages)
575 rlwinm r8,r8,0,31,29 /* clear HASHPTE bit */ 577 rlwinm r8,r8,0,31,29 /* clear HASHPTE bit */
576 stwcx. r8,0,r5 /* update the pte */ 578 stwcx. r8,0,r5 /* update the pte */
577 bne- 33b 579 bne- 33b
580EXPORT_SYMBOL(flush_hash_pages)
578 581
579 /* Get the address of the primary PTE group in the hash table (r3) */ 582 /* Get the address of the primary PTE group in the hash table (r3) */
580_GLOBAL(flush_hash_patch_A) 583_GLOBAL(flush_hash_patch_A)
diff --git a/arch/powerpc/relocs_check.sh b/arch/powerpc/relocs_check.sh
index 2e4ebd0e25b3..ec2d5c835170 100755
--- a/arch/powerpc/relocs_check.sh
+++ b/arch/powerpc/relocs_check.sh
@@ -30,6 +30,7 @@ bad_relocs=$(
30 # On PPC64: 30 # On PPC64:
31 # R_PPC64_RELATIVE, R_PPC64_NONE 31 # R_PPC64_RELATIVE, R_PPC64_NONE
32 # R_PPC64_ADDR64 mach_<name> 32 # R_PPC64_ADDR64 mach_<name>
33 # R_PPC64_ADDR64 __crc_<name>
33 # On PPC: 34 # On PPC:
34 # R_PPC_RELATIVE, R_PPC_ADDR16_HI, 35 # R_PPC_RELATIVE, R_PPC_ADDR16_HI,
35 # R_PPC_ADDR16_HA,R_PPC_ADDR16_LO, 36 # R_PPC_ADDR16_HA,R_PPC_ADDR16_LO,
@@ -41,7 +42,8 @@ R_PPC_ADDR16_HI
41R_PPC_ADDR16_HA 42R_PPC_ADDR16_HA
42R_PPC_RELATIVE 43R_PPC_RELATIVE
43R_PPC_NONE' | 44R_PPC_NONE' |
44 grep -E -v '\<R_PPC64_ADDR64[[:space:]]+mach_' 45 grep -E -v '\<R_PPC64_ADDR64[[:space:]]+mach_' |
46 grep -E -v '\<R_PPC64_ADDR64[[:space:]]+__crc_'
45) 47)
46 48
47if [ -z "$bad_relocs" ]; then 49if [ -z "$bad_relocs" ]; then
diff --git a/arch/powerpc/sysdev/dcr-low.S b/arch/powerpc/sysdev/dcr-low.S
index d3098ef1404a..e687bb2003ff 100644
--- a/arch/powerpc/sysdev/dcr-low.S
+++ b/arch/powerpc/sysdev/dcr-low.S
@@ -12,6 +12,7 @@
12#include <asm/ppc_asm.h> 12#include <asm/ppc_asm.h>
13#include <asm/processor.h> 13#include <asm/processor.h>
14#include <asm/bug.h> 14#include <asm/bug.h>
15#include <asm/export.h>
15 16
16#define DCR_ACCESS_PROLOG(table) \ 17#define DCR_ACCESS_PROLOG(table) \
17 cmpli cr0,r3,1024; \ 18 cmpli cr0,r3,1024; \
@@ -28,9 +29,11 @@
28 29
29_GLOBAL(__mfdcr) 30_GLOBAL(__mfdcr)
30 DCR_ACCESS_PROLOG(__mfdcr_table) 31 DCR_ACCESS_PROLOG(__mfdcr_table)
32EXPORT_SYMBOL(__mfdcr)
31 33
32_GLOBAL(__mtdcr) 34_GLOBAL(__mtdcr)
33 DCR_ACCESS_PROLOG(__mtdcr_table) 35 DCR_ACCESS_PROLOG(__mtdcr_table)
36EXPORT_SYMBOL(__mtdcr)
34 37
35__mfdcr_table: 38__mfdcr_table:
36 mfdcr r3,0; blr 39 mfdcr r3,0; blr
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 9043d2e1e2ae..20f196b82a6e 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -1,6 +1,7 @@
1 1
2 2
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += export.h
4generic-y += irq_work.h 5generic-y += irq_work.h
5generic-y += mcs_spinlock.h 6generic-y += mcs_spinlock.h
6generic-y += mm-arch-hooks.h 7generic-y += mm-arch-hooks.h
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 72ccc41444dc..1f0fe98f6db9 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -61,7 +61,7 @@ obj-y += entry.o reipl.o relocate_kernel.o
61 61
62extra-y += head.o head64.o vmlinux.lds 62extra-y += head.o head64.o vmlinux.lds
63 63
64obj-$(CONFIG_MODULES) += s390_ksyms.o module.o 64obj-$(CONFIG_MODULES) += module.o
65obj-$(CONFIG_SMP) += smp.o 65obj-$(CONFIG_SMP) += smp.o
66obj-$(CONFIG_SCHED_TOPOLOGY) += topology.o 66obj-$(CONFIG_SCHED_TOPOLOGY) += topology.o
67obj-$(CONFIG_HIBERNATION) += suspend.o swsusp.o 67obj-$(CONFIG_HIBERNATION) += suspend.o swsusp.o
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index c51650a1ed16..49a30737adde 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -23,6 +23,7 @@
23#include <asm/vx-insn.h> 23#include <asm/vx-insn.h>
24#include <asm/setup.h> 24#include <asm/setup.h>
25#include <asm/nmi.h> 25#include <asm/nmi.h>
26#include <asm/export.h>
26 27
27__PT_R0 = __PT_GPRS 28__PT_R0 = __PT_GPRS
28__PT_R1 = __PT_GPRS + 8 29__PT_R1 = __PT_GPRS + 8
@@ -259,6 +260,8 @@ sie_exit:
259 260
260 EX_TABLE(.Lrewind_pad,.Lsie_fault) 261 EX_TABLE(.Lrewind_pad,.Lsie_fault)
261 EX_TABLE(sie_exit,.Lsie_fault) 262 EX_TABLE(sie_exit,.Lsie_fault)
263EXPORT_SYMBOL(sie64a)
264EXPORT_SYMBOL(sie_exit)
262#endif 265#endif
263 266
264/* 267/*
@@ -825,6 +828,9 @@ ENTRY(save_fpu_regs)
825 oi __LC_CPU_FLAGS+7,_CIF_FPU 828 oi __LC_CPU_FLAGS+7,_CIF_FPU
826 br %r14 829 br %r14
827.Lsave_fpu_regs_end: 830.Lsave_fpu_regs_end:
831#if IS_ENABLED(CONFIG_KVM)
832EXPORT_SYMBOL(save_fpu_regs)
833#endif
828 834
829/* 835/*
830 * Load floating-point controls and floating-point or vector registers. 836 * Load floating-point controls and floating-point or vector registers.
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index e499370fbccb..9a17e4475d27 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.S
@@ -9,6 +9,7 @@
9#include <asm/asm-offsets.h> 9#include <asm/asm-offsets.h>
10#include <asm/ftrace.h> 10#include <asm/ftrace.h>
11#include <asm/ptrace.h> 11#include <asm/ptrace.h>
12#include <asm/export.h>
12 13
13 .section .kprobes.text, "ax" 14 .section .kprobes.text, "ax"
14 15
@@ -23,6 +24,8 @@ ENTRY(ftrace_stub)
23ENTRY(_mcount) 24ENTRY(_mcount)
24 br %r14 25 br %r14
25 26
27EXPORT_SYMBOL(_mcount)
28
26ENTRY(ftrace_caller) 29ENTRY(ftrace_caller)
27 .globl ftrace_regs_caller 30 .globl ftrace_regs_caller
28 .set ftrace_regs_caller,ftrace_caller 31 .set ftrace_regs_caller,ftrace_caller
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
deleted file mode 100644
index e67453b73c3c..000000000000
--- a/arch/s390/kernel/s390_ksyms.c
+++ /dev/null
@@ -1,15 +0,0 @@
1#include <linux/module.h>
2#include <linux/kvm_host.h>
3#include <asm/fpu/api.h>
4#include <asm/ftrace.h>
5
6#ifdef CONFIG_FUNCTION_TRACER
7EXPORT_SYMBOL(_mcount);
8#endif
9#if IS_ENABLED(CONFIG_KVM)
10EXPORT_SYMBOL(sie64a);
11EXPORT_SYMBOL(sie_exit);
12EXPORT_SYMBOL(save_fpu_regs);
13#endif
14EXPORT_SYMBOL(memcpy);
15EXPORT_SYMBOL(memset);
diff --git a/arch/s390/lib/mem.S b/arch/s390/lib/mem.S
index c6d553e85ab1..be9fa65bfac4 100644
--- a/arch/s390/lib/mem.S
+++ b/arch/s390/lib/mem.S
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/export.h>
8 9
9/* 10/*
10 * memset implementation 11 * memset implementation
@@ -60,6 +61,7 @@ ENTRY(memset)
60 xc 0(1,%r1),0(%r1) 61 xc 0(1,%r1),0(%r1)
61.Lmemset_mvc: 62.Lmemset_mvc:
62 mvc 1(1,%r1),0(%r1) 63 mvc 1(1,%r1),0(%r1)
64EXPORT_SYMBOL(memset)
63 65
64/* 66/*
65 * memcpy implementation 67 * memcpy implementation
@@ -86,3 +88,4 @@ ENTRY(memcpy)
86 j .Lmemcpy_rest 88 j .Lmemcpy_rest
87.Lmemcpy_mvc: 89.Lmemcpy_mvc:
88 mvc 0(1,%r1),0(%r3) 90 mvc 0(1,%r1),0(%r3)
91EXPORT_SYMBOL(memcpy)
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 6024c26c0585..cfc918067f80 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -6,6 +6,7 @@ generic-y += cputime.h
6generic-y += div64.h 6generic-y += div64.h
7generic-y += emergency-restart.h 7generic-y += emergency-restart.h
8generic-y += exec.h 8generic-y += exec.h
9generic-y += export.h
9generic-y += irq_regs.h 10generic-y += irq_regs.h
10generic-y += irq_work.h 11generic-y += irq_work.h
11generic-y += linkage.h 12generic-y += linkage.h
diff --git a/arch/sparc/include/asm/string.h b/arch/sparc/include/asm/string.h
index 98b72a0c8e6e..86f34be14ce0 100644
--- a/arch/sparc/include/asm/string.h
+++ b/arch/sparc/include/asm/string.h
@@ -5,4 +5,38 @@
5#else 5#else
6#include <asm/string_32.h> 6#include <asm/string_32.h>
7#endif 7#endif
8
9/* First the mem*() things. */
10#define __HAVE_ARCH_MEMMOVE
11void *memmove(void *, const void *, __kernel_size_t);
12
13#define __HAVE_ARCH_MEMCPY
14#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
15
16#define __HAVE_ARCH_MEMSET
17#define memset(s, c, count) __builtin_memset(s, c, count)
18
19#define __HAVE_ARCH_MEMSCAN
20
21#define memscan(__arg0, __char, __arg2) \
22({ \
23 void *__memscan_zero(void *, size_t); \
24 void *__memscan_generic(void *, int, size_t); \
25 void *__retval, *__addr = (__arg0); \
26 size_t __size = (__arg2); \
27 \
28 if(__builtin_constant_p(__char) && !(__char)) \
29 __retval = __memscan_zero(__addr, __size); \
30 else \
31 __retval = __memscan_generic(__addr, (__char), __size); \
32 \
33 __retval; \
34})
35
36#define __HAVE_ARCH_MEMCMP
37int memcmp(const void *,const void *,__kernel_size_t);
38
39#define __HAVE_ARCH_STRNCMP
40int strncmp(const char *, const char *, __kernel_size_t);
41
8#endif 42#endif
diff --git a/arch/sparc/include/asm/string_32.h b/arch/sparc/include/asm/string_32.h
index 69974e924611..649412476a69 100644
--- a/arch/sparc/include/asm/string_32.h
+++ b/arch/sparc/include/asm/string_32.h
@@ -11,60 +11,4 @@
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13 13
14/* Really, userland/ksyms should not see any of this stuff. */
15
16#ifdef __KERNEL__
17
18void __memmove(void *,const void *,__kernel_size_t);
19
20#ifndef EXPORT_SYMTAB_STROPS
21
22/* First the mem*() things. */
23#define __HAVE_ARCH_MEMMOVE
24#undef memmove
25#define memmove(_to, _from, _n) \
26({ \
27 void *_t = (_to); \
28 __memmove(_t, (_from), (_n)); \
29 _t; \
30})
31
32#define __HAVE_ARCH_MEMCPY
33#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
34
35#define __HAVE_ARCH_MEMSET
36#define memset(s, c, count) __builtin_memset(s, c, count)
37
38#define __HAVE_ARCH_MEMSCAN
39
40#undef memscan
41#define memscan(__arg0, __char, __arg2) \
42({ \
43 void *__memscan_zero(void *, size_t); \
44 void *__memscan_generic(void *, int, size_t); \
45 void *__retval, *__addr = (__arg0); \
46 size_t __size = (__arg2); \
47 \
48 if(__builtin_constant_p(__char) && !(__char)) \
49 __retval = __memscan_zero(__addr, __size); \
50 else \
51 __retval = __memscan_generic(__addr, (__char), __size); \
52 \
53 __retval; \
54})
55
56#define __HAVE_ARCH_MEMCMP
57int memcmp(const void *,const void *,__kernel_size_t);
58
59/* Now the str*() stuff... */
60#define __HAVE_ARCH_STRLEN
61__kernel_size_t strlen(const char *);
62
63#define __HAVE_ARCH_STRNCMP
64int strncmp(const char *, const char *, __kernel_size_t);
65
66#endif /* !EXPORT_SYMTAB_STROPS */
67
68#endif /* __KERNEL__ */
69
70#endif /* !(__SPARC_STRING_H__) */ 14#endif /* !(__SPARC_STRING_H__) */
diff --git a/arch/sparc/include/asm/string_64.h b/arch/sparc/include/asm/string_64.h
index 5936b8ff3c05..6b9ccb308605 100644
--- a/arch/sparc/include/asm/string_64.h
+++ b/arch/sparc/include/asm/string_64.h
@@ -9,54 +9,10 @@
9#ifndef __SPARC64_STRING_H__ 9#ifndef __SPARC64_STRING_H__
10#define __SPARC64_STRING_H__ 10#define __SPARC64_STRING_H__
11 11
12/* Really, userland/ksyms should not see any of this stuff. */
13
14#ifdef __KERNEL__
15
16#include <asm/asi.h> 12#include <asm/asi.h>
17 13
18#ifndef EXPORT_SYMTAB_STROPS
19
20/* First the mem*() things. */
21#define __HAVE_ARCH_MEMMOVE
22void *memmove(void *, const void *, __kernel_size_t);
23
24#define __HAVE_ARCH_MEMCPY
25#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
26
27#define __HAVE_ARCH_MEMSET
28#define memset(s, c, count) __builtin_memset(s, c, count)
29
30#define __HAVE_ARCH_MEMSCAN
31
32#undef memscan
33#define memscan(__arg0, __char, __arg2) \
34({ \
35 void *__memscan_zero(void *, size_t); \
36 void *__memscan_generic(void *, int, size_t); \
37 void *__retval, *__addr = (__arg0); \
38 size_t __size = (__arg2); \
39 \
40 if(__builtin_constant_p(__char) && !(__char)) \
41 __retval = __memscan_zero(__addr, __size); \
42 else \
43 __retval = __memscan_generic(__addr, (__char), __size); \
44 \
45 __retval; \
46})
47
48#define __HAVE_ARCH_MEMCMP
49int memcmp(const void *,const void *,__kernel_size_t);
50
51/* Now the str*() stuff... */ 14/* Now the str*() stuff... */
52#define __HAVE_ARCH_STRLEN 15#define __HAVE_ARCH_STRLEN
53__kernel_size_t strlen(const char *); 16__kernel_size_t strlen(const char *);
54 17
55#define __HAVE_ARCH_STRNCMP
56int strncmp(const char *, const char *, __kernel_size_t);
57
58#endif /* !EXPORT_SYMTAB_STROPS */
59
60#endif /* __KERNEL__ */
61
62#endif /* !(__SPARC64_STRING_H__) */ 18#endif /* !(__SPARC64_STRING_H__) */
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index fdb13327fded..fa3c02d41138 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -86,7 +86,7 @@ obj-y += auxio_$(BITS).o
86obj-$(CONFIG_SUN_PM) += apc.o pmc.o 86obj-$(CONFIG_SUN_PM) += apc.o pmc.o
87 87
88obj-$(CONFIG_MODULES) += module.o 88obj-$(CONFIG_MODULES) += module.o
89obj-$(CONFIG_MODULES) += sparc_ksyms_$(BITS).o 89obj-$(CONFIG_MODULES) += sparc_ksyms.o
90obj-$(CONFIG_SPARC_LED) += led.o 90obj-$(CONFIG_SPARC_LED) += led.o
91obj-$(CONFIG_KGDB) += kgdb_$(BITS).o 91obj-$(CONFIG_KGDB) += kgdb_$(BITS).o
92 92
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index 07918ab3062e..d85bdb999819 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -29,6 +29,7 @@
29#include <asm/unistd.h> 29#include <asm/unistd.h>
30 30
31#include <asm/asmmacro.h> 31#include <asm/asmmacro.h>
32#include <asm/export.h>
32 33
33#define curptr g6 34#define curptr g6
34 35
@@ -1207,6 +1208,8 @@ delay_continue:
1207 1208
1208 ret 1209 ret
1209 restore 1210 restore
1211EXPORT_SYMBOL(__udelay)
1212EXPORT_SYMBOL(__ndelay)
1210 1213
1211 /* Handle a software breakpoint */ 1214 /* Handle a software breakpoint */
1212 /* We have to inform parent that child has stopped */ 1215 /* 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 3d92c0a8f6c4..7bb317b87dde 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -24,6 +24,7 @@
24#include <asm/thread_info.h> /* TI_UWINMASK */ 24#include <asm/thread_info.h> /* TI_UWINMASK */
25#include <asm/errno.h> 25#include <asm/errno.h>
26#include <asm/pgtsrmmu.h> /* SRMMU_PGDIR_SHIFT */ 26#include <asm/pgtsrmmu.h> /* SRMMU_PGDIR_SHIFT */
27#include <asm/export.h>
27 28
28 .data 29 .data
29/* The following are used with the prom_vector node-ops to figure out 30/* The following are used with the prom_vector node-ops to figure out
@@ -60,6 +61,7 @@ sun4e_notsup:
60 */ 61 */
61 .globl empty_zero_page 62 .globl empty_zero_page
62empty_zero_page: .skip PAGE_SIZE 63empty_zero_page: .skip PAGE_SIZE
64EXPORT_SYMBOL(empty_zero_page)
63 65
64 .global root_flags 66 .global root_flags
65 .global ram_flags 67 .global ram_flags
@@ -813,3 +815,4 @@ lvl14_save:
813__ret_efault: 815__ret_efault:
814 ret 816 ret
815 restore %g0, -EFAULT, %o0 817 restore %g0, -EFAULT, %o0
818EXPORT_SYMBOL(__ret_efault)
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index a076b4249e62..beba6c11554c 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -32,7 +32,8 @@
32#include <asm/estate.h> 32#include <asm/estate.h>
33#include <asm/sfafsr.h> 33#include <asm/sfafsr.h>
34#include <asm/unistd.h> 34#include <asm/unistd.h>
35 35#include <asm/export.h>
36
36/* This section from from _start to sparc64_boot_end should fit into 37/* This section from from _start to sparc64_boot_end should fit into
37 * 0x0000000000404000 to 0x0000000000408000. 38 * 0x0000000000404000 to 0x0000000000408000.
38 */ 39 */
@@ -143,6 +144,7 @@ prom_cpu_compatible:
143 .skip 64 144 .skip 64
144prom_root_node: 145prom_root_node:
145 .word 0 146 .word 0
147EXPORT_SYMBOL(prom_root_node)
146prom_mmu_ihandle_cache: 148prom_mmu_ihandle_cache:
147 .word 0 149 .word 0
148prom_boot_mapped_pc: 150prom_boot_mapped_pc:
@@ -158,6 +160,7 @@ is_sun4v:
158 .word 0 160 .word 0
159sun4v_chip_type: 161sun4v_chip_type:
160 .word SUN4V_CHIP_INVALID 162 .word SUN4V_CHIP_INVALID
163EXPORT_SYMBOL(sun4v_chip_type)
1611: 1641:
162 rd %pc, %l0 165 rd %pc, %l0
163 166
@@ -920,6 +923,7 @@ swapper_4m_tsb:
920 .globl prom_tba, tlb_type 923 .globl prom_tba, tlb_type
921prom_tba: .xword 0 924prom_tba: .xword 0
922tlb_type: .word 0 /* Must NOT end up in BSS */ 925tlb_type: .word 0 /* Must NOT end up in BSS */
926EXPORT_SYMBOL(tlb_type)
923 .section ".fixup",#alloc,#execinstr 927 .section ".fixup",#alloc,#execinstr
924 928
925 .globl __ret_efault, __retl_efault, __ret_one, __retl_one 929 .globl __ret_efault, __retl_efault, __ret_one, __retl_one
@@ -927,6 +931,7 @@ ENTRY(__ret_efault)
927 ret 931 ret
928 restore %g0, -EFAULT, %o0 932 restore %g0, -EFAULT, %o0
929ENDPROC(__ret_efault) 933ENDPROC(__ret_efault)
934EXPORT_SYMBOL(__ret_efault)
930 935
931ENTRY(__retl_efault) 936ENTRY(__retl_efault)
932 retl 937 retl
diff --git a/arch/sparc/kernel/helpers.S b/arch/sparc/kernel/helpers.S
index 314dd0c9fc5b..e4e5b832fcb6 100644
--- a/arch/sparc/kernel/helpers.S
+++ b/arch/sparc/kernel/helpers.S
@@ -15,6 +15,7 @@ __flushw_user:
152: retl 152: retl
16 nop 16 nop
17 .size __flushw_user,.-__flushw_user 17 .size __flushw_user,.-__flushw_user
18EXPORT_SYMBOL(__flushw_user)
18 19
19 /* Flush %fp and %i7 to the stack for all register 20 /* Flush %fp and %i7 to the stack for all register
20 * windows active inside of the cpu. This allows 21 * windows active inside of the cpu. This allows
@@ -61,3 +62,4 @@ real_hard_smp_processor_id:
61 .size hard_smp_processor_id,.-hard_smp_processor_id 62 .size hard_smp_processor_id,.-hard_smp_processor_id
62#endif 63#endif
63 .size real_hard_smp_processor_id,.-real_hard_smp_processor_id 64 .size real_hard_smp_processor_id,.-real_hard_smp_processor_id
65EXPORT_SYMBOL_GPL(real_hard_smp_processor_id)
diff --git a/arch/sparc/kernel/hvcalls.S b/arch/sparc/kernel/hvcalls.S
index d127130bf424..4116ee5c7791 100644
--- a/arch/sparc/kernel/hvcalls.S
+++ b/arch/sparc/kernel/hvcalls.S
@@ -343,6 +343,7 @@ ENTRY(sun4v_mach_set_watchdog)
3430: retl 3430: retl
344 nop 344 nop
345ENDPROC(sun4v_mach_set_watchdog) 345ENDPROC(sun4v_mach_set_watchdog)
346EXPORT_SYMBOL(sun4v_mach_set_watchdog)
346 347
347 /* No inputs and does not return. */ 348 /* No inputs and does not return. */
348ENTRY(sun4v_mach_sir) 349ENTRY(sun4v_mach_sir)
@@ -776,6 +777,7 @@ ENTRY(sun4v_niagara_getperf)
776 retl 777 retl
777 nop 778 nop
778ENDPROC(sun4v_niagara_getperf) 779ENDPROC(sun4v_niagara_getperf)
780EXPORT_SYMBOL(sun4v_niagara_getperf)
779 781
780ENTRY(sun4v_niagara_setperf) 782ENTRY(sun4v_niagara_setperf)
781 mov HV_FAST_SET_PERFREG, %o5 783 mov HV_FAST_SET_PERFREG, %o5
@@ -783,6 +785,7 @@ ENTRY(sun4v_niagara_setperf)
783 retl 785 retl
784 nop 786 nop
785ENDPROC(sun4v_niagara_setperf) 787ENDPROC(sun4v_niagara_setperf)
788EXPORT_SYMBOL(sun4v_niagara_setperf)
786 789
787ENTRY(sun4v_niagara2_getperf) 790ENTRY(sun4v_niagara2_getperf)
788 mov %o0, %o4 791 mov %o0, %o4
@@ -792,6 +795,7 @@ ENTRY(sun4v_niagara2_getperf)
792 retl 795 retl
793 nop 796 nop
794ENDPROC(sun4v_niagara2_getperf) 797ENDPROC(sun4v_niagara2_getperf)
798EXPORT_SYMBOL(sun4v_niagara2_getperf)
795 799
796ENTRY(sun4v_niagara2_setperf) 800ENTRY(sun4v_niagara2_setperf)
797 mov HV_FAST_N2_SET_PERFREG, %o5 801 mov HV_FAST_N2_SET_PERFREG, %o5
@@ -799,6 +803,7 @@ ENTRY(sun4v_niagara2_setperf)
799 retl 803 retl
800 nop 804 nop
801ENDPROC(sun4v_niagara2_setperf) 805ENDPROC(sun4v_niagara2_setperf)
806EXPORT_SYMBOL(sun4v_niagara2_setperf)
802 807
803ENTRY(sun4v_reboot_data_set) 808ENTRY(sun4v_reboot_data_set)
804 mov HV_FAST_REBOOT_DATA_SET, %o5 809 mov HV_FAST_REBOOT_DATA_SET, %o5
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
new file mode 100644
index 000000000000..09aa69e422e5
--- /dev/null
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -0,0 +1,12 @@
1/*
2 * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 */
7
8#include <linux/init.h>
9#include <linux/export.h>
10
11/* This is needed only for drivers/sbus/char/openprom.c */
12EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
deleted file mode 100644
index bf4ccb10a78c..000000000000
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 */
7
8#include <linux/module.h>
9
10#include <asm/pgtable.h>
11#include <asm/uaccess.h>
12#include <asm/delay.h>
13#include <asm/head.h>
14#include <asm/dma.h>
15
16struct poll {
17 int fd;
18 short events;
19 short revents;
20};
21
22/* from entry.S */
23EXPORT_SYMBOL(__udelay);
24EXPORT_SYMBOL(__ndelay);
25
26/* from head_32.S */
27EXPORT_SYMBOL(__ret_efault);
28EXPORT_SYMBOL(empty_zero_page);
29
30/* Exporting a symbol from /init/main.c */
31EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
deleted file mode 100644
index 9e034f29dcc5..000000000000
--- a/arch/sparc/kernel/sparc_ksyms_64.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
2 *
3 * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
5 * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
6 */
7
8#include <linux/export.h>
9#include <linux/pci.h>
10#include <linux/bitops.h>
11
12#include <asm/cpudata.h>
13#include <asm/uaccess.h>
14#include <asm/spitfire.h>
15#include <asm/oplib.h>
16#include <asm/hypervisor.h>
17#include <asm/cacheflush.h>
18
19struct poll {
20 int fd;
21 short events;
22 short revents;
23};
24
25/* from helpers.S */
26EXPORT_SYMBOL(__flushw_user);
27EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
28
29/* from head_64.S */
30EXPORT_SYMBOL(__ret_efault);
31EXPORT_SYMBOL(tlb_type);
32EXPORT_SYMBOL(sun4v_chip_type);
33EXPORT_SYMBOL(prom_root_node);
34
35/* from hvcalls.S */
36EXPORT_SYMBOL(sun4v_niagara_getperf);
37EXPORT_SYMBOL(sun4v_niagara_setperf);
38EXPORT_SYMBOL(sun4v_niagara2_getperf);
39EXPORT_SYMBOL(sun4v_niagara2_setperf);
40EXPORT_SYMBOL(sun4v_mach_set_watchdog);
41
42/* from hweight.S */
43EXPORT_SYMBOL(__arch_hweight8);
44EXPORT_SYMBOL(__arch_hweight16);
45EXPORT_SYMBOL(__arch_hweight32);
46EXPORT_SYMBOL(__arch_hweight64);
47
48/* from ffs_ffz.S */
49EXPORT_SYMBOL(ffs);
50EXPORT_SYMBOL(__ffs);
51
52/* Exporting a symbol from /init/main.c */
53EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 3269b0234093..885f00e81d1a 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -43,5 +43,4 @@ lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o
43 43
44obj-$(CONFIG_SPARC64) += iomap.o 44obj-$(CONFIG_SPARC64) += iomap.o
45obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o 45obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o
46obj-y += ksyms.o
47obj-$(CONFIG_SPARC64) += PeeCeeI.o 46obj-$(CONFIG_SPARC64) += PeeCeeI.o
diff --git a/arch/sparc/lib/U1memcpy.S b/arch/sparc/lib/U1memcpy.S
index 3e6209ebb7d7..97e1b211090c 100644
--- a/arch/sparc/lib/U1memcpy.S
+++ b/arch/sparc/lib/U1memcpy.S
@@ -7,6 +7,7 @@
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <asm/visasm.h> 8#include <asm/visasm.h>
9#include <asm/asi.h> 9#include <asm/asi.h>
10#include <asm/export.h>
10#define GLOBAL_SPARE g7 11#define GLOBAL_SPARE g7
11#else 12#else
12#define GLOBAL_SPARE g5 13#define GLOBAL_SPARE g5
@@ -567,3 +568,4 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
567 mov EX_RETVAL(%o4), %o0 568 mov EX_RETVAL(%o4), %o0
568 569
569 .size FUNC_NAME, .-FUNC_NAME 570 .size FUNC_NAME, .-FUNC_NAME
571EXPORT_SYMBOL(FUNC_NAME)
diff --git a/arch/sparc/lib/VISsave.S b/arch/sparc/lib/VISsave.S
index 62c2647bd5ce..1c7b6a39b942 100644
--- a/arch/sparc/lib/VISsave.S
+++ b/arch/sparc/lib/VISsave.S
@@ -13,6 +13,7 @@
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/visasm.h> 14#include <asm/visasm.h>
15#include <asm/thread_info.h> 15#include <asm/thread_info.h>
16#include <asm/export.h>
16 17
17 /* On entry: %o5=current FPRS value, %g7 is callers address */ 18 /* On entry: %o5=current FPRS value, %g7 is callers address */
18 /* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */ 19 /* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */
@@ -79,3 +80,4 @@ vis1: ldub [%g6 + TI_FPSAVED], %g3
7980: jmpl %g7 + %g0, %g0 8080: jmpl %g7 + %g0, %g0
80 nop 81 nop
81ENDPROC(VISenter) 82ENDPROC(VISenter)
83EXPORT_SYMBOL(VISenter)
diff --git a/arch/sparc/lib/ashldi3.S b/arch/sparc/lib/ashldi3.S
index 86f60de07b0a..c8b1cf71bc73 100644
--- a/arch/sparc/lib/ashldi3.S
+++ b/arch/sparc/lib/ashldi3.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(__ashldi3) 12ENTRY(__ashldi3)
@@ -33,3 +34,4 @@ ENTRY(__ashldi3)
33 retl 34 retl
34 nop 35 nop
35ENDPROC(__ashldi3) 36ENDPROC(__ashldi3)
37EXPORT_SYMBOL(__ashldi3)
diff --git a/arch/sparc/lib/ashrdi3.S b/arch/sparc/lib/ashrdi3.S
index 6eb8ba2dd50e..4310256e7964 100644
--- a/arch/sparc/lib/ashrdi3.S
+++ b/arch/sparc/lib/ashrdi3.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(__ashrdi3) 12ENTRY(__ashrdi3)
@@ -35,3 +36,4 @@ ENTRY(__ashrdi3)
35 jmpl %o7 + 8, %g0 36 jmpl %o7 + 8, %g0
36 nop 37 nop
37ENDPROC(__ashrdi3) 38ENDPROC(__ashrdi3)
39EXPORT_SYMBOL(__ashrdi3)
diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S
index a5c5a0279ccc..1c6a1bde5138 100644
--- a/arch/sparc/lib/atomic_64.S
+++ b/arch/sparc/lib/atomic_64.S
@@ -6,6 +6,7 @@
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/asi.h> 7#include <asm/asi.h>
8#include <asm/backoff.h> 8#include <asm/backoff.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11 12
@@ -29,6 +30,7 @@ ENTRY(atomic_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
29 nop; \ 30 nop; \
302: BACKOFF_SPIN(%o2, %o3, 1b); \ 312: BACKOFF_SPIN(%o2, %o3, 1b); \
31ENDPROC(atomic_##op); \ 32ENDPROC(atomic_##op); \
33EXPORT_SYMBOL(atomic_##op);
32 34
33#define ATOMIC_OP_RETURN(op) \ 35#define ATOMIC_OP_RETURN(op) \
34ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \ 36ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -42,7 +44,8 @@ ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
42 retl; \ 44 retl; \
43 sra %g1, 0, %o0; \ 45 sra %g1, 0, %o0; \
442: BACKOFF_SPIN(%o2, %o3, 1b); \ 462: BACKOFF_SPIN(%o2, %o3, 1b); \
45ENDPROC(atomic_##op##_return); 47ENDPROC(atomic_##op##_return); \
48EXPORT_SYMBOL(atomic_##op##_return);
46 49
47#define ATOMIC_FETCH_OP(op) \ 50#define ATOMIC_FETCH_OP(op) \
48ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \ 51ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -56,7 +59,8 @@ ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
56 retl; \ 59 retl; \
57 sra %g1, 0, %o0; \ 60 sra %g1, 0, %o0; \
582: BACKOFF_SPIN(%o2, %o3, 1b); \ 612: BACKOFF_SPIN(%o2, %o3, 1b); \
59ENDPROC(atomic_fetch_##op); 62ENDPROC(atomic_fetch_##op); \
63EXPORT_SYMBOL(atomic_fetch_##op);
60 64
61#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op) 65#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
62 66
@@ -88,6 +92,7 @@ ENTRY(atomic64_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
88 nop; \ 92 nop; \
892: BACKOFF_SPIN(%o2, %o3, 1b); \ 932: BACKOFF_SPIN(%o2, %o3, 1b); \
90ENDPROC(atomic64_##op); \ 94ENDPROC(atomic64_##op); \
95EXPORT_SYMBOL(atomic64_##op);
91 96
92#define ATOMIC64_OP_RETURN(op) \ 97#define ATOMIC64_OP_RETURN(op) \
93ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \ 98ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -101,7 +106,8 @@ ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
101 retl; \ 106 retl; \
102 op %g1, %o0, %o0; \ 107 op %g1, %o0, %o0; \
1032: BACKOFF_SPIN(%o2, %o3, 1b); \ 1082: BACKOFF_SPIN(%o2, %o3, 1b); \
104ENDPROC(atomic64_##op##_return); 109ENDPROC(atomic64_##op##_return); \
110EXPORT_SYMBOL(atomic64_##op##_return);
105 111
106#define ATOMIC64_FETCH_OP(op) \ 112#define ATOMIC64_FETCH_OP(op) \
107ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \ 113ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -115,7 +121,8 @@ ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
115 retl; \ 121 retl; \
116 mov %g1, %o0; \ 122 mov %g1, %o0; \
1172: BACKOFF_SPIN(%o2, %o3, 1b); \ 1232: BACKOFF_SPIN(%o2, %o3, 1b); \
118ENDPROC(atomic64_fetch_##op); 124ENDPROC(atomic64_fetch_##op); \
125EXPORT_SYMBOL(atomic64_fetch_##op);
119 126
120#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op) 127#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
121 128
@@ -147,3 +154,4 @@ ENTRY(atomic64_dec_if_positive) /* %o0 = atomic_ptr */
147 sub %g1, 1, %o0 154 sub %g1, 1, %o0
1482: BACKOFF_SPIN(%o2, %o3, 1b) 1552: BACKOFF_SPIN(%o2, %o3, 1b)
149ENDPROC(atomic64_dec_if_positive) 156ENDPROC(atomic64_dec_if_positive)
157EXPORT_SYMBOL(atomic64_dec_if_positive)
diff --git a/arch/sparc/lib/bitops.S b/arch/sparc/lib/bitops.S
index 36f72cc0e67e..7031bf1587cb 100644
--- a/arch/sparc/lib/bitops.S
+++ b/arch/sparc/lib/bitops.S
@@ -6,6 +6,7 @@
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/asi.h> 7#include <asm/asi.h>
8#include <asm/backoff.h> 8#include <asm/backoff.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11 12
@@ -29,6 +30,7 @@ ENTRY(test_and_set_bit) /* %o0=nr, %o1=addr */
29 nop 30 nop
302: BACKOFF_SPIN(%o3, %o4, 1b) 312: BACKOFF_SPIN(%o3, %o4, 1b)
31ENDPROC(test_and_set_bit) 32ENDPROC(test_and_set_bit)
33EXPORT_SYMBOL(test_and_set_bit)
32 34
33ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */ 35ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
34 BACKOFF_SETUP(%o3) 36 BACKOFF_SETUP(%o3)
@@ -50,6 +52,7 @@ ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
50 nop 52 nop
512: BACKOFF_SPIN(%o3, %o4, 1b) 532: BACKOFF_SPIN(%o3, %o4, 1b)
52ENDPROC(test_and_clear_bit) 54ENDPROC(test_and_clear_bit)
55EXPORT_SYMBOL(test_and_clear_bit)
53 56
54ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */ 57ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
55 BACKOFF_SETUP(%o3) 58 BACKOFF_SETUP(%o3)
@@ -71,6 +74,7 @@ ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
71 nop 74 nop
722: BACKOFF_SPIN(%o3, %o4, 1b) 752: BACKOFF_SPIN(%o3, %o4, 1b)
73ENDPROC(test_and_change_bit) 76ENDPROC(test_and_change_bit)
77EXPORT_SYMBOL(test_and_change_bit)
74 78
75ENTRY(set_bit) /* %o0=nr, %o1=addr */ 79ENTRY(set_bit) /* %o0=nr, %o1=addr */
76 BACKOFF_SETUP(%o3) 80 BACKOFF_SETUP(%o3)
@@ -90,6 +94,7 @@ ENTRY(set_bit) /* %o0=nr, %o1=addr */
90 nop 94 nop
912: BACKOFF_SPIN(%o3, %o4, 1b) 952: BACKOFF_SPIN(%o3, %o4, 1b)
92ENDPROC(set_bit) 96ENDPROC(set_bit)
97EXPORT_SYMBOL(set_bit)
93 98
94ENTRY(clear_bit) /* %o0=nr, %o1=addr */ 99ENTRY(clear_bit) /* %o0=nr, %o1=addr */
95 BACKOFF_SETUP(%o3) 100 BACKOFF_SETUP(%o3)
@@ -109,6 +114,7 @@ ENTRY(clear_bit) /* %o0=nr, %o1=addr */
109 nop 114 nop
1102: BACKOFF_SPIN(%o3, %o4, 1b) 1152: BACKOFF_SPIN(%o3, %o4, 1b)
111ENDPROC(clear_bit) 116ENDPROC(clear_bit)
117EXPORT_SYMBOL(clear_bit)
112 118
113ENTRY(change_bit) /* %o0=nr, %o1=addr */ 119ENTRY(change_bit) /* %o0=nr, %o1=addr */
114 BACKOFF_SETUP(%o3) 120 BACKOFF_SETUP(%o3)
@@ -128,3 +134,4 @@ ENTRY(change_bit) /* %o0=nr, %o1=addr */
128 nop 134 nop
1292: BACKOFF_SPIN(%o3, %o4, 1b) 1352: BACKOFF_SPIN(%o3, %o4, 1b)
130ENDPROC(change_bit) 136ENDPROC(change_bit)
137EXPORT_SYMBOL(change_bit)
diff --git a/arch/sparc/lib/blockops.S b/arch/sparc/lib/blockops.S
index 3c771011ff4b..1f2692d59d18 100644
--- a/arch/sparc/lib/blockops.S
+++ b/arch/sparc/lib/blockops.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/page.h> 8#include <asm/page.h>
9#include <asm/export.h>
9 10
10 /* Zero out 64 bytes of memory at (buf + offset). 11 /* Zero out 64 bytes of memory at (buf + offset).
11 * Assumes %g1 contains zero. 12 * Assumes %g1 contains zero.
@@ -64,6 +65,7 @@ ENTRY(bzero_1page)
64 retl 65 retl
65 nop 66 nop
66ENDPROC(bzero_1page) 67ENDPROC(bzero_1page)
68EXPORT_SYMBOL(bzero_1page)
67 69
68ENTRY(__copy_1page) 70ENTRY(__copy_1page)
69/* NOTE: If you change the number of insns of this routine, please check 71/* NOTE: If you change the number of insns of this routine, please check
@@ -87,3 +89,4 @@ ENTRY(__copy_1page)
87 retl 89 retl
88 nop 90 nop
89ENDPROC(__copy_1page) 91ENDPROC(__copy_1page)
92EXPORT_SYMBOL(__copy_1page)
diff --git a/arch/sparc/lib/bzero.S b/arch/sparc/lib/bzero.S
index 8c058114b649..3bb1914c4fa4 100644
--- a/arch/sparc/lib/bzero.S
+++ b/arch/sparc/lib/bzero.S
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/export.h>
8 9
9 .text 10 .text
10 11
@@ -78,6 +79,8 @@ __bzero_done:
78 mov %o3, %o0 79 mov %o3, %o0
79ENDPROC(__bzero) 80ENDPROC(__bzero)
80ENDPROC(memset) 81ENDPROC(memset)
82EXPORT_SYMBOL(__bzero)
83EXPORT_SYMBOL(memset)
81 84
82#define EX_ST(x,y) \ 85#define EX_ST(x,y) \
8398: x,y; \ 8698: x,y; \
@@ -143,3 +146,4 @@ __clear_user_done:
143 retl 146 retl
144 clr %o0 147 clr %o0
145ENDPROC(__clear_user) 148ENDPROC(__clear_user)
149EXPORT_SYMBOL(__clear_user)
diff --git a/arch/sparc/lib/checksum_32.S b/arch/sparc/lib/checksum_32.S
index 0084c3361e15..c9d8b6232111 100644
--- a/arch/sparc/lib/checksum_32.S
+++ b/arch/sparc/lib/checksum_32.S
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <asm/errno.h> 16#include <asm/errno.h>
17#include <asm/export.h>
17 18
18#define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \ 19#define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \
19 ldd [buf + offset + 0x00], t0; \ 20 ldd [buf + offset + 0x00], t0; \
@@ -104,6 +105,7 @@ csum_partial_fix_alignment:
104 * buffer of size 0x20. Follow the code path for that case. 105 * buffer of size 0x20. Follow the code path for that case.
105 */ 106 */
106 .globl csum_partial 107 .globl csum_partial
108 EXPORT_SYMBOL(csum_partial)
107csum_partial: /* %o0=buf, %o1=len, %o2=sum */ 109csum_partial: /* %o0=buf, %o1=len, %o2=sum */
108 andcc %o0, 0x7, %g0 ! alignment problems? 110 andcc %o0, 0x7, %g0 ! alignment problems?
109 bne csum_partial_fix_alignment ! yep, handle it 111 bne csum_partial_fix_alignment ! yep, handle it
@@ -335,6 +337,7 @@ cc_dword_align:
335 */ 337 */
336 .align 8 338 .align 8
337 .globl __csum_partial_copy_sparc_generic 339 .globl __csum_partial_copy_sparc_generic
340 EXPORT_SYMBOL(__csum_partial_copy_sparc_generic)
338__csum_partial_copy_sparc_generic: 341__csum_partial_copy_sparc_generic:
339 /* %o0=src, %o1=dest, %g1=len, %g7=sum */ 342 /* %o0=src, %o1=dest, %g1=len, %g7=sum */
340 xor %o0, %o1, %o4 ! get changing bits 343 xor %o0, %o1, %o4 ! get changing bits
diff --git a/arch/sparc/lib/checksum_64.S b/arch/sparc/lib/checksum_64.S
index 1d230f693dc4..f6732174fe6b 100644
--- a/arch/sparc/lib/checksum_64.S
+++ b/arch/sparc/lib/checksum_64.S
@@ -13,6 +13,7 @@
13 * BSD4.4 portable checksum routine 13 * BSD4.4 portable checksum routine
14 */ 14 */
15 15
16#include <asm/export.h>
16 .text 17 .text
17 18
18csum_partial_fix_alignment: 19csum_partial_fix_alignment:
@@ -37,6 +38,7 @@ csum_partial_fix_alignment:
37 38
38 .align 32 39 .align 32
39 .globl csum_partial 40 .globl csum_partial
41 EXPORT_SYMBOL(csum_partial)
40csum_partial: /* %o0=buff, %o1=len, %o2=sum */ 42csum_partial: /* %o0=buff, %o1=len, %o2=sum */
41 prefetch [%o0 + 0x000], #n_reads 43 prefetch [%o0 + 0x000], #n_reads
42 clr %o4 44 clr %o4
diff --git a/arch/sparc/lib/clear_page.S b/arch/sparc/lib/clear_page.S
index 46272dfc26e8..f30d6b78afbd 100644
--- a/arch/sparc/lib/clear_page.S
+++ b/arch/sparc/lib/clear_page.S
@@ -10,6 +10,7 @@
10#include <asm/pgtable.h> 10#include <asm/pgtable.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/head.h> 12#include <asm/head.h>
13#include <asm/export.h>
13 14
14 /* What we used to do was lock a TLB entry into a specific 15 /* What we used to do was lock a TLB entry into a specific
15 * TLB slot, clear the page with interrupts disabled, then 16 * TLB slot, clear the page with interrupts disabled, then
@@ -26,6 +27,7 @@
26 .text 27 .text
27 28
28 .globl _clear_page 29 .globl _clear_page
30 EXPORT_SYMBOL(_clear_page)
29_clear_page: /* %o0=dest */ 31_clear_page: /* %o0=dest */
30 ba,pt %xcc, clear_page_common 32 ba,pt %xcc, clear_page_common
31 clr %o4 33 clr %o4
@@ -35,6 +37,7 @@ _clear_page: /* %o0=dest */
35 */ 37 */
36 .align 32 38 .align 32
37 .globl clear_user_page 39 .globl clear_user_page
40 EXPORT_SYMBOL(clear_user_page)
38clear_user_page: /* %o0=dest, %o1=vaddr */ 41clear_user_page: /* %o0=dest, %o1=vaddr */
39 lduw [%g6 + TI_PRE_COUNT], %o2 42 lduw [%g6 + TI_PRE_COUNT], %o2
40 sethi %hi(PAGE_OFFSET), %g2 43 sethi %hi(PAGE_OFFSET), %g2
diff --git a/arch/sparc/lib/copy_in_user.S b/arch/sparc/lib/copy_in_user.S
index 302c0e60dc2c..482de093bdae 100644
--- a/arch/sparc/lib/copy_in_user.S
+++ b/arch/sparc/lib/copy_in_user.S
@@ -5,6 +5,7 @@
5 5
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/asi.h> 7#include <asm/asi.h>
8#include <asm/export.h>
8 9
9#define XCC xcc 10#define XCC xcc
10 11
@@ -90,3 +91,4 @@ ENTRY(___copy_in_user) /* %o0=dst, %o1=src, %o2=len */
90 retl 91 retl
91 clr %o0 92 clr %o0
92ENDPROC(___copy_in_user) 93ENDPROC(___copy_in_user)
94EXPORT_SYMBOL(___copy_in_user)
diff --git a/arch/sparc/lib/copy_page.S b/arch/sparc/lib/copy_page.S
index dd16c61f3263..7197b7250895 100644
--- a/arch/sparc/lib/copy_page.S
+++ b/arch/sparc/lib/copy_page.S
@@ -10,6 +10,7 @@
10#include <asm/pgtable.h> 10#include <asm/pgtable.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/head.h> 12#include <asm/head.h>
13#include <asm/export.h>
13 14
14 /* What we used to do was lock a TLB entry into a specific 15 /* What we used to do was lock a TLB entry into a specific
15 * TLB slot, clear the page with interrupts disabled, then 16 * TLB slot, clear the page with interrupts disabled, then
@@ -44,6 +45,7 @@
44 .align 32 45 .align 32
45 .globl copy_user_page 46 .globl copy_user_page
46 .type copy_user_page,#function 47 .type copy_user_page,#function
48 EXPORT_SYMBOL(copy_user_page)
47copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ 49copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
48 lduw [%g6 + TI_PRE_COUNT], %o4 50 lduw [%g6 + TI_PRE_COUNT], %o4
49 sethi %hi(PAGE_OFFSET), %g2 51 sethi %hi(PAGE_OFFSET), %g2
diff --git a/arch/sparc/lib/copy_user.S b/arch/sparc/lib/copy_user.S
index ef095b6c43b1..cea644dc67a6 100644
--- a/arch/sparc/lib/copy_user.S
+++ b/arch/sparc/lib/copy_user.S
@@ -15,6 +15,7 @@
15#include <asm/asmmacro.h> 15#include <asm/asmmacro.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/thread_info.h> 17#include <asm/thread_info.h>
18#include <asm/export.h>
18 19
19/* Work around cpp -rob */ 20/* Work around cpp -rob */
20#define ALLOC #alloc 21#define ALLOC #alloc
@@ -119,6 +120,7 @@
119__copy_user_begin: 120__copy_user_begin:
120 121
121 .globl __copy_user 122 .globl __copy_user
123 EXPORT_SYMBOL(__copy_user)
122dword_align: 124dword_align:
123 andcc %o1, 1, %g0 125 andcc %o1, 1, %g0
124 be 4f 126 be 4f
diff --git a/arch/sparc/lib/csum_copy.S b/arch/sparc/lib/csum_copy.S
index e566c770a0f6..0ecbafc30fd0 100644
--- a/arch/sparc/lib/csum_copy.S
+++ b/arch/sparc/lib/csum_copy.S
@@ -3,6 +3,8 @@
3 * Copyright (C) 2005 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
4 */ 4 */
5 5
6#include <asm/export.h>
7
6#ifdef __KERNEL__ 8#ifdef __KERNEL__
7#define GLOBAL_SPARE %g7 9#define GLOBAL_SPARE %g7
8#else 10#else
@@ -63,6 +65,7 @@
63 add %o5, %o4, %o4 65 add %o5, %o4, %o4
64 66
65 .globl FUNC_NAME 67 .globl FUNC_NAME
68 EXPORT_SYMBOL(FUNC_NAME)
66FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */ 69FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */
67 LOAD(prefetch, %o0 + 0x000, #n_reads) 70 LOAD(prefetch, %o0 + 0x000, #n_reads)
68 xor %o0, %o1, %g1 71 xor %o0, %o1, %g1
diff --git a/arch/sparc/lib/divdi3.S b/arch/sparc/lib/divdi3.S
index 9614b48b6ef8..a2b5a976be33 100644
--- a/arch/sparc/lib/divdi3.S
+++ b/arch/sparc/lib/divdi3.S
@@ -17,6 +17,7 @@ along with GNU CC; see the file COPYING. If not, write to
17the Free Software Foundation, 59 Temple Place - Suite 330, 17the Free Software Foundation, 59 Temple Place - Suite 330,
18Boston, MA 02111-1307, USA. */ 18Boston, MA 02111-1307, USA. */
19 19
20#include <asm/export.h>
20 .text 21 .text
21 .align 4 22 .align 4
22 .globl __divdi3 23 .globl __divdi3
@@ -279,3 +280,4 @@ __divdi3:
279.LL81: 280.LL81:
280 ret 281 ret
281 restore 282 restore
283EXPORT_SYMBOL(__divdi3)
diff --git a/arch/sparc/lib/ffs.S b/arch/sparc/lib/ffs.S
index b39389f69899..23aab144d28e 100644
--- a/arch/sparc/lib/ffs.S
+++ b/arch/sparc/lib/ffs.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3 .register %g2,#scratch 4 .register %g2,#scratch
4 5
@@ -65,6 +66,8 @@ ENTRY(__ffs)
65 add %o2, %g1, %o0 66 add %o2, %g1, %o0
66ENDPROC(ffs) 67ENDPROC(ffs)
67ENDPROC(__ffs) 68ENDPROC(__ffs)
69EXPORT_SYMBOL(__ffs)
70EXPORT_SYMBOL(ffs)
68 71
69 .section .popc_6insn_patch, "ax" 72 .section .popc_6insn_patch, "ax"
70 .word ffs 73 .word ffs
diff --git a/arch/sparc/lib/hweight.S b/arch/sparc/lib/hweight.S
index 95414e0a6808..f9985f129fb6 100644
--- a/arch/sparc/lib/hweight.S
+++ b/arch/sparc/lib/hweight.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3 .text 4 .text
4 .align 32 5 .align 32
@@ -7,6 +8,7 @@ ENTRY(__arch_hweight8)
7 nop 8 nop
8 nop 9 nop
9ENDPROC(__arch_hweight8) 10ENDPROC(__arch_hweight8)
11EXPORT_SYMBOL(__arch_hweight8)
10 .section .popc_3insn_patch, "ax" 12 .section .popc_3insn_patch, "ax"
11 .word __arch_hweight8 13 .word __arch_hweight8
12 sllx %o0, 64-8, %g1 14 sllx %o0, 64-8, %g1
@@ -19,6 +21,7 @@ ENTRY(__arch_hweight16)
19 nop 21 nop
20 nop 22 nop
21ENDPROC(__arch_hweight16) 23ENDPROC(__arch_hweight16)
24EXPORT_SYMBOL(__arch_hweight16)
22 .section .popc_3insn_patch, "ax" 25 .section .popc_3insn_patch, "ax"
23 .word __arch_hweight16 26 .word __arch_hweight16
24 sllx %o0, 64-16, %g1 27 sllx %o0, 64-16, %g1
@@ -31,6 +34,7 @@ ENTRY(__arch_hweight32)
31 nop 34 nop
32 nop 35 nop
33ENDPROC(__arch_hweight32) 36ENDPROC(__arch_hweight32)
37EXPORT_SYMBOL(__arch_hweight32)
34 .section .popc_3insn_patch, "ax" 38 .section .popc_3insn_patch, "ax"
35 .word __arch_hweight32 39 .word __arch_hweight32
36 sllx %o0, 64-32, %g1 40 sllx %o0, 64-32, %g1
@@ -43,6 +47,7 @@ ENTRY(__arch_hweight64)
43 nop 47 nop
44 nop 48 nop
45ENDPROC(__arch_hweight64) 49ENDPROC(__arch_hweight64)
50EXPORT_SYMBOL(__arch_hweight64)
46 .section .popc_3insn_patch, "ax" 51 .section .popc_3insn_patch, "ax"
47 .word __arch_hweight64 52 .word __arch_hweight64
48 retl 53 retl
diff --git a/arch/sparc/lib/ipcsum.S b/arch/sparc/lib/ipcsum.S
index 4742d59029ee..5d61648b53dd 100644
--- a/arch/sparc/lib/ipcsum.S
+++ b/arch/sparc/lib/ipcsum.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3 .text 4 .text
4ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */ 5ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
@@ -31,3 +32,4 @@ ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
31 retl 32 retl
32 and %o2, %o1, %o0 33 and %o2, %o1, %o0
33ENDPROC(ip_fast_csum) 34ENDPROC(ip_fast_csum)
35EXPORT_SYMBOL(ip_fast_csum)
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
deleted file mode 100644
index de5e97817bdb..000000000000
--- a/arch/sparc/lib/ksyms.c
+++ /dev/null
@@ -1,174 +0,0 @@
1/*
2 * Export of symbols defined in assembler
3 */
4
5/* Tell string.h we don't want memcpy etc. as cpp defines */
6#define EXPORT_SYMTAB_STROPS
7
8#include <linux/module.h>
9#include <linux/string.h>
10#include <linux/types.h>
11
12#include <asm/checksum.h>
13#include <asm/uaccess.h>
14#include <asm/ftrace.h>
15
16/* string functions */
17EXPORT_SYMBOL(strlen);
18EXPORT_SYMBOL(strncmp);
19
20/* mem* functions */
21extern void *__memscan_zero(void *, size_t);
22extern void *__memscan_generic(void *, int, size_t);
23extern void *__bzero(void *, size_t);
24
25EXPORT_SYMBOL(memscan);
26EXPORT_SYMBOL(__memscan_zero);
27EXPORT_SYMBOL(__memscan_generic);
28EXPORT_SYMBOL(memcmp);
29EXPORT_SYMBOL(memcpy);
30EXPORT_SYMBOL(memset);
31EXPORT_SYMBOL(memmove);
32EXPORT_SYMBOL(__bzero);
33
34/* Networking helper routines. */
35EXPORT_SYMBOL(csum_partial);
36
37#ifdef CONFIG_MCOUNT
38EXPORT_SYMBOL(_mcount);
39#endif
40
41/*
42 * sparc
43 */
44#ifdef CONFIG_SPARC32
45extern int __ashrdi3(int, int);
46extern int __ashldi3(int, int);
47extern int __lshrdi3(int, int);
48extern int __muldi3(int, int);
49extern int __divdi3(int, int);
50
51extern void (*__copy_1page)(void *, const void *);
52extern void (*bzero_1page)(void *);
53
54extern void ___rw_read_enter(void);
55extern void ___rw_read_try(void);
56extern void ___rw_read_exit(void);
57extern void ___rw_write_enter(void);
58
59/* Networking helper routines. */
60EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
61
62/* Special internal versions of library functions. */
63EXPORT_SYMBOL(__copy_1page);
64EXPORT_SYMBOL(__memmove);
65EXPORT_SYMBOL(bzero_1page);
66
67/* Moving data to/from/in userspace. */
68EXPORT_SYMBOL(__copy_user);
69
70/* Used by asm/spinlock.h */
71#ifdef CONFIG_SMP
72EXPORT_SYMBOL(___rw_read_enter);
73EXPORT_SYMBOL(___rw_read_try);
74EXPORT_SYMBOL(___rw_read_exit);
75EXPORT_SYMBOL(___rw_write_enter);
76#endif
77
78EXPORT_SYMBOL(__ashrdi3);
79EXPORT_SYMBOL(__ashldi3);
80EXPORT_SYMBOL(__lshrdi3);
81EXPORT_SYMBOL(__muldi3);
82EXPORT_SYMBOL(__divdi3);
83#endif
84
85/*
86 * sparc64
87 */
88#ifdef CONFIG_SPARC64
89/* Networking helper routines. */
90EXPORT_SYMBOL(csum_partial_copy_nocheck);
91EXPORT_SYMBOL(__csum_partial_copy_from_user);
92EXPORT_SYMBOL(__csum_partial_copy_to_user);
93EXPORT_SYMBOL(ip_fast_csum);
94
95/* Moving data to/from/in userspace. */
96EXPORT_SYMBOL(___copy_to_user);
97EXPORT_SYMBOL(___copy_from_user);
98EXPORT_SYMBOL(___copy_in_user);
99EXPORT_SYMBOL(__clear_user);
100
101/* Atomic counter implementation. */
102#define ATOMIC_OP(op) \
103EXPORT_SYMBOL(atomic_##op); \
104EXPORT_SYMBOL(atomic64_##op);
105
106#define ATOMIC_OP_RETURN(op) \
107EXPORT_SYMBOL(atomic_##op##_return); \
108EXPORT_SYMBOL(atomic64_##op##_return);
109
110#define ATOMIC_FETCH_OP(op) \
111EXPORT_SYMBOL(atomic_fetch_##op); \
112EXPORT_SYMBOL(atomic64_fetch_##op);
113
114#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
115
116ATOMIC_OPS(add)
117ATOMIC_OPS(sub)
118
119#undef ATOMIC_OPS
120#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
121
122ATOMIC_OPS(and)
123ATOMIC_OPS(or)
124ATOMIC_OPS(xor)
125
126#undef ATOMIC_OPS
127#undef ATOMIC_FETCH_OP
128#undef ATOMIC_OP_RETURN
129#undef ATOMIC_OP
130
131EXPORT_SYMBOL(atomic64_dec_if_positive);
132
133/* Atomic bit operations. */
134EXPORT_SYMBOL(test_and_set_bit);
135EXPORT_SYMBOL(test_and_clear_bit);
136EXPORT_SYMBOL(test_and_change_bit);
137EXPORT_SYMBOL(set_bit);
138EXPORT_SYMBOL(clear_bit);
139EXPORT_SYMBOL(change_bit);
140
141/* Special internal versions of library functions. */
142EXPORT_SYMBOL(_clear_page);
143EXPORT_SYMBOL(clear_user_page);
144EXPORT_SYMBOL(copy_user_page);
145
146/* RAID code needs this */
147void VISenter(void);
148EXPORT_SYMBOL(VISenter);
149
150extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
151extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
152 unsigned long *);
153extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
154 unsigned long *, unsigned long *);
155extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
156 unsigned long *, unsigned long *, unsigned long *);
157EXPORT_SYMBOL(xor_vis_2);
158EXPORT_SYMBOL(xor_vis_3);
159EXPORT_SYMBOL(xor_vis_4);
160EXPORT_SYMBOL(xor_vis_5);
161
162extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
163extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
164 unsigned long *);
165extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
166 unsigned long *, unsigned long *);
167extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
168 unsigned long *, unsigned long *, unsigned long *);
169
170EXPORT_SYMBOL(xor_niagara_2);
171EXPORT_SYMBOL(xor_niagara_3);
172EXPORT_SYMBOL(xor_niagara_4);
173EXPORT_SYMBOL(xor_niagara_5);
174#endif
diff --git a/arch/sparc/lib/locks.S b/arch/sparc/lib/locks.S
index 64f53f2b673d..f38c4e59d078 100644
--- a/arch/sparc/lib/locks.S
+++ b/arch/sparc/lib/locks.S
@@ -10,6 +10,7 @@
10#include <asm/psr.h> 10#include <asm/psr.h>
11#include <asm/smp.h> 11#include <asm/smp.h>
12#include <asm/spinlock.h> 12#include <asm/spinlock.h>
13#include <asm/export.h>
13 14
14 .text 15 .text
15 .align 4 16 .align 4
@@ -48,6 +49,7 @@ ___rw_write_enter_spin_on_wlock:
48 ld [%g1], %g2 49 ld [%g1], %g2
49 50
50 .globl ___rw_read_enter 51 .globl ___rw_read_enter
52EXPORT_SYMBOL(___rw_read_enter)
51___rw_read_enter: 53___rw_read_enter:
52 orcc %g2, 0x0, %g0 54 orcc %g2, 0x0, %g0
53 bne,a ___rw_read_enter_spin_on_wlock 55 bne,a ___rw_read_enter_spin_on_wlock
@@ -59,6 +61,7 @@ ___rw_read_enter:
59 mov %g4, %o7 61 mov %g4, %o7
60 62
61 .globl ___rw_read_exit 63 .globl ___rw_read_exit
64EXPORT_SYMBOL(___rw_read_exit)
62___rw_read_exit: 65___rw_read_exit:
63 orcc %g2, 0x0, %g0 66 orcc %g2, 0x0, %g0
64 bne,a ___rw_read_exit_spin_on_wlock 67 bne,a ___rw_read_exit_spin_on_wlock
@@ -70,6 +73,7 @@ ___rw_read_exit:
70 mov %g4, %o7 73 mov %g4, %o7
71 74
72 .globl ___rw_read_try 75 .globl ___rw_read_try
76EXPORT_SYMBOL(___rw_read_try)
73___rw_read_try: 77___rw_read_try:
74 orcc %g2, 0x0, %g0 78 orcc %g2, 0x0, %g0
75 bne ___rw_read_try_spin_on_wlock 79 bne ___rw_read_try_spin_on_wlock
@@ -81,6 +85,7 @@ ___rw_read_try:
81 mov %g4, %o7 85 mov %g4, %o7
82 86
83 .globl ___rw_write_enter 87 .globl ___rw_write_enter
88EXPORT_SYMBOL(___rw_write_enter)
84___rw_write_enter: 89___rw_write_enter:
85 orcc %g2, 0x0, %g0 90 orcc %g2, 0x0, %g0
86 bne ___rw_write_enter_spin_on_wlock 91 bne ___rw_write_enter_spin_on_wlock
diff --git a/arch/sparc/lib/lshrdi3.S b/arch/sparc/lib/lshrdi3.S
index 60ebc7cdbee0..c9b9373f8d81 100644
--- a/arch/sparc/lib/lshrdi3.S
+++ b/arch/sparc/lib/lshrdi3.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3ENTRY(__lshrdi3) 4ENTRY(__lshrdi3)
4 cmp %o2, 0 5 cmp %o2, 0
@@ -25,3 +26,4 @@ ENTRY(__lshrdi3)
25 retl 26 retl
26 nop 27 nop
27ENDPROC(__lshrdi3) 28ENDPROC(__lshrdi3)
29EXPORT_SYMBOL(__lshrdi3)
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S
index 0b0ed4d34219..194f383611c0 100644
--- a/arch/sparc/lib/mcount.S
+++ b/arch/sparc/lib/mcount.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/export.h>
9 10
10/* 11/*
11 * This is the main variant and is called by C code. GCC's -pg option 12 * This is the main variant and is called by C code. GCC's -pg option
@@ -16,6 +17,7 @@
16 .align 32 17 .align 32
17 .globl _mcount 18 .globl _mcount
18 .type _mcount,#function 19 .type _mcount,#function
20 EXPORT_SYMBOL(_mcount)
19 .globl mcount 21 .globl mcount
20 .type mcount,#function 22 .type mcount,#function
21_mcount: 23_mcount:
diff --git a/arch/sparc/lib/memcmp.S b/arch/sparc/lib/memcmp.S
index efa106c41ed0..cee7f30dbb61 100644
--- a/arch/sparc/lib/memcmp.S
+++ b/arch/sparc/lib/memcmp.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/asm.h> 8#include <asm/asm.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(memcmp) 12ENTRY(memcmp)
@@ -25,3 +26,4 @@ ENTRY(memcmp)
252: retl 262: retl
26 mov 0, %o0 27 mov 0, %o0
27ENDPROC(memcmp) 28ENDPROC(memcmp)
29EXPORT_SYMBOL(memcmp)
diff --git a/arch/sparc/lib/memcpy.S b/arch/sparc/lib/memcpy.S
index 4d8c497517bd..8913feaa7ac7 100644
--- a/arch/sparc/lib/memcpy.S
+++ b/arch/sparc/lib/memcpy.S
@@ -7,6 +7,7 @@
7 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 7 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
8 */ 8 */
9 9
10#include <asm/export.h>
10#define FUNC(x) \ 11#define FUNC(x) \
11 .globl x; \ 12 .globl x; \
12 .type x,@function; \ 13 .type x,@function; \
@@ -58,93 +59,11 @@ x:
58 stb %t0, [%dst - (offset) - 0x02]; \ 59 stb %t0, [%dst - (offset) - 0x02]; \
59 stb %t1, [%dst - (offset) - 0x01]; 60 stb %t1, [%dst - (offset) - 0x01];
60 61
61/* Both these macros have to start with exactly the same insn */
62#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
63 ldd [%src - (offset) - 0x20], %t0; \
64 ldd [%src - (offset) - 0x18], %t2; \
65 ldd [%src - (offset) - 0x10], %t4; \
66 ldd [%src - (offset) - 0x08], %t6; \
67 st %t0, [%dst - (offset) - 0x20]; \
68 st %t1, [%dst - (offset) - 0x1c]; \
69 st %t2, [%dst - (offset) - 0x18]; \
70 st %t3, [%dst - (offset) - 0x14]; \
71 st %t4, [%dst - (offset) - 0x10]; \
72 st %t5, [%dst - (offset) - 0x0c]; \
73 st %t6, [%dst - (offset) - 0x08]; \
74 st %t7, [%dst - (offset) - 0x04];
75
76#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
77 ldd [%src - (offset) - 0x20], %t0; \
78 ldd [%src - (offset) - 0x18], %t2; \
79 ldd [%src - (offset) - 0x10], %t4; \
80 ldd [%src - (offset) - 0x08], %t6; \
81 std %t0, [%dst - (offset) - 0x20]; \
82 std %t2, [%dst - (offset) - 0x18]; \
83 std %t4, [%dst - (offset) - 0x10]; \
84 std %t6, [%dst - (offset) - 0x08];
85
86#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
87 ldd [%src + (offset) + 0x00], %t0; \
88 ldd [%src + (offset) + 0x08], %t2; \
89 st %t0, [%dst + (offset) + 0x00]; \
90 st %t1, [%dst + (offset) + 0x04]; \
91 st %t2, [%dst + (offset) + 0x08]; \
92 st %t3, [%dst + (offset) + 0x0c];
93
94#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
95 ldub [%src + (offset) + 0x00], %t0; \
96 ldub [%src + (offset) + 0x01], %t1; \
97 stb %t0, [%dst + (offset) + 0x00]; \
98 stb %t1, [%dst + (offset) + 0x01];
99
100#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
101 ldd [%src + (offset) + 0x00], %t0; \
102 ldd [%src + (offset) + 0x08], %t2; \
103 srl %t0, shir, %t5; \
104 srl %t1, shir, %t6; \
105 sll %t0, shil, %t0; \
106 or %t5, %prev, %t5; \
107 sll %t1, shil, %prev; \
108 or %t6, %t0, %t0; \
109 srl %t2, shir, %t1; \
110 srl %t3, shir, %t6; \
111 sll %t2, shil, %t2; \
112 or %t1, %prev, %t1; \
113 std %t4, [%dst + (offset) + (offset2) - 0x04]; \
114 std %t0, [%dst + (offset) + (offset2) + 0x04]; \
115 sll %t3, shil, %prev; \
116 or %t6, %t2, %t4;
117
118#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
119 ldd [%src + (offset) + 0x00], %t0; \
120 ldd [%src + (offset) + 0x08], %t2; \
121 srl %t0, shir, %t4; \
122 srl %t1, shir, %t5; \
123 sll %t0, shil, %t6; \
124 or %t4, %prev, %t0; \
125 sll %t1, shil, %prev; \
126 or %t5, %t6, %t1; \
127 srl %t2, shir, %t4; \
128 srl %t3, shir, %t5; \
129 sll %t2, shil, %t6; \
130 or %t4, %prev, %t2; \
131 sll %t3, shil, %prev; \
132 or %t5, %t6, %t3; \
133 std %t0, [%dst + (offset) + (offset2) + 0x00]; \
134 std %t2, [%dst + (offset) + (offset2) + 0x08];
135
136 .text 62 .text
137 .align 4 63 .align 4
138 64
1390:
140 retl
141 nop ! Only bcopy returns here and it retuns void...
142
143#ifdef __KERNEL__
144FUNC(amemmove)
145FUNC(__memmove)
146#endif
147FUNC(memmove) 65FUNC(memmove)
66EXPORT_SYMBOL(memmove)
148 cmp %o0, %o1 67 cmp %o0, %o1
149 mov %o0, %g7 68 mov %o0, %g7
150 bleu 9f 69 bleu 9f
@@ -202,6 +121,7 @@ FUNC(memmove)
202 add %o0, 2, %o0 121 add %o0, 2, %o0
203 122
204FUNC(memcpy) /* %o0=dst %o1=src %o2=len */ 123FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
124EXPORT_SYMBOL(memcpy)
205 125
206 sub %o0, %o1, %o4 126 sub %o0, %o1, %o4
207 mov %o0, %g7 127 mov %o0, %g7
diff --git a/arch/sparc/lib/memmove.S b/arch/sparc/lib/memmove.S
index 857ad4f8905f..012cdb6ca467 100644
--- a/arch/sparc/lib/memmove.S
+++ b/arch/sparc/lib/memmove.S
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/export.h>
8 9
9 .text 10 .text
10ENTRY(memmove) /* o0=dst o1=src o2=len */ 11ENTRY(memmove) /* o0=dst o1=src o2=len */
@@ -57,3 +58,4 @@ ENTRY(memmove) /* o0=dst o1=src o2=len */
57 stb %g7, [%o0 - 0x1] 58 stb %g7, [%o0 - 0x1]
58 ba,a,pt %xcc, 99b 59 ba,a,pt %xcc, 99b
59ENDPROC(memmove) 60ENDPROC(memmove)
61EXPORT_SYMBOL(memmove)
diff --git a/arch/sparc/lib/memscan_32.S b/arch/sparc/lib/memscan_32.S
index 4ff1657dfc24..51ce690c42a8 100644
--- a/arch/sparc/lib/memscan_32.S
+++ b/arch/sparc/lib/memscan_32.S
@@ -4,6 +4,8 @@
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <asm/export.h>
8
7/* In essence, this is just a fancy strlen. */ 9/* In essence, this is just a fancy strlen. */
8 10
9#define LO_MAGIC 0x01010101 11#define LO_MAGIC 0x01010101
@@ -13,6 +15,8 @@
13 .align 4 15 .align 4
14 .globl __memscan_zero, __memscan_generic 16 .globl __memscan_zero, __memscan_generic
15 .globl memscan 17 .globl memscan
18EXPORT_SYMBOL(__memscan_zero)
19EXPORT_SYMBOL(__memscan_generic)
16__memscan_zero: 20__memscan_zero:
17 /* %o0 = addr, %o1 = size */ 21 /* %o0 = addr, %o1 = size */
18 cmp %o1, 0 22 cmp %o1, 0
diff --git a/arch/sparc/lib/memscan_64.S b/arch/sparc/lib/memscan_64.S
index 5686dfa5dc15..daa96f4b03e6 100644
--- a/arch/sparc/lib/memscan_64.S
+++ b/arch/sparc/lib/memscan_64.S
@@ -5,6 +5,8 @@
5 * Copyright (C) 1998 David S. Miller (davem@redhat.com) 5 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
6 */ 6 */
7 7
8 #include <asm/export.h>
9
8#define HI_MAGIC 0x8080808080808080 10#define HI_MAGIC 0x8080808080808080
9#define LO_MAGIC 0x0101010101010101 11#define LO_MAGIC 0x0101010101010101
10#define ASI_PL 0x88 12#define ASI_PL 0x88
@@ -13,6 +15,8 @@
13 .align 32 15 .align 32
14 .globl __memscan_zero, __memscan_generic 16 .globl __memscan_zero, __memscan_generic
15 .globl memscan 17 .globl memscan
18 EXPORT_SYMBOL(__memscan_zero)
19 EXPORT_SYMBOL(__memscan_generic)
16 20
17__memscan_zero: 21__memscan_zero:
18 /* %o0 = bufp, %o1 = size */ 22 /* %o0 = bufp, %o1 = size */
diff --git a/arch/sparc/lib/memset.S b/arch/sparc/lib/memset.S
index f75e6906df14..bb539b42b088 100644
--- a/arch/sparc/lib/memset.S
+++ b/arch/sparc/lib/memset.S
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <asm/ptrace.h> 11#include <asm/ptrace.h>
12#include <asm/export.h>
12 13
13/* Work around cpp -rob */ 14/* Work around cpp -rob */
14#define ALLOC #alloc 15#define ALLOC #alloc
@@ -63,6 +64,8 @@ __bzero_begin:
63 64
64 .globl __bzero 65 .globl __bzero
65 .globl memset 66 .globl memset
67 EXPORT_SYMBOL(__bzero)
68 EXPORT_SYMBOL(memset)
66 .globl __memset_start, __memset_end 69 .globl __memset_start, __memset_end
67__memset_start: 70__memset_start:
68memset: 71memset:
diff --git a/arch/sparc/lib/muldi3.S b/arch/sparc/lib/muldi3.S
index 9794939d1c12..17a0f49aef3c 100644
--- a/arch/sparc/lib/muldi3.S
+++ b/arch/sparc/lib/muldi3.S
@@ -17,6 +17,7 @@ along with GNU CC; see the file COPYING. If not, write to
17the Free Software Foundation, 59 Temple Place - Suite 330, 17the Free Software Foundation, 59 Temple Place - Suite 330,
18Boston, MA 02111-1307, USA. */ 18Boston, MA 02111-1307, USA. */
19 19
20#include <asm/export.h>
20 .text 21 .text
21 .align 4 22 .align 4
22 .globl __muldi3 23 .globl __muldi3
@@ -74,3 +75,4 @@ __muldi3:
74 add %l2, %l0, %i0 75 add %l2, %l0, %i0
75 ret 76 ret
76 restore %g0, %l3, %o1 77 restore %g0, %l3, %o1
78EXPORT_SYMBOL(__muldi3)
diff --git a/arch/sparc/lib/strlen.S b/arch/sparc/lib/strlen.S
index 536f83507fbf..ca0e7077e871 100644
--- a/arch/sparc/lib/strlen.S
+++ b/arch/sparc/lib/strlen.S
@@ -7,6 +7,7 @@
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/asm.h> 9#include <asm/asm.h>
10#include <asm/export.h>
10 11
11#define LO_MAGIC 0x01010101 12#define LO_MAGIC 0x01010101
12#define HI_MAGIC 0x80808080 13#define HI_MAGIC 0x80808080
@@ -78,3 +79,4 @@ ENTRY(strlen)
78 retl 79 retl
79 mov 2, %o0 80 mov 2, %o0
80ENDPROC(strlen) 81ENDPROC(strlen)
82EXPORT_SYMBOL(strlen)
diff --git a/arch/sparc/lib/strncmp_32.S b/arch/sparc/lib/strncmp_32.S
index c0d1b568c1c5..e3fe014813af 100644
--- a/arch/sparc/lib/strncmp_32.S
+++ b/arch/sparc/lib/strncmp_32.S
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/export.h>
7 8
8 .text 9 .text
9ENTRY(strncmp) 10ENTRY(strncmp)
@@ -116,3 +117,4 @@ ENTRY(strncmp)
116 retl 117 retl
117 sub %o3, %o0, %o0 118 sub %o3, %o0, %o0
118ENDPROC(strncmp) 119ENDPROC(strncmp)
120EXPORT_SYMBOL(strncmp)
diff --git a/arch/sparc/lib/strncmp_64.S b/arch/sparc/lib/strncmp_64.S
index 0656627166f3..efb5f884330d 100644
--- a/arch/sparc/lib/strncmp_64.S
+++ b/arch/sparc/lib/strncmp_64.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/asi.h> 8#include <asm/asi.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(strncmp) 12ENTRY(strncmp)
@@ -28,3 +29,4 @@ ENTRY(strncmp)
28 retl 29 retl
29 clr %o0 30 clr %o0
30ENDPROC(strncmp) 31ENDPROC(strncmp)
32EXPORT_SYMBOL(strncmp)
diff --git a/arch/sparc/lib/xor.S b/arch/sparc/lib/xor.S
index 2c05641c3263..45a49cb618b5 100644
--- a/arch/sparc/lib/xor.S
+++ b/arch/sparc/lib/xor.S
@@ -13,6 +13,7 @@
13#include <asm/asi.h> 13#include <asm/asi.h>
14#include <asm/dcu.h> 14#include <asm/dcu.h>
15#include <asm/spitfire.h> 15#include <asm/spitfire.h>
16#include <asm/export.h>
16 17
17/* 18/*
18 * Requirements: 19 * Requirements:
@@ -90,6 +91,7 @@ ENTRY(xor_vis_2)
90 retl 91 retl
91 wr %g0, 0, %fprs 92 wr %g0, 0, %fprs
92ENDPROC(xor_vis_2) 93ENDPROC(xor_vis_2)
94EXPORT_SYMBOL(xor_vis_2)
93 95
94ENTRY(xor_vis_3) 96ENTRY(xor_vis_3)
95 rd %fprs, %o5 97 rd %fprs, %o5
@@ -156,6 +158,7 @@ ENTRY(xor_vis_3)
156 retl 158 retl
157 wr %g0, 0, %fprs 159 wr %g0, 0, %fprs
158ENDPROC(xor_vis_3) 160ENDPROC(xor_vis_3)
161EXPORT_SYMBOL(xor_vis_3)
159 162
160ENTRY(xor_vis_4) 163ENTRY(xor_vis_4)
161 rd %fprs, %o5 164 rd %fprs, %o5
@@ -241,6 +244,7 @@ ENTRY(xor_vis_4)
241 retl 244 retl
242 wr %g0, 0, %fprs 245 wr %g0, 0, %fprs
243ENDPROC(xor_vis_4) 246ENDPROC(xor_vis_4)
247EXPORT_SYMBOL(xor_vis_4)
244 248
245ENTRY(xor_vis_5) 249ENTRY(xor_vis_5)
246 save %sp, -192, %sp 250 save %sp, -192, %sp
@@ -347,6 +351,7 @@ ENTRY(xor_vis_5)
347 ret 351 ret
348 restore 352 restore
349ENDPROC(xor_vis_5) 353ENDPROC(xor_vis_5)
354EXPORT_SYMBOL(xor_vis_5)
350 355
351 /* Niagara versions. */ 356 /* Niagara versions. */
352ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */ 357ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
@@ -393,6 +398,7 @@ ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
393 ret 398 ret
394 restore 399 restore
395ENDPROC(xor_niagara_2) 400ENDPROC(xor_niagara_2)
401EXPORT_SYMBOL(xor_niagara_2)
396 402
397ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */ 403ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
398 save %sp, -192, %sp 404 save %sp, -192, %sp
@@ -454,6 +460,7 @@ ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
454 ret 460 ret
455 restore 461 restore
456ENDPROC(xor_niagara_3) 462ENDPROC(xor_niagara_3)
463EXPORT_SYMBOL(xor_niagara_3)
457 464
458ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */ 465ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
459 save %sp, -192, %sp 466 save %sp, -192, %sp
@@ -536,6 +543,7 @@ ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
536 ret 543 ret
537 restore 544 restore
538ENDPROC(xor_niagara_4) 545ENDPROC(xor_niagara_4)
546EXPORT_SYMBOL(xor_niagara_4)
539 547
540ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */ 548ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */
541 save %sp, -192, %sp 549 save %sp, -192, %sp
@@ -634,3 +642,4 @@ ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=s
634 ret 642 ret
635 restore 643 restore
636ENDPROC(xor_niagara_5) 644ENDPROC(xor_niagara_5)
645EXPORT_SYMBOL(xor_niagara_5)
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index b75a8bcd2d23..21b352a11b49 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -44,6 +44,7 @@
44#include <asm/alternative-asm.h> 44#include <asm/alternative-asm.h>
45#include <asm/asm.h> 45#include <asm/asm.h>
46#include <asm/smap.h> 46#include <asm/smap.h>
47#include <asm/export.h>
47 48
48 .section .entry.text, "ax" 49 .section .entry.text, "ax"
49 50
@@ -991,6 +992,7 @@ trace:
991 jmp ftrace_stub 992 jmp ftrace_stub
992END(mcount) 993END(mcount)
993#endif /* CONFIG_DYNAMIC_FTRACE */ 994#endif /* CONFIG_DYNAMIC_FTRACE */
995EXPORT_SYMBOL(mcount)
994#endif /* CONFIG_FUNCTION_TRACER */ 996#endif /* CONFIG_FUNCTION_TRACER */
995 997
996#ifdef CONFIG_FUNCTION_GRAPH_TRACER 998#ifdef CONFIG_FUNCTION_GRAPH_TRACER
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index c98ec2efd750..ef766a358b37 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -35,6 +35,7 @@
35#include <asm/asm.h> 35#include <asm/asm.h>
36#include <asm/smap.h> 36#include <asm/smap.h>
37#include <asm/pgtable_types.h> 37#include <asm/pgtable_types.h>
38#include <asm/export.h>
38#include <linux/err.h> 39#include <linux/err.h>
39 40
40/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ 41/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
@@ -875,6 +876,7 @@ ENTRY(native_load_gs_index)
875 popfq 876 popfq
876 ret 877 ret
877END(native_load_gs_index) 878END(native_load_gs_index)
879EXPORT_SYMBOL(native_load_gs_index)
878 880
879 _ASM_EXTABLE(.Lgs_change, bad_gs) 881 _ASM_EXTABLE(.Lgs_change, bad_gs)
880 .section .fixup, "ax" 882 .section .fixup, "ax"
diff --git a/arch/x86/entry/thunk_32.S b/arch/x86/entry/thunk_32.S
index e5a17114a8c4..fee6bc79b987 100644
--- a/arch/x86/entry/thunk_32.S
+++ b/arch/x86/entry/thunk_32.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 #include <linux/linkage.h> 7 #include <linux/linkage.h>
8 #include <asm/asm.h> 8 #include <asm/asm.h>
9 #include <asm/export.h>
9 10
10 /* put return address in eax (arg1) */ 11 /* put return address in eax (arg1) */
11 .macro THUNK name, func, put_ret_addr_in_eax=0 12 .macro THUNK name, func, put_ret_addr_in_eax=0
@@ -36,5 +37,7 @@
36#ifdef CONFIG_PREEMPT 37#ifdef CONFIG_PREEMPT
37 THUNK ___preempt_schedule, preempt_schedule 38 THUNK ___preempt_schedule, preempt_schedule
38 THUNK ___preempt_schedule_notrace, preempt_schedule_notrace 39 THUNK ___preempt_schedule_notrace, preempt_schedule_notrace
40 EXPORT_SYMBOL(___preempt_schedule)
41 EXPORT_SYMBOL(___preempt_schedule_notrace)
39#endif 42#endif
40 43
diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S
index 627ecbcb2e62..be36bf4e0957 100644
--- a/arch/x86/entry/thunk_64.S
+++ b/arch/x86/entry/thunk_64.S
@@ -8,6 +8,7 @@
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include "calling.h" 9#include "calling.h"
10#include <asm/asm.h> 10#include <asm/asm.h>
11#include <asm/export.h>
11 12
12 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */ 13 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
13 .macro THUNK name, func, put_ret_addr_in_rdi=0 14 .macro THUNK name, func, put_ret_addr_in_rdi=0
@@ -49,6 +50,8 @@
49#ifdef CONFIG_PREEMPT 50#ifdef CONFIG_PREEMPT
50 THUNK ___preempt_schedule, preempt_schedule 51 THUNK ___preempt_schedule, preempt_schedule
51 THUNK ___preempt_schedule_notrace, preempt_schedule_notrace 52 THUNK ___preempt_schedule_notrace, preempt_schedule_notrace
53 EXPORT_SYMBOL(___preempt_schedule)
54 EXPORT_SYMBOL(___preempt_schedule_notrace)
52#endif 55#endif
53 56
54#if defined(CONFIG_TRACE_IRQFLAGS) \ 57#if defined(CONFIG_TRACE_IRQFLAGS) \
diff --git a/arch/x86/include/asm/export.h b/arch/x86/include/asm/export.h
new file mode 100644
index 000000000000..138de56b13eb
--- /dev/null
+++ b/arch/x86/include/asm/export.h
@@ -0,0 +1,4 @@
1#ifdef CONFIG_64BIT
2#define KSYM_ALIGN 16
3#endif
4#include <asm-generic/export.h>
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 4dd5d500eb60..79076d75bdbf 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -46,9 +46,7 @@ obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o
46obj-y += setup.o x86_init.o i8259.o irqinit.o jump_label.o 46obj-y += setup.o x86_init.o i8259.o irqinit.o jump_label.o
47obj-$(CONFIG_IRQ_WORK) += irq_work.o 47obj-$(CONFIG_IRQ_WORK) += irq_work.o
48obj-y += probe_roms.o 48obj-y += probe_roms.o
49obj-$(CONFIG_X86_32) += i386_ksyms_32.o 49obj-$(CONFIG_X86_64) += sys_x86_64.o mcount_64.o
50obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
51obj-$(CONFIG_X86_64) += mcount_64.o
52obj-$(CONFIG_X86_ESPFIX64) += espfix_64.o 50obj-$(CONFIG_X86_ESPFIX64) += espfix_64.o
53obj-$(CONFIG_SYSFS) += ksysfs.o 51obj-$(CONFIG_SYSFS) += ksysfs.o
54obj-y += bootflag.o e820.o 52obj-y += bootflag.o e820.o
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 5f401262f12d..b6b2f0264af3 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -23,6 +23,7 @@
23#include <asm/percpu.h> 23#include <asm/percpu.h>
24#include <asm/nops.h> 24#include <asm/nops.h>
25#include <asm/bootparam.h> 25#include <asm/bootparam.h>
26#include <asm/export.h>
26 27
27/* Physical address */ 28/* Physical address */
28#define pa(X) ((X) - __PAGE_OFFSET) 29#define pa(X) ((X) - __PAGE_OFFSET)
@@ -673,6 +674,7 @@ ENTRY(empty_zero_page)
673 .fill 4096,1,0 674 .fill 4096,1,0
674ENTRY(swapper_pg_dir) 675ENTRY(swapper_pg_dir)
675 .fill 1024,4,0 676 .fill 1024,4,0
677EXPORT_SYMBOL(empty_zero_page)
676 678
677/* 679/*
678 * This starts the data section. 680 * This starts the data section.
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index c98a559c346e..b4421cc191b0 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -21,6 +21,7 @@
21#include <asm/percpu.h> 21#include <asm/percpu.h>
22#include <asm/nops.h> 22#include <asm/nops.h>
23#include "../entry/calling.h" 23#include "../entry/calling.h"
24#include <asm/export.h>
24 25
25#ifdef CONFIG_PARAVIRT 26#ifdef CONFIG_PARAVIRT
26#include <asm/asm-offsets.h> 27#include <asm/asm-offsets.h>
@@ -486,10 +487,12 @@ early_gdt_descr_base:
486ENTRY(phys_base) 487ENTRY(phys_base)
487 /* This must match the first entry in level2_kernel_pgt */ 488 /* This must match the first entry in level2_kernel_pgt */
488 .quad 0x0000000000000000 489 .quad 0x0000000000000000
490EXPORT_SYMBOL(phys_base)
489 491
490#include "../../x86/xen/xen-head.S" 492#include "../../x86/xen/xen-head.S"
491 493
492 __PAGE_ALIGNED_BSS 494 __PAGE_ALIGNED_BSS
493NEXT_PAGE(empty_zero_page) 495NEXT_PAGE(empty_zero_page)
494 .skip PAGE_SIZE 496 .skip PAGE_SIZE
497EXPORT_SYMBOL(empty_zero_page)
495 498
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
deleted file mode 100644
index 1f9b878ef5ef..000000000000
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ /dev/null
@@ -1,47 +0,0 @@
1#include <linux/export.h>
2#include <linux/spinlock_types.h>
3
4#include <asm/checksum.h>
5#include <asm/pgtable.h>
6#include <asm/desc.h>
7#include <asm/ftrace.h>
8
9#ifdef CONFIG_FUNCTION_TRACER
10/* mcount is defined in assembly */
11EXPORT_SYMBOL(mcount);
12#endif
13
14/*
15 * Note, this is a prototype to get at the symbol for
16 * the export, but dont use it from C code, it is used
17 * by assembly code and is not using C calling convention!
18 */
19#ifndef CONFIG_X86_CMPXCHG64
20extern void cmpxchg8b_emu(void);
21EXPORT_SYMBOL(cmpxchg8b_emu);
22#endif
23
24/* Networking helper routines. */
25EXPORT_SYMBOL(csum_partial_copy_generic);
26
27EXPORT_SYMBOL(__get_user_1);
28EXPORT_SYMBOL(__get_user_2);
29EXPORT_SYMBOL(__get_user_4);
30EXPORT_SYMBOL(__get_user_8);
31
32EXPORT_SYMBOL(__put_user_1);
33EXPORT_SYMBOL(__put_user_2);
34EXPORT_SYMBOL(__put_user_4);
35EXPORT_SYMBOL(__put_user_8);
36
37EXPORT_SYMBOL(strstr);
38
39EXPORT_SYMBOL(csum_partial);
40EXPORT_SYMBOL(empty_zero_page);
41
42#ifdef CONFIG_PREEMPT
43EXPORT_SYMBOL(___preempt_schedule);
44EXPORT_SYMBOL(___preempt_schedule_notrace);
45#endif
46
47EXPORT_SYMBOL(__sw_hweight32);
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
index 61924222a9e1..efe73aacf966 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -7,6 +7,7 @@
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <asm/ftrace.h> 9#include <asm/ftrace.h>
10#include <asm/export.h>
10 11
11 12
12 .code64 13 .code64
@@ -294,6 +295,7 @@ trace:
294 jmp fgraph_trace 295 jmp fgraph_trace
295END(function_hook) 296END(function_hook)
296#endif /* CONFIG_DYNAMIC_FTRACE */ 297#endif /* CONFIG_DYNAMIC_FTRACE */
298EXPORT_SYMBOL(function_hook)
297#endif /* CONFIG_FUNCTION_TRACER */ 299#endif /* CONFIG_FUNCTION_TRACER */
298 300
299#ifdef CONFIG_FUNCTION_GRAPH_TRACER 301#ifdef CONFIG_FUNCTION_GRAPH_TRACER
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
deleted file mode 100644
index b2cee3d19477..000000000000
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/* Exports for assembly files.
2 All C exports should go in the respective C files. */
3
4#include <linux/export.h>
5#include <linux/spinlock_types.h>
6#include <linux/smp.h>
7
8#include <net/checksum.h>
9
10#include <asm/processor.h>
11#include <asm/pgtable.h>
12#include <asm/uaccess.h>
13#include <asm/desc.h>
14#include <asm/ftrace.h>
15
16#ifdef CONFIG_FUNCTION_TRACER
17/* mcount and __fentry__ are defined in assembly */
18#ifdef CC_USING_FENTRY
19EXPORT_SYMBOL(__fentry__);
20#else
21EXPORT_SYMBOL(mcount);
22#endif
23#endif
24
25EXPORT_SYMBOL(__get_user_1);
26EXPORT_SYMBOL(__get_user_2);
27EXPORT_SYMBOL(__get_user_4);
28EXPORT_SYMBOL(__get_user_8);
29EXPORT_SYMBOL(__put_user_1);
30EXPORT_SYMBOL(__put_user_2);
31EXPORT_SYMBOL(__put_user_4);
32EXPORT_SYMBOL(__put_user_8);
33
34EXPORT_SYMBOL(copy_user_generic_string);
35EXPORT_SYMBOL(copy_user_generic_unrolled);
36EXPORT_SYMBOL(copy_user_enhanced_fast_string);
37EXPORT_SYMBOL(__copy_user_nocache);
38EXPORT_SYMBOL(_copy_from_user);
39EXPORT_SYMBOL(_copy_to_user);
40
41EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled);
42
43EXPORT_SYMBOL(copy_page);
44EXPORT_SYMBOL(clear_page);
45
46EXPORT_SYMBOL(csum_partial);
47
48EXPORT_SYMBOL(__sw_hweight32);
49EXPORT_SYMBOL(__sw_hweight64);
50
51/*
52 * Export string functions. We normally rely on gcc builtin for most of these,
53 * but gcc sometimes decides not to inline them.
54 */
55#undef memcpy
56#undef memset
57#undef memmove
58
59extern void *__memset(void *, int, __kernel_size_t);
60extern void *__memcpy(void *, const void *, __kernel_size_t);
61extern void *__memmove(void *, const void *, __kernel_size_t);
62extern void *memset(void *, int, __kernel_size_t);
63extern void *memcpy(void *, const void *, __kernel_size_t);
64extern void *memmove(void *, const void *, __kernel_size_t);
65
66EXPORT_SYMBOL(__memset);
67EXPORT_SYMBOL(__memcpy);
68EXPORT_SYMBOL(__memmove);
69
70EXPORT_SYMBOL(memset);
71EXPORT_SYMBOL(memcpy);
72EXPORT_SYMBOL(memmove);
73
74#ifndef CONFIG_DEBUG_VIRTUAL
75EXPORT_SYMBOL(phys_base);
76#endif
77EXPORT_SYMBOL(empty_zero_page);
78#ifndef CONFIG_PARAVIRT
79EXPORT_SYMBOL(native_load_gs_index);
80#endif
81
82#ifdef CONFIG_PREEMPT
83EXPORT_SYMBOL(___preempt_schedule);
84EXPORT_SYMBOL(___preempt_schedule_notrace);
85#endif
diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S
index c1e623209853..4d34bb548b41 100644
--- a/arch/x86/lib/checksum_32.S
+++ b/arch/x86/lib/checksum_32.S
@@ -28,6 +28,7 @@
28#include <linux/linkage.h> 28#include <linux/linkage.h>
29#include <asm/errno.h> 29#include <asm/errno.h>
30#include <asm/asm.h> 30#include <asm/asm.h>
31#include <asm/export.h>
31 32
32/* 33/*
33 * computes a partial checksum, e.g. for TCP/UDP fragments 34 * computes a partial checksum, e.g. for TCP/UDP fragments
@@ -251,6 +252,7 @@ ENTRY(csum_partial)
251ENDPROC(csum_partial) 252ENDPROC(csum_partial)
252 253
253#endif 254#endif
255EXPORT_SYMBOL(csum_partial)
254 256
255/* 257/*
256unsigned int csum_partial_copy_generic (const char *src, char *dst, 258unsigned int csum_partial_copy_generic (const char *src, char *dst,
@@ -490,3 +492,4 @@ ENDPROC(csum_partial_copy_generic)
490#undef ROUND1 492#undef ROUND1
491 493
492#endif 494#endif
495EXPORT_SYMBOL(csum_partial_copy_generic)
diff --git a/arch/x86/lib/clear_page_64.S b/arch/x86/lib/clear_page_64.S
index 65be7cfaf947..5e2af3a88cf5 100644
--- a/arch/x86/lib/clear_page_64.S
+++ b/arch/x86/lib/clear_page_64.S
@@ -1,6 +1,7 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/cpufeatures.h> 2#include <asm/cpufeatures.h>
3#include <asm/alternative-asm.h> 3#include <asm/alternative-asm.h>
4#include <asm/export.h>
4 5
5/* 6/*
6 * Most CPUs support enhanced REP MOVSB/STOSB instructions. It is 7 * Most CPUs support enhanced REP MOVSB/STOSB instructions. It is
@@ -23,6 +24,7 @@ ENTRY(clear_page)
23 rep stosq 24 rep stosq
24 ret 25 ret
25ENDPROC(clear_page) 26ENDPROC(clear_page)
27EXPORT_SYMBOL(clear_page)
26 28
27ENTRY(clear_page_orig) 29ENTRY(clear_page_orig)
28 30
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
index ad5349778490..03a186fc06ea 100644
--- a/arch/x86/lib/cmpxchg8b_emu.S
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/export.h>
10 11
11.text 12.text
12 13
@@ -48,3 +49,4 @@ ENTRY(cmpxchg8b_emu)
48 ret 49 ret
49 50
50ENDPROC(cmpxchg8b_emu) 51ENDPROC(cmpxchg8b_emu)
52EXPORT_SYMBOL(cmpxchg8b_emu)
diff --git a/arch/x86/lib/copy_page_64.S b/arch/x86/lib/copy_page_64.S
index 24ef1c2104d4..e8508156c99d 100644
--- a/arch/x86/lib/copy_page_64.S
+++ b/arch/x86/lib/copy_page_64.S
@@ -3,6 +3,7 @@
3#include <linux/linkage.h> 3#include <linux/linkage.h>
4#include <asm/cpufeatures.h> 4#include <asm/cpufeatures.h>
5#include <asm/alternative-asm.h> 5#include <asm/alternative-asm.h>
6#include <asm/export.h>
6 7
7/* 8/*
8 * Some CPUs run faster using the string copy instructions (sane microcode). 9 * Some CPUs run faster using the string copy instructions (sane microcode).
@@ -17,6 +18,7 @@ ENTRY(copy_page)
17 rep movsq 18 rep movsq
18 ret 19 ret
19ENDPROC(copy_page) 20ENDPROC(copy_page)
21EXPORT_SYMBOL(copy_page)
20 22
21ENTRY(copy_page_regs) 23ENTRY(copy_page_regs)
22 subq $2*8, %rsp 24 subq $2*8, %rsp
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index bf603ebbfd8e..d376e4b48f88 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -14,6 +14,7 @@
14#include <asm/alternative-asm.h> 14#include <asm/alternative-asm.h>
15#include <asm/asm.h> 15#include <asm/asm.h>
16#include <asm/smap.h> 16#include <asm/smap.h>
17#include <asm/export.h>
17 18
18/* Standard copy_to_user with segment limit checking */ 19/* Standard copy_to_user with segment limit checking */
19ENTRY(_copy_to_user) 20ENTRY(_copy_to_user)
@@ -29,6 +30,7 @@ ENTRY(_copy_to_user)
29 "jmp copy_user_enhanced_fast_string", \ 30 "jmp copy_user_enhanced_fast_string", \
30 X86_FEATURE_ERMS 31 X86_FEATURE_ERMS
31ENDPROC(_copy_to_user) 32ENDPROC(_copy_to_user)
33EXPORT_SYMBOL(_copy_to_user)
32 34
33/* Standard copy_from_user with segment limit checking */ 35/* Standard copy_from_user with segment limit checking */
34ENTRY(_copy_from_user) 36ENTRY(_copy_from_user)
@@ -44,6 +46,8 @@ ENTRY(_copy_from_user)
44 "jmp copy_user_enhanced_fast_string", \ 46 "jmp copy_user_enhanced_fast_string", \
45 X86_FEATURE_ERMS 47 X86_FEATURE_ERMS
46ENDPROC(_copy_from_user) 48ENDPROC(_copy_from_user)
49EXPORT_SYMBOL(_copy_from_user)
50
47 51
48 .section .fixup,"ax" 52 .section .fixup,"ax"
49 /* must zero dest */ 53 /* must zero dest */
@@ -155,6 +159,7 @@ ENTRY(copy_user_generic_unrolled)
155 _ASM_EXTABLE(21b,50b) 159 _ASM_EXTABLE(21b,50b)
156 _ASM_EXTABLE(22b,50b) 160 _ASM_EXTABLE(22b,50b)
157ENDPROC(copy_user_generic_unrolled) 161ENDPROC(copy_user_generic_unrolled)
162EXPORT_SYMBOL(copy_user_generic_unrolled)
158 163
159/* Some CPUs run faster using the string copy instructions. 164/* Some CPUs run faster using the string copy instructions.
160 * This is also a lot simpler. Use them when possible. 165 * This is also a lot simpler. Use them when possible.
@@ -200,6 +205,7 @@ ENTRY(copy_user_generic_string)
200 _ASM_EXTABLE(1b,11b) 205 _ASM_EXTABLE(1b,11b)
201 _ASM_EXTABLE(3b,12b) 206 _ASM_EXTABLE(3b,12b)
202ENDPROC(copy_user_generic_string) 207ENDPROC(copy_user_generic_string)
208EXPORT_SYMBOL(copy_user_generic_string)
203 209
204/* 210/*
205 * Some CPUs are adding enhanced REP MOVSB/STOSB instructions. 211 * Some CPUs are adding enhanced REP MOVSB/STOSB instructions.
@@ -229,6 +235,7 @@ ENTRY(copy_user_enhanced_fast_string)
229 235
230 _ASM_EXTABLE(1b,12b) 236 _ASM_EXTABLE(1b,12b)
231ENDPROC(copy_user_enhanced_fast_string) 237ENDPROC(copy_user_enhanced_fast_string)
238EXPORT_SYMBOL(copy_user_enhanced_fast_string)
232 239
233/* 240/*
234 * copy_user_nocache - Uncached memory copy with exception handling 241 * copy_user_nocache - Uncached memory copy with exception handling
@@ -379,3 +386,4 @@ ENTRY(__copy_user_nocache)
379 _ASM_EXTABLE(40b,.L_fixup_1b_copy) 386 _ASM_EXTABLE(40b,.L_fixup_1b_copy)
380 _ASM_EXTABLE(41b,.L_fixup_1b_copy) 387 _ASM_EXTABLE(41b,.L_fixup_1b_copy)
381ENDPROC(__copy_user_nocache) 388ENDPROC(__copy_user_nocache)
389EXPORT_SYMBOL(__copy_user_nocache)
diff --git a/arch/x86/lib/csum-partial_64.c b/arch/x86/lib/csum-partial_64.c
index 9a7fe6a70491..378e5d5bf9b1 100644
--- a/arch/x86/lib/csum-partial_64.c
+++ b/arch/x86/lib/csum-partial_64.c
@@ -135,6 +135,7 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
135 return (__force __wsum)add32_with_carry(do_csum(buff, len), 135 return (__force __wsum)add32_with_carry(do_csum(buff, len),
136 (__force u32)sum); 136 (__force u32)sum);
137} 137}
138EXPORT_SYMBOL(csum_partial);
138 139
139/* 140/*
140 * this routine is used for miscellaneous IP-like checksums, mainly 141 * this routine is used for miscellaneous IP-like checksums, mainly
diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S
index 0ef5128c2de8..37b62d412148 100644
--- a/arch/x86/lib/getuser.S
+++ b/arch/x86/lib/getuser.S
@@ -32,6 +32,7 @@
32#include <asm/thread_info.h> 32#include <asm/thread_info.h>
33#include <asm/asm.h> 33#include <asm/asm.h>
34#include <asm/smap.h> 34#include <asm/smap.h>
35#include <asm/export.h>
35 36
36 .text 37 .text
37ENTRY(__get_user_1) 38ENTRY(__get_user_1)
@@ -44,6 +45,7 @@ ENTRY(__get_user_1)
44 ASM_CLAC 45 ASM_CLAC
45 ret 46 ret
46ENDPROC(__get_user_1) 47ENDPROC(__get_user_1)
48EXPORT_SYMBOL(__get_user_1)
47 49
48ENTRY(__get_user_2) 50ENTRY(__get_user_2)
49 add $1,%_ASM_AX 51 add $1,%_ASM_AX
@@ -57,6 +59,7 @@ ENTRY(__get_user_2)
57 ASM_CLAC 59 ASM_CLAC
58 ret 60 ret
59ENDPROC(__get_user_2) 61ENDPROC(__get_user_2)
62EXPORT_SYMBOL(__get_user_2)
60 63
61ENTRY(__get_user_4) 64ENTRY(__get_user_4)
62 add $3,%_ASM_AX 65 add $3,%_ASM_AX
@@ -70,6 +73,7 @@ ENTRY(__get_user_4)
70 ASM_CLAC 73 ASM_CLAC
71 ret 74 ret
72ENDPROC(__get_user_4) 75ENDPROC(__get_user_4)
76EXPORT_SYMBOL(__get_user_4)
73 77
74ENTRY(__get_user_8) 78ENTRY(__get_user_8)
75#ifdef CONFIG_X86_64 79#ifdef CONFIG_X86_64
@@ -97,6 +101,7 @@ ENTRY(__get_user_8)
97 ret 101 ret
98#endif 102#endif
99ENDPROC(__get_user_8) 103ENDPROC(__get_user_8)
104EXPORT_SYMBOL(__get_user_8)
100 105
101 106
102bad_get_user: 107bad_get_user:
diff --git a/arch/x86/lib/hweight.S b/arch/x86/lib/hweight.S
index 8a602a1e404a..23d893cbc200 100644
--- a/arch/x86/lib/hweight.S
+++ b/arch/x86/lib/hweight.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3#include <asm/asm.h> 4#include <asm/asm.h>
4 5
@@ -32,6 +33,7 @@ ENTRY(__sw_hweight32)
32 __ASM_SIZE(pop,) %__ASM_REG(dx) 33 __ASM_SIZE(pop,) %__ASM_REG(dx)
33 ret 34 ret
34ENDPROC(__sw_hweight32) 35ENDPROC(__sw_hweight32)
36EXPORT_SYMBOL(__sw_hweight32)
35 37
36ENTRY(__sw_hweight64) 38ENTRY(__sw_hweight64)
37#ifdef CONFIG_X86_64 39#ifdef CONFIG_X86_64
@@ -77,3 +79,4 @@ ENTRY(__sw_hweight64)
77 ret 79 ret
78#endif 80#endif
79ENDPROC(__sw_hweight64) 81ENDPROC(__sw_hweight64)
82EXPORT_SYMBOL(__sw_hweight64)
diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
index 49e6ebac7e73..779782f58324 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -4,6 +4,7 @@
4#include <asm/errno.h> 4#include <asm/errno.h>
5#include <asm/cpufeatures.h> 5#include <asm/cpufeatures.h>
6#include <asm/alternative-asm.h> 6#include <asm/alternative-asm.h>
7#include <asm/export.h>
7 8
8/* 9/*
9 * We build a jump to memcpy_orig by default which gets NOPped out on 10 * We build a jump to memcpy_orig by default which gets NOPped out on
@@ -40,6 +41,8 @@ ENTRY(memcpy)
40 ret 41 ret
41ENDPROC(memcpy) 42ENDPROC(memcpy)
42ENDPROC(__memcpy) 43ENDPROC(__memcpy)
44EXPORT_SYMBOL(memcpy)
45EXPORT_SYMBOL(__memcpy)
43 46
44/* 47/*
45 * memcpy_erms() - enhanced fast string memcpy. This is faster and 48 * memcpy_erms() - enhanced fast string memcpy. This is faster and
@@ -274,6 +277,7 @@ ENTRY(memcpy_mcsafe_unrolled)
274 xorq %rax, %rax 277 xorq %rax, %rax
275 ret 278 ret
276ENDPROC(memcpy_mcsafe_unrolled) 279ENDPROC(memcpy_mcsafe_unrolled)
280EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled)
277 281
278 .section .fixup, "ax" 282 .section .fixup, "ax"
279 /* Return -EFAULT for any failure */ 283 /* Return -EFAULT for any failure */
diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
index 90ce01bee00c..15de86cd15b0 100644
--- a/arch/x86/lib/memmove_64.S
+++ b/arch/x86/lib/memmove_64.S
@@ -8,6 +8,7 @@
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/cpufeatures.h> 9#include <asm/cpufeatures.h>
10#include <asm/alternative-asm.h> 10#include <asm/alternative-asm.h>
11#include <asm/export.h>
11 12
12#undef memmove 13#undef memmove
13 14
@@ -207,3 +208,5 @@ ENTRY(__memmove)
207 retq 208 retq
208ENDPROC(__memmove) 209ENDPROC(__memmove)
209ENDPROC(memmove) 210ENDPROC(memmove)
211EXPORT_SYMBOL(__memmove)
212EXPORT_SYMBOL(memmove)
diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
index e1229ecd2a82..55b95db30a61 100644
--- a/arch/x86/lib/memset_64.S
+++ b/arch/x86/lib/memset_64.S
@@ -3,6 +3,7 @@
3#include <linux/linkage.h> 3#include <linux/linkage.h>
4#include <asm/cpufeatures.h> 4#include <asm/cpufeatures.h>
5#include <asm/alternative-asm.h> 5#include <asm/alternative-asm.h>
6#include <asm/export.h>
6 7
7.weak memset 8.weak memset
8 9
@@ -43,6 +44,8 @@ ENTRY(__memset)
43 ret 44 ret
44ENDPROC(memset) 45ENDPROC(memset)
45ENDPROC(__memset) 46ENDPROC(__memset)
47EXPORT_SYMBOL(memset)
48EXPORT_SYMBOL(__memset)
46 49
47/* 50/*
48 * ISO C memset - set a memory block to a byte value. This function uses 51 * ISO C memset - set a memory block to a byte value. This function uses
diff --git a/arch/x86/lib/putuser.S b/arch/x86/lib/putuser.S
index c891ece81e5b..cd5d716d2897 100644
--- a/arch/x86/lib/putuser.S
+++ b/arch/x86/lib/putuser.S
@@ -15,6 +15,7 @@
15#include <asm/errno.h> 15#include <asm/errno.h>
16#include <asm/asm.h> 16#include <asm/asm.h>
17#include <asm/smap.h> 17#include <asm/smap.h>
18#include <asm/export.h>
18 19
19 20
20/* 21/*
@@ -43,6 +44,7 @@ ENTRY(__put_user_1)
43 xor %eax,%eax 44 xor %eax,%eax
44 EXIT 45 EXIT
45ENDPROC(__put_user_1) 46ENDPROC(__put_user_1)
47EXPORT_SYMBOL(__put_user_1)
46 48
47ENTRY(__put_user_2) 49ENTRY(__put_user_2)
48 ENTER 50 ENTER
@@ -55,6 +57,7 @@ ENTRY(__put_user_2)
55 xor %eax,%eax 57 xor %eax,%eax
56 EXIT 58 EXIT
57ENDPROC(__put_user_2) 59ENDPROC(__put_user_2)
60EXPORT_SYMBOL(__put_user_2)
58 61
59ENTRY(__put_user_4) 62ENTRY(__put_user_4)
60 ENTER 63 ENTER
@@ -67,6 +70,7 @@ ENTRY(__put_user_4)
67 xor %eax,%eax 70 xor %eax,%eax
68 EXIT 71 EXIT
69ENDPROC(__put_user_4) 72ENDPROC(__put_user_4)
73EXPORT_SYMBOL(__put_user_4)
70 74
71ENTRY(__put_user_8) 75ENTRY(__put_user_8)
72 ENTER 76 ENTER
@@ -82,6 +86,7 @@ ENTRY(__put_user_8)
82 xor %eax,%eax 86 xor %eax,%eax
83 EXIT 87 EXIT
84ENDPROC(__put_user_8) 88ENDPROC(__put_user_8)
89EXPORT_SYMBOL(__put_user_8)
85 90
86bad_put_user: 91bad_put_user:
87 movl $-EFAULT,%eax 92 movl $-EFAULT,%eax
diff --git a/arch/x86/lib/strstr_32.c b/arch/x86/lib/strstr_32.c
index 8e2d55f754bf..a03b1c750bfe 100644
--- a/arch/x86/lib/strstr_32.c
+++ b/arch/x86/lib/strstr_32.c
@@ -1,4 +1,5 @@
1#include <linux/string.h> 1#include <linux/string.h>
2#include <linux/export.h>
2 3
3char *strstr(const char *cs, const char *ct) 4char *strstr(const char *cs, const char *ct)
4{ 5{
@@ -28,4 +29,4 @@ __asm__ __volatile__(
28 : "dx", "di"); 29 : "dx", "di");
29return __res; 30return __res;
30} 31}
31 32EXPORT_SYMBOL(strstr);
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
index 3ee2bb6b440b..e7e7055a8658 100644
--- a/arch/x86/um/Makefile
+++ b/arch/x86/um/Makefile
@@ -8,7 +8,7 @@ else
8 BITS := 64 8 BITS := 64
9endif 9endif
10 10
11obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \ 11obj-y = bug.o bugs_$(BITS).o delay.o fault.o ldt.o \
12 ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ 12 ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \
13 stub_$(BITS).o stub_segv.o \ 13 stub_$(BITS).o stub_segv.o \
14 sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ 14 sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \
diff --git a/arch/x86/um/checksum_32.S b/arch/x86/um/checksum_32.S
index fa4b8b9841ff..b9933eb9274a 100644
--- a/arch/x86/um/checksum_32.S
+++ b/arch/x86/um/checksum_32.S
@@ -27,6 +27,7 @@
27 27
28#include <asm/errno.h> 28#include <asm/errno.h>
29#include <asm/asm.h> 29#include <asm/asm.h>
30#include <asm/export.h>
30 31
31/* 32/*
32 * computes a partial checksum, e.g. for TCP/UDP fragments 33 * computes a partial checksum, e.g. for TCP/UDP fragments
@@ -214,3 +215,4 @@ csum_partial:
214 ret 215 ret
215 216
216#endif 217#endif
218 EXPORT_SYMBOL(csum_partial)
diff --git a/arch/x86/um/ksyms.c b/arch/x86/um/ksyms.c
deleted file mode 100644
index 2e8f43ec6214..000000000000
--- a/arch/x86/um/ksyms.c
+++ /dev/null
@@ -1,13 +0,0 @@
1#include <linux/module.h>
2#include <asm/string.h>
3#include <asm/checksum.h>
4
5#ifndef CONFIG_X86_32
6/*XXX: we need them because they would be exported by x86_64 */
7#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
8EXPORT_SYMBOL(memcpy);
9#else
10EXPORT_SYMBOL(__memcpy);
11#endif
12#endif
13EXPORT_SYMBOL(csum_partial);
diff --git a/include/asm-generic/export.h b/include/asm-generic/export.h
new file mode 100644
index 000000000000..43199a049da5
--- /dev/null
+++ b/include/asm-generic/export.h
@@ -0,0 +1,94 @@
1#ifndef __ASM_GENERIC_EXPORT_H
2#define __ASM_GENERIC_EXPORT_H
3
4#ifndef KSYM_FUNC
5#define KSYM_FUNC(x) x
6#endif
7#ifdef CONFIG_64BIT
8#define __put .quad
9#ifndef KSYM_ALIGN
10#define KSYM_ALIGN 8
11#endif
12#ifndef KCRC_ALIGN
13#define KCRC_ALIGN 8
14#endif
15#else
16#define __put .long
17#ifndef KSYM_ALIGN
18#define KSYM_ALIGN 4
19#endif
20#ifndef KCRC_ALIGN
21#define KCRC_ALIGN 4
22#endif
23#endif
24
25#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
26#define KSYM(name) _##name
27#else
28#define KSYM(name) name
29#endif
30
31/*
32 * note on .section use: @progbits vs %progbits nastiness doesn't matter,
33 * since we immediately emit into those sections anyway.
34 */
35.macro ___EXPORT_SYMBOL name,val,sec
36#ifdef CONFIG_MODULES
37 .globl KSYM(__ksymtab_\name)
38 .section ___ksymtab\sec+\name,"a"
39 .balign KSYM_ALIGN
40KSYM(__ksymtab_\name):
41 __put \val, KSYM(__kstrtab_\name)
42 .previous
43 .section __ksymtab_strings,"a"
44KSYM(__kstrtab_\name):
45#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
46 .asciz "_\name"
47#else
48 .asciz "\name"
49#endif
50 .previous
51#ifdef CONFIG_MODVERSIONS
52 .section ___kcrctab\sec+\name,"a"
53 .balign KCRC_ALIGN
54KSYM(__kcrctab_\name):
55 __put KSYM(__crc_\name)
56 .weak KSYM(__crc_\name)
57 .previous
58#endif
59#endif
60.endm
61#undef __put
62
63#if defined(__KSYM_DEPS__)
64
65#define __EXPORT_SYMBOL(sym, val, sec) === __KSYM_##sym ===
66
67#elif defined(CONFIG_TRIM_UNUSED_KSYMS)
68
69#include <linux/kconfig.h>
70#include <generated/autoksyms.h>
71
72#define __EXPORT_SYMBOL(sym, val, sec) \
73 __cond_export_sym(sym, val, sec, config_enabled(__KSYM_##sym))
74#define __cond_export_sym(sym, val, sec, conf) \
75 ___cond_export_sym(sym, val, sec, conf)
76#define ___cond_export_sym(sym, val, sec, enabled) \
77 __cond_export_sym_##enabled(sym, val, sec)
78#define __cond_export_sym_1(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
79#define __cond_export_sym_0(sym, val, sec) /* nothing */
80
81#else
82#define __EXPORT_SYMBOL(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
83#endif
84
85#define EXPORT_SYMBOL(name) \
86 __EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)),)
87#define EXPORT_SYMBOL_GPL(name) \
88 __EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)), _gpl)
89#define EXPORT_DATA_SYMBOL(name) \
90 __EXPORT_SYMBOL(name, KSYM(name),)
91#define EXPORT_DATA_SYMBOL_GPL(name) \
92 __EXPORT_SYMBOL(name, KSYM(name),_gpl)
93
94#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3e42bcdd014b..30747960bc54 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -196,9 +196,14 @@
196 *(.dtb.init.rodata) \ 196 *(.dtb.init.rodata) \
197 VMLINUX_SYMBOL(__dtb_end) = .; 197 VMLINUX_SYMBOL(__dtb_end) = .;
198 198
199/* .data section */ 199/*
200 * .data section
201 * LD_DEAD_CODE_DATA_ELIMINATION option enables -fdata-sections generates
202 * .data.identifier which needs to be pulled in with .data, but don't want to
203 * pull in .data..stuff which has its own requirements. Same for bss.
204 */
200#define DATA_DATA \ 205#define DATA_DATA \
201 *(.data) \ 206 *(.data .data.[0-9a-zA-Z_]*) \
202 *(.ref.data) \ 207 *(.ref.data) \
203 *(.data..shared_aligned) /* percpu related */ \ 208 *(.data..shared_aligned) /* percpu related */ \
204 MEM_KEEP(init.data) \ 209 MEM_KEEP(init.data) \
@@ -320,76 +325,76 @@
320 /* Kernel symbol table: Normal symbols */ \ 325 /* Kernel symbol table: Normal symbols */ \
321 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ 326 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
322 VMLINUX_SYMBOL(__start___ksymtab) = .; \ 327 VMLINUX_SYMBOL(__start___ksymtab) = .; \
323 *(SORT(___ksymtab+*)) \ 328 KEEP(*(SORT(___ksymtab+*))) \
324 VMLINUX_SYMBOL(__stop___ksymtab) = .; \ 329 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
325 } \ 330 } \
326 \ 331 \
327 /* Kernel symbol table: GPL-only symbols */ \ 332 /* Kernel symbol table: GPL-only symbols */ \
328 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ 333 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
329 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ 334 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
330 *(SORT(___ksymtab_gpl+*)) \ 335 KEEP(*(SORT(___ksymtab_gpl+*))) \
331 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ 336 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
332 } \ 337 } \
333 \ 338 \
334 /* Kernel symbol table: Normal unused symbols */ \ 339 /* Kernel symbol table: Normal unused symbols */ \
335 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \ 340 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
336 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \ 341 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
337 *(SORT(___ksymtab_unused+*)) \ 342 KEEP(*(SORT(___ksymtab_unused+*))) \
338 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \ 343 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
339 } \ 344 } \
340 \ 345 \
341 /* Kernel symbol table: GPL-only unused symbols */ \ 346 /* Kernel symbol table: GPL-only unused symbols */ \
342 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \ 347 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
343 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \ 348 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
344 *(SORT(___ksymtab_unused_gpl+*)) \ 349 KEEP(*(SORT(___ksymtab_unused_gpl+*))) \
345 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \ 350 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
346 } \ 351 } \
347 \ 352 \
348 /* Kernel symbol table: GPL-future-only symbols */ \ 353 /* Kernel symbol table: GPL-future-only symbols */ \
349 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ 354 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
350 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ 355 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
351 *(SORT(___ksymtab_gpl_future+*)) \ 356 KEEP(*(SORT(___ksymtab_gpl_future+*))) \
352 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \ 357 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
353 } \ 358 } \
354 \ 359 \
355 /* Kernel symbol table: Normal symbols */ \ 360 /* Kernel symbol table: Normal symbols */ \
356 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ 361 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \
357 VMLINUX_SYMBOL(__start___kcrctab) = .; \ 362 VMLINUX_SYMBOL(__start___kcrctab) = .; \
358 *(SORT(___kcrctab+*)) \ 363 KEEP(*(SORT(___kcrctab+*))) \
359 VMLINUX_SYMBOL(__stop___kcrctab) = .; \ 364 VMLINUX_SYMBOL(__stop___kcrctab) = .; \
360 } \ 365 } \
361 \ 366 \
362 /* Kernel symbol table: GPL-only symbols */ \ 367 /* Kernel symbol table: GPL-only symbols */ \
363 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ 368 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
364 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ 369 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \
365 *(SORT(___kcrctab_gpl+*)) \ 370 KEEP(*(SORT(___kcrctab_gpl+*))) \
366 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ 371 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
367 } \ 372 } \
368 \ 373 \
369 /* Kernel symbol table: Normal unused symbols */ \ 374 /* Kernel symbol table: Normal unused symbols */ \
370 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \ 375 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
371 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \ 376 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
372 *(SORT(___kcrctab_unused+*)) \ 377 KEEP(*(SORT(___kcrctab_unused+*))) \
373 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \ 378 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
374 } \ 379 } \
375 \ 380 \
376 /* Kernel symbol table: GPL-only unused symbols */ \ 381 /* Kernel symbol table: GPL-only unused symbols */ \
377 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \ 382 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
378 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \ 383 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
379 *(SORT(___kcrctab_unused_gpl+*)) \ 384 KEEP(*(SORT(___kcrctab_unused_gpl+*))) \
380 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \ 385 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
381 } \ 386 } \
382 \ 387 \
383 /* Kernel symbol table: GPL-future-only symbols */ \ 388 /* Kernel symbol table: GPL-future-only symbols */ \
384 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ 389 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
385 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ 390 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
386 *(SORT(___kcrctab_gpl_future+*)) \ 391 KEEP(*(SORT(___kcrctab_gpl_future+*))) \
387 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \ 392 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \
388 } \ 393 } \
389 \ 394 \
390 /* Kernel symbol table: strings */ \ 395 /* Kernel symbol table: strings */ \
391 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ 396 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
392 *(__ksymtab_strings) \ 397 KEEP(*(__ksymtab_strings)) \
393 } \ 398 } \
394 \ 399 \
395 /* __*init sections */ \ 400 /* __*init sections */ \
@@ -424,12 +429,17 @@
424#define SECURITY_INIT \ 429#define SECURITY_INIT \
425 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ 430 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
426 VMLINUX_SYMBOL(__security_initcall_start) = .; \ 431 VMLINUX_SYMBOL(__security_initcall_start) = .; \
427 *(.security_initcall.init) \ 432 KEEP(*(.security_initcall.init)) \
428 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 433 VMLINUX_SYMBOL(__security_initcall_end) = .; \
429 } 434 }
430 435
431/* .text section. Map to function alignment to avoid address changes 436/* .text section. Map to function alignment to avoid address changes
432 * during second ld run in second ld pass when generating System.map */ 437 * during second ld run in second ld pass when generating System.map
438 * LD_DEAD_CODE_DATA_ELIMINATION option enables -ffunction-sections generates
439 * .text.identifier which needs to be pulled in with .text , but some
440 * architectures define .text.foo which is not intended to be pulled in here.
441 * Those enabling LD_DEAD_CODE_DATA_ELIMINATION must ensure they don't have
442 * conflicting section names, and must pull in .text.[0-9a-zA-Z_]* */
433#define TEXT_TEXT \ 443#define TEXT_TEXT \
434 ALIGN_FUNCTION(); \ 444 ALIGN_FUNCTION(); \
435 *(.text.hot .text .text.fixup .text.unlikely) \ 445 *(.text.hot .text .text.fixup .text.unlikely) \
@@ -533,6 +543,7 @@
533 543
534/* init and exit section handling */ 544/* init and exit section handling */
535#define INIT_DATA \ 545#define INIT_DATA \
546 KEEP(*(SORT(___kentry+*))) \
536 *(.init.data) \ 547 *(.init.data) \
537 MEM_DISCARD(init.data) \ 548 MEM_DISCARD(init.data) \
538 KERNEL_CTORS() \ 549 KERNEL_CTORS() \
@@ -599,7 +610,7 @@
599 BSS_FIRST_SECTIONS \ 610 BSS_FIRST_SECTIONS \
600 *(.bss..page_aligned) \ 611 *(.bss..page_aligned) \
601 *(.dynbss) \ 612 *(.dynbss) \
602 *(.bss) \ 613 *(.bss .bss.[0-9a-zA-Z_]*) \
603 *(COMMON) \ 614 *(COMMON) \
604 } 615 }
605 616
@@ -682,12 +693,12 @@
682 693
683#define INIT_CALLS_LEVEL(level) \ 694#define INIT_CALLS_LEVEL(level) \
684 VMLINUX_SYMBOL(__initcall##level##_start) = .; \ 695 VMLINUX_SYMBOL(__initcall##level##_start) = .; \
685 *(.initcall##level##.init) \ 696 KEEP(*(.initcall##level##.init)) \
686 *(.initcall##level##s.init) \ 697 KEEP(*(.initcall##level##s.init)) \
687 698
688#define INIT_CALLS \ 699#define INIT_CALLS \
689 VMLINUX_SYMBOL(__initcall_start) = .; \ 700 VMLINUX_SYMBOL(__initcall_start) = .; \
690 *(.initcallearly.init) \ 701 KEEP(*(.initcallearly.init)) \
691 INIT_CALLS_LEVEL(0) \ 702 INIT_CALLS_LEVEL(0) \
692 INIT_CALLS_LEVEL(1) \ 703 INIT_CALLS_LEVEL(1) \
693 INIT_CALLS_LEVEL(2) \ 704 INIT_CALLS_LEVEL(2) \
@@ -701,21 +712,21 @@
701 712
702#define CON_INITCALL \ 713#define CON_INITCALL \
703 VMLINUX_SYMBOL(__con_initcall_start) = .; \ 714 VMLINUX_SYMBOL(__con_initcall_start) = .; \
704 *(.con_initcall.init) \ 715 KEEP(*(.con_initcall.init)) \
705 VMLINUX_SYMBOL(__con_initcall_end) = .; 716 VMLINUX_SYMBOL(__con_initcall_end) = .;
706 717
707#define SECURITY_INITCALL \ 718#define SECURITY_INITCALL \
708 VMLINUX_SYMBOL(__security_initcall_start) = .; \ 719 VMLINUX_SYMBOL(__security_initcall_start) = .; \
709 *(.security_initcall.init) \ 720 KEEP(*(.security_initcall.init)) \
710 VMLINUX_SYMBOL(__security_initcall_end) = .; 721 VMLINUX_SYMBOL(__security_initcall_end) = .;
711 722
712#ifdef CONFIG_BLK_DEV_INITRD 723#ifdef CONFIG_BLK_DEV_INITRD
713#define INIT_RAM_FS \ 724#define INIT_RAM_FS \
714 . = ALIGN(4); \ 725 . = ALIGN(4); \
715 VMLINUX_SYMBOL(__initramfs_start) = .; \ 726 VMLINUX_SYMBOL(__initramfs_start) = .; \
716 *(.init.ramfs) \ 727 KEEP(*(.init.ramfs)) \
717 . = ALIGN(8); \ 728 . = ALIGN(8); \
718 *(.init.ramfs.info) 729 KEEP(*(.init.ramfs.info))
719#else 730#else
720#define INIT_RAM_FS 731#define INIT_RAM_FS
721#endif 732#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 668569844d37..f1bfa15b6f9b 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -182,6 +182,29 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
182# define unreachable() do { } while (1) 182# define unreachable() do { } while (1)
183#endif 183#endif
184 184
185/*
186 * KENTRY - kernel entry point
187 * This can be used to annotate symbols (functions or data) that are used
188 * without their linker symbol being referenced explicitly. For example,
189 * interrupt vector handlers, or functions in the kernel image that are found
190 * programatically.
191 *
192 * Not required for symbols exported with EXPORT_SYMBOL, or initcalls. Those
193 * are handled in their own way (with KEEP() in linker scripts).
194 *
195 * KENTRY can be avoided if the symbols in question are marked as KEEP() in the
196 * linker script. For example an architecture could KEEP() its entire
197 * boot/exception vector code rather than annotate each function and data.
198 */
199#ifndef KENTRY
200# define KENTRY(sym) \
201 extern typeof(sym) sym; \
202 static const unsigned long __kentry_##sym \
203 __used \
204 __attribute__((section("___kentry" "+" #sym ), used)) \
205 = (unsigned long)&sym;
206#endif
207
185#ifndef RELOC_HIDE 208#ifndef RELOC_HIDE
186# define RELOC_HIDE(ptr, off) \ 209# define RELOC_HIDE(ptr, off) \
187 ({ unsigned long __ptr; \ 210 ({ unsigned long __ptr; \
diff --git a/include/linux/export.h b/include/linux/export.h
index d7df4922da1d..2a0f61fbc731 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -1,5 +1,6 @@
1#ifndef _LINUX_EXPORT_H 1#ifndef _LINUX_EXPORT_H
2#define _LINUX_EXPORT_H 2#define _LINUX_EXPORT_H
3
3/* 4/*
4 * Export symbols from the kernel to modules. Forked from module.h 5 * Export symbols from the kernel to modules. Forked from module.h
5 * to reduce the amount of pointless cruft we feed to gcc when only 6 * to reduce the amount of pointless cruft we feed to gcc when only
@@ -42,27 +43,26 @@ extern struct module __this_module;
42#ifdef CONFIG_MODVERSIONS 43#ifdef CONFIG_MODVERSIONS
43/* Mark the CRC weak since genksyms apparently decides not to 44/* Mark the CRC weak since genksyms apparently decides not to
44 * generate a checksums for some symbols */ 45 * generate a checksums for some symbols */
45#define __CRC_SYMBOL(sym, sec) \ 46#define __CRC_SYMBOL(sym, sec) \
46 extern __visible void *__crc_##sym __attribute__((weak)); \ 47 extern __visible void *__crc_##sym __attribute__((weak)); \
47 static const unsigned long __kcrctab_##sym \ 48 static const unsigned long __kcrctab_##sym \
48 __used \ 49 __used \
49 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ 50 __attribute__((section("___kcrctab" sec "+" #sym), used)) \
50 = (unsigned long) &__crc_##sym; 51 = (unsigned long) &__crc_##sym;
51#else 52#else
52#define __CRC_SYMBOL(sym, sec) 53#define __CRC_SYMBOL(sym, sec)
53#endif 54#endif
54 55
55/* For every exported symbol, place a struct in the __ksymtab section */ 56/* For every exported symbol, place a struct in the __ksymtab section */
56#define ___EXPORT_SYMBOL(sym, sec) \ 57#define ___EXPORT_SYMBOL(sym, sec) \
57 extern typeof(sym) sym; \ 58 extern typeof(sym) sym; \
58 __CRC_SYMBOL(sym, sec) \ 59 __CRC_SYMBOL(sym, sec) \
59 static const char __kstrtab_##sym[] \ 60 static const char __kstrtab_##sym[] \
60 __attribute__((section("__ksymtab_strings"), aligned(1))) \ 61 __attribute__((section("__ksymtab_strings"), aligned(1))) \
61 = VMLINUX_SYMBOL_STR(sym); \ 62 = VMLINUX_SYMBOL_STR(sym); \
62 extern const struct kernel_symbol __ksymtab_##sym; \ 63 static const struct kernel_symbol __ksymtab_##sym \
63 __visible const struct kernel_symbol __ksymtab_##sym \ 64 __used \
64 __used \ 65 __attribute__((section("___ksymtab" sec "+" #sym), used)) \
65 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
66 = { (unsigned long)&sym, __kstrtab_##sym } 66 = { (unsigned long)&sym, __kstrtab_##sym }
67 67
68#if defined(__KSYM_DEPS__) 68#if defined(__KSYM_DEPS__)
diff --git a/include/linux/init.h b/include/linux/init.h
index 5a3321a7909b..024a0b5b3ed0 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -139,24 +139,8 @@ extern bool initcall_debug;
139 139
140#ifndef __ASSEMBLY__ 140#ifndef __ASSEMBLY__
141 141
142#ifdef CONFIG_LTO 142/*
143/* Work around a LTO gcc problem: when there is no reference to a variable 143 * initcalls are now grouped by functionality into separate
144 * in a module it will be moved to the end of the program. This causes
145 * reordering of initcalls which the kernel does not like.
146 * Add a dummy reference function to avoid this. The function is
147 * deleted by the linker.
148 */
149#define LTO_REFERENCE_INITCALL(x) \
150 ; /* yes this is needed */ \
151 static __used __exit void *reference_##x(void) \
152 { \
153 return &x; \
154 }
155#else
156#define LTO_REFERENCE_INITCALL(x)
157#endif
158
159/* initcalls are now grouped by functionality into separate
160 * subsections. Ordering inside the subsections is determined 144 * subsections. Ordering inside the subsections is determined
161 * by link order. 145 * by link order.
162 * For backwards compatibility, initcall() puts the call in 146 * For backwards compatibility, initcall() puts the call in
@@ -164,12 +148,16 @@ extern bool initcall_debug;
164 * 148 *
165 * The `id' arg to __define_initcall() is needed so that multiple initcalls 149 * The `id' arg to __define_initcall() is needed so that multiple initcalls
166 * can point at the same handler without causing duplicate-symbol build errors. 150 * can point at the same handler without causing duplicate-symbol build errors.
151 *
152 * Initcalls are run by placing pointers in initcall sections that the
153 * kernel iterates at runtime. The linker can do dead code / data elimination
154 * and remove that completely, so the initcall sections have to be marked
155 * as KEEP() in the linker script.
167 */ 156 */
168 157
169#define __define_initcall(fn, id) \ 158#define __define_initcall(fn, id) \
170 static initcall_t __initcall_##fn##id __used \ 159 static initcall_t __initcall_##fn##id __used \
171 __attribute__((__section__(".initcall" #id ".init"))) = fn; \ 160 __attribute__((__section__(".initcall" #id ".init"))) = fn;
172 LTO_REFERENCE_INITCALL(__initcall_##fn##id)
173 161
174/* 162/*
175 * Early initcalls run before initializing SMP. 163 * Early initcalls run before initializing SMP.
@@ -205,15 +193,15 @@ extern bool initcall_debug;
205 193
206#define __initcall(fn) device_initcall(fn) 194#define __initcall(fn) device_initcall(fn)
207 195
208#define __exitcall(fn) \ 196#define __exitcall(fn) \
209 static exitcall_t __exitcall_##fn __exit_call = fn 197 static exitcall_t __exitcall_##fn __exit_call = fn
210 198
211#define console_initcall(fn) \ 199#define console_initcall(fn) \
212 static initcall_t __initcall_##fn \ 200 static initcall_t __initcall_##fn \
213 __used __section(.con_initcall.init) = fn 201 __used __section(.con_initcall.init) = fn
214 202
215#define security_initcall(fn) \ 203#define security_initcall(fn) \
216 static initcall_t __initcall_##fn \ 204 static initcall_t __initcall_##fn \
217 __used __section(.security_initcall.init) = fn 205 __used __section(.security_initcall.init) = fn
218 206
219struct obs_kernel_param { 207struct obs_kernel_param {
diff --git a/init/Makefile b/init/Makefile
index 7bc47ee31c36..c4fb45525d08 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -2,6 +2,8 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5ccflags-y := -fno-function-sections -fno-data-sections
6
5obj-y := main.o version.o mounts.o 7obj-y := main.o version.o mounts.o
6ifneq ($(CONFIG_BLK_DEV_INITRD),y) 8ifneq ($(CONFIG_BLK_DEV_INITRD),y)
7obj-y += noinitramfs.o 9obj-y += noinitramfs.o
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 11602e5efb3b..de46ab03f063 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -81,6 +81,7 @@ endif
81 81
82ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),) 82ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),)
83lib-target := $(obj)/lib.a 83lib-target := $(obj)/lib.a
84obj-y += $(obj)/lib-ksyms.o
84endif 85endif
85 86
86ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),) 87ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
@@ -358,12 +359,22 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ;
358# Rule to compile a set of .o files into one .o file 359# Rule to compile a set of .o files into one .o file
359# 360#
360ifdef builtin-target 361ifdef builtin-target
361quiet_cmd_link_o_target = LD $@ 362
363ifdef CONFIG_THIN_ARCHIVES
364 cmd_make_builtin = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS)
365 cmd_make_empty_builtin = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS)
366 quiet_cmd_link_o_target = AR $@
367else
368 cmd_make_builtin = $(LD) $(ld_flags) -r -o
369 cmd_make_empty_builtin = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS)
370 quiet_cmd_link_o_target = LD $@
371endif
372
362# If the list of objects to link is empty, just create an empty built-in.o 373# If the list of objects to link is empty, just create an empty built-in.o
363cmd_link_o_target = $(if $(strip $(obj-y)),\ 374cmd_link_o_target = $(if $(strip $(obj-y)),\
364 $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ 375 $(cmd_make_builtin) $@ $(filter $(obj-y), $^) \
365 $(cmd_secanalysis),\ 376 $(cmd_secanalysis),\
366 rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@) 377 $(cmd_make_empty_builtin) $@)
367 378
368$(builtin-target): $(obj-y) FORCE 379$(builtin-target): $(obj-y) FORCE
369 $(call if_changed,link_o_target) 380 $(call if_changed,link_o_target)
@@ -389,12 +400,36 @@ $(modorder-target): $(subdir-ym) FORCE
389# 400#
390ifdef lib-target 401ifdef lib-target
391quiet_cmd_link_l_target = AR $@ 402quiet_cmd_link_l_target = AR $@
392cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) 403
404ifdef CONFIG_THIN_ARCHIVES
405 cmd_link_l_target = rm -f $@; $(AR) rcsT$(KBUILD_ARFLAGS) $@ $(lib-y)
406else
407 cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y)
408endif
393 409
394$(lib-target): $(lib-y) FORCE 410$(lib-target): $(lib-y) FORCE
395 $(call if_changed,link_l_target) 411 $(call if_changed,link_l_target)
396 412
397targets += $(lib-target) 413targets += $(lib-target)
414
415dummy-object = $(obj)/.lib_exports.o
416ksyms-lds = $(dot-target).lds
417ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
418ref_prefix = EXTERN(_
419else
420ref_prefix = EXTERN(
421endif
422
423quiet_cmd_export_list = EXPORTS $@
424cmd_export_list = $(OBJDUMP) -h $< | \
425 sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\
426 rm -f $(dummy-object);\
427 $(AR) rcs$(KBUILD_ARFLAGS) $(dummy-object);\
428 $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\
429 rm $(dummy-object) $(ksyms-lds)
430
431$(obj)/lib-ksyms.o: $(lib-target) FORCE
432 $(call if_changed,export_list)
398endif 433endif
399 434
400# 435#
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 1366a94b6c39..16923ba4b5b1 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -115,14 +115,18 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
115 115
116targets += $(modules:.ko=.mod.o) 116targets += $(modules:.ko=.mod.o)
117 117
118# Step 6), final link of the modules 118ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
119
120# Step 6), final link of the modules with optional arch pass after final link
119quiet_cmd_ld_ko_o = LD [M] $@ 121quiet_cmd_ld_ko_o = LD [M] $@
120 cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \ 122 cmd_ld_ko_o = \
121 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ 123 $(LD) -r $(LDFLAGS) \
122 -o $@ $(filter-out FORCE,$^) 124 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
125 -o $@ $(filter-out FORCE,$^) ; \
126 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
123 127
124$(modules): %.ko :%.o %.mod.o FORCE 128$(modules): %.ko :%.o %.mod.o FORCE
125 $(call if_changed,ld_ko_o) 129 +$(call if_changed,ld_ko_o)
126 130
127targets += $(modules) 131targets += $(modules)
128 132
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 746ec1ece614..fff818b92acb 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -82,8 +82,7 @@
82 * to date before even starting the recursive build, so it's too late 82 * to date before even starting the recursive build, so it's too late
83 * at this point anyway. 83 * at this point anyway.
84 * 84 *
85 * The algorithm to grep for "CONFIG_..." is bit unusual, but should 85 * We don't even try to really parse the header files, but
86 * be fast ;-) We don't even try to really parse the header files, but
87 * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will 86 * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will
88 * be picked up as well. It's not a problem with respect to 87 * be picked up as well. It's not a problem with respect to
89 * correctness, since that can only give too many dependencies, thus 88 * correctness, since that can only give too many dependencies, thus
@@ -115,11 +114,6 @@
115#include <ctype.h> 114#include <ctype.h>
116#include <arpa/inet.h> 115#include <arpa/inet.h>
117 116
118#define INT_CONF ntohl(0x434f4e46)
119#define INT_ONFI ntohl(0x4f4e4649)
120#define INT_NFIG ntohl(0x4e464947)
121#define INT_FIG_ ntohl(0x4649475f)
122
123int insert_extra_deps; 117int insert_extra_deps;
124char *target; 118char *target;
125char *depfile; 119char *depfile;
@@ -241,37 +235,22 @@ static void use_config(const char *m, int slen)
241 print_config(m, slen); 235 print_config(m, slen);
242} 236}
243 237
244static void parse_config_file(const char *map, size_t len) 238static void parse_config_file(const char *p)
245{ 239{
246 const int *end = (const int *) (map + len); 240 const char *q, *r;
247 /* start at +1, so that p can never be < map */ 241
248 const int *m = (const int *) map + 1; 242 while ((p = strstr(p, "CONFIG_"))) {
249 const char *p, *q;
250
251 for (; m < end; m++) {
252 if (*m == INT_CONF) { p = (char *) m ; goto conf; }
253 if (*m == INT_ONFI) { p = (char *) m-1; goto conf; }
254 if (*m == INT_NFIG) { p = (char *) m-2; goto conf; }
255 if (*m == INT_FIG_) { p = (char *) m-3; goto conf; }
256 continue;
257 conf:
258 if (p > map + len - 7)
259 continue;
260 if (memcmp(p, "CONFIG_", 7))
261 continue;
262 p += 7; 243 p += 7;
263 for (q = p; q < map + len; q++) { 244 q = p;
264 if (!(isalnum(*q) || *q == '_')) 245 while (*q && (isalnum(*q) || *q == '_'))
265 goto found; 246 q++;
266 } 247 if (memcmp(q - 7, "_MODULE", 7) == 0)
267 continue; 248 r = q - 7;
268 249 else
269 found: 250 r = q;
270 if (!memcmp(q - 7, "_MODULE", 7)) 251 if (r > p)
271 q -= 7; 252 use_config(p, r - p);
272 if (q - p < 0) 253 p = q;
273 continue;
274 use_config(p, q - p);
275 } 254 }
276} 255}
277 256
@@ -291,7 +270,7 @@ static void do_config_file(const char *filename)
291{ 270{
292 struct stat st; 271 struct stat st;
293 int fd; 272 int fd;
294 void *map; 273 char *map;
295 274
296 fd = open(filename, O_RDONLY); 275 fd = open(filename, O_RDONLY);
297 if (fd < 0) { 276 if (fd < 0) {
@@ -308,18 +287,23 @@ static void do_config_file(const char *filename)
308 close(fd); 287 close(fd);
309 return; 288 return;
310 } 289 }
311 map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 290 map = malloc(st.st_size + 1);
312 if ((long) map == -1) { 291 if (!map) {
313 perror("fixdep: mmap"); 292 perror("fixdep: malloc");
314 close(fd); 293 close(fd);
315 return; 294 return;
316 } 295 }
296 if (read(fd, map, st.st_size) != st.st_size) {
297 perror("fixdep: read");
298 close(fd);
299 return;
300 }
301 map[st.st_size] = '\0';
302 close(fd);
317 303
318 parse_config_file(map, st.st_size); 304 parse_config_file(map);
319
320 munmap(map, st.st_size);
321 305
322 close(fd); 306 free(map);
323} 307}
324 308
325/* 309/*
@@ -446,22 +430,8 @@ static void print_deps(void)
446 close(fd); 430 close(fd);
447} 431}
448 432
449static void traps(void)
450{
451 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
452 int *p = (int *)test;
453
454 if (*p != INT_CONF) {
455 fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
456 *p);
457 exit(2);
458 }
459}
460
461int main(int argc, char *argv[]) 433int main(int argc, char *argv[])
462{ 434{
463 traps();
464
465 if (argc == 5 && !strcmp(argv[1], "-e")) { 435 if (argc == 5 && !strcmp(argv[1], "-e")) {
466 insert_extra_deps = 1; 436 insert_extra_deps = 1;
467 argv++; 437 argv++;
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 17fa901418ae..0055b07b03b6 100755
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -97,7 +97,10 @@ print_mtime() {
97} 97}
98 98
99list_parse() { 99list_parse() {
100 [ ! -L "$1" ] && echo "$1 \\" || : 100 if [ -L "$1" ]; then
101 return
102 fi
103 echo "$1" | sed 's/:/\\:/g; s/$/ \\/'
101} 104}
102 105
103# for each file print a line in following format 106# for each file print a line in following format
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index e583565f2011..5235aa507ba5 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -289,6 +289,23 @@ repeat:
289 } 289 }
290 break; 290 break;
291 291
292 case ST_TYPEOF_1:
293 if (token == IDENT)
294 {
295 if (is_reserved_word(yytext, yyleng)
296 || find_symbol(yytext, SYM_TYPEDEF, 1))
297 {
298 yyless(0);
299 unput('(');
300 lexstate = ST_NORMAL;
301 token = TYPEOF_KEYW;
302 break;
303 }
304 _APP("(", 1);
305 }
306 lexstate = ST_TYPEOF;
307 /* FALLTHRU */
308
292 case ST_TYPEOF: 309 case ST_TYPEOF:
293 switch (token) 310 switch (token)
294 { 311 {
@@ -313,24 +330,6 @@ repeat:
313 } 330 }
314 break; 331 break;
315 332
316 case ST_TYPEOF_1:
317 if (token == IDENT)
318 {
319 if (is_reserved_word(yytext, yyleng)
320 || find_symbol(yytext, SYM_TYPEDEF, 1))
321 {
322 yyless(0);
323 unput('(');
324 lexstate = ST_NORMAL;
325 token = TYPEOF_KEYW;
326 break;
327 }
328 _APP("(", 1);
329 }
330 APP;
331 lexstate = ST_TYPEOF;
332 goto repeat;
333
334 case ST_BRACKET: 333 case ST_BRACKET:
335 APP; 334 APP;
336 switch (token) 335 switch (token)
diff --git a/scripts/genksyms/lex.lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped
index f82740a69b85..985c5541aae4 100644
--- a/scripts/genksyms/lex.lex.c_shipped
+++ b/scripts/genksyms/lex.lex.c_shipped
@@ -2098,6 +2098,23 @@ repeat:
2098 } 2098 }
2099 break; 2099 break;
2100 2100
2101 case ST_TYPEOF_1:
2102 if (token == IDENT)
2103 {
2104 if (is_reserved_word(yytext, yyleng)
2105 || find_symbol(yytext, SYM_TYPEDEF, 1))
2106 {
2107 yyless(0);
2108 unput('(');
2109 lexstate = ST_NORMAL;
2110 token = TYPEOF_KEYW;
2111 break;
2112 }
2113 _APP("(", 1);
2114 }
2115 lexstate = ST_TYPEOF;
2116 /* FALLTHRU */
2117
2101 case ST_TYPEOF: 2118 case ST_TYPEOF:
2102 switch (token) 2119 switch (token)
2103 { 2120 {
@@ -2122,24 +2139,6 @@ repeat:
2122 } 2139 }
2123 break; 2140 break;
2124 2141
2125 case ST_TYPEOF_1:
2126 if (token == IDENT)
2127 {
2128 if (is_reserved_word(yytext, yyleng)
2129 || find_symbol(yytext, SYM_TYPEDEF, 1))
2130 {
2131 yyless(0);
2132 unput('(');
2133 lexstate = ST_NORMAL;
2134 token = TYPEOF_KEYW;
2135 break;
2136 }
2137 _APP("(", 1);
2138 }
2139 APP;
2140 lexstate = ST_TYPEOF;
2141 goto repeat;
2142
2143 case ST_BRACKET: 2142 case ST_BRACKET:
2144 APP; 2143 APP;
2145 switch (token) 2144 switch (token)
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 4f727eb5ec43..f742c65108b9 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -37,12 +37,40 @@ info()
37 fi 37 fi
38} 38}
39 39
40# Thin archive build here makes a final archive with
41# symbol table and indexes from vmlinux objects, which can be
42# used as input to linker.
43#
44# Traditional incremental style of link does not require this step
45#
46# built-in.o output file
47#
48archive_builtin()
49{
50 if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
51 info AR built-in.o
52 rm -f built-in.o;
53 ${AR} rcsT${KBUILD_ARFLAGS} built-in.o \
54 ${KBUILD_VMLINUX_INIT} \
55 ${KBUILD_VMLINUX_MAIN}
56 fi
57}
58
40# Link of vmlinux.o used for section mismatch analysis 59# Link of vmlinux.o used for section mismatch analysis
41# ${1} output file 60# ${1} output file
42modpost_link() 61modpost_link()
43{ 62{
44 ${LD} ${LDFLAGS} -r -o ${1} ${KBUILD_VMLINUX_INIT} \ 63 local objects
45 --start-group ${KBUILD_VMLINUX_MAIN} --end-group 64
65 if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
66 objects="--whole-archive built-in.o"
67 else
68 objects="${KBUILD_VMLINUX_INIT} \
69 --start-group \
70 ${KBUILD_VMLINUX_MAIN} \
71 --end-group"
72 fi
73 ${LD} ${LDFLAGS} -r -o ${1} ${objects}
46} 74}
47 75
48# Link of vmlinux 76# Link of vmlinux
@@ -51,18 +79,36 @@ modpost_link()
51vmlinux_link() 79vmlinux_link()
52{ 80{
53 local lds="${objtree}/${KBUILD_LDS}" 81 local lds="${objtree}/${KBUILD_LDS}"
82 local objects
54 83
55 if [ "${SRCARCH}" != "um" ]; then 84 if [ "${SRCARCH}" != "um" ]; then
56 ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \ 85 if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
57 -T ${lds} ${KBUILD_VMLINUX_INIT} \ 86 objects="--whole-archive built-in.o ${1}"
58 --start-group ${KBUILD_VMLINUX_MAIN} --end-group ${1} 87 else
88 objects="${KBUILD_VMLINUX_INIT} \
89 --start-group \
90 ${KBUILD_VMLINUX_MAIN} \
91 --end-group \
92 ${1}"
93 fi
94
95 ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \
96 -T ${lds} ${objects}
59 else 97 else
60 ${CC} ${CFLAGS_vmlinux} -o ${2} \ 98 if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
61 -Wl,-T,${lds} ${KBUILD_VMLINUX_INIT} \ 99 objects="-Wl,--whole-archive built-in.o ${1}"
62 -Wl,--start-group \ 100 else
63 ${KBUILD_VMLINUX_MAIN} \ 101 objects="${KBUILD_VMLINUX_INIT} \
64 -Wl,--end-group \ 102 -Wl,--start-group \
65 -lutil -lrt -lpthread ${1} 103 ${KBUILD_VMLINUX_MAIN} \
104 -Wl,--end-group \
105 ${1}"
106 fi
107
108 ${CC} ${CFLAGS_vmlinux} -o ${2} \
109 -Wl,-T,${lds} \
110 ${objects} \
111 -lutil -lrt -lpthread
66 rm -f linux 112 rm -f linux
67 fi 113 fi
68} 114}
@@ -119,6 +165,7 @@ cleanup()
119 rm -f .tmp_kallsyms* 165 rm -f .tmp_kallsyms*
120 rm -f .tmp_version 166 rm -f .tmp_version
121 rm -f .tmp_vmlinux* 167 rm -f .tmp_vmlinux*
168 rm -f built-in.o
122 rm -f System.map 169 rm -f System.map
123 rm -f vmlinux 170 rm -f vmlinux
124 rm -f vmlinux.o 171 rm -f vmlinux.o
@@ -162,6 +209,8 @@ case "${KCONFIG_CONFIG}" in
162 . "./${KCONFIG_CONFIG}" 209 . "./${KCONFIG_CONFIG}"
163esac 210esac
164 211
212archive_builtin
213
165#link vmlinux.o 214#link vmlinux.o
166info LD vmlinux.o 215info LD vmlinux.o
167modpost_link vmlinux.o 216modpost_link vmlinux.o