From: Linus Torvalds Date: Fri, 14 Oct 2016 21:26:58 +0000 (-0700) Subject: Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=84d69848c97faab0c25aa2667b273404d2e2a64a;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'kbuild' of git://git./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 ... --- 84d69848c97faab0c25aa2667b273404d2e2a64a diff --cc Makefile index 27f97b53e6eb,83dae63df91a..fa2c3bd2aef9 --- a/Makefile +++ b/Makefile @@@ -621,8 -621,12 +621,13 @@@ include arch/$(SRCARCH)/Makefil KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) + ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION + KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) + KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) + endif + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os else diff --cc arch/Kconfig index 180ea33164dc,48d1e76a1ee3..11d349561ece --- a/arch/Kconfig +++ b/arch/Kconfig @@@ -450,15 -461,27 +450,36 @@@ config CC_STACKPROTECTOR_STRON endchoice + config THIN_ARCHIVES + bool + help + Select this if the architecture wants to use thin archives + instead of ld -r to create the built-in.o files. + + config LD_DEAD_CODE_DATA_ELIMINATION + bool + help + Select this if the architecture wants to do dead code and + data elimination with the linker by compiling with + -ffunction-sections -fdata-sections and linking with + --gc-sections. + + This requires that the arch annotates or otherwise protects + its external entry points from being discarded. Linker scripts + must also merge .text.*, .data.*, and .bss.* correctly into + output sections. Care must be taken not to pull in unrelated + sections (e.g., '.text.init'). Typically '.' in section names + is used to distinguish them from label names / C identifiers. + +config HAVE_ARCH_WITHIN_STACK_FRAMES + bool + help + An architecture should select this if it can walk the kernel stack + frames to determine if an object is part of either the arguments + or local variables (i.e. that it excludes saved return addresses, + and similar) by implementing an inline arch_within_stack_frames(), + which is used by CONFIG_HARDENED_USERCOPY. + config HAVE_CONTEXT_TRACKING bool help diff --cc arch/arm/mach-imx/Makefile index cab128913e72,8ed8ab56bb78..737450fe790c --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@@ -32,9 -32,13 +32,8 @@@ endi ifdef CONFIG_SND_IMX_SOC obj-y += ssi-fiq.o - obj-y += ssi-fiq-ksym.o endif -# i.MX1 based machines -obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o -obj-$(CONFIG_MACH_APF9328) += mach-apf9328.o -obj-$(CONFIG_MACH_IMX1_DT) += imx1-dt.o - # i.MX21 based machines obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o diff --cc arch/powerpc/kernel/misc_32.S index 03756ffdcd71,f5156105c5f3..93cf7a5846a6 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S @@@ -358,8 -360,7 +360,9 @@@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ sync /* additional sync needed on g4 */ isync blr +_ASM_NOKPROBE_SYMBOL(flush_icache_range) + EXPORT_SYMBOL(flush_icache_range) + /* * Flush a particular page from the data cache to RAM. * Note: this is necessary because the instruction cache does *not* diff --cc arch/powerpc/kernel/misc_64.S index 9f0bed214bcb,8b526846e72a..4f178671f230 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@@ -109,8 -110,8 +110,9 @@@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ bdnz 2b isync blr - .previous .text +_ASM_NOKPROBE_SYMBOL(flush_icache_range) + EXPORT_SYMBOL(flush_icache_range) + /* * Like above, but only do the D-cache. * diff --cc arch/powerpc/kernel/vector.S index bc85bdff4e01,388ec6477fc4..0c123f3406cd --- a/arch/powerpc/kernel/vector.S +++ b/arch/powerpc/kernel/vector.S @@@ -6,7 -6,33 +6,8 @@@ #include #include #include + #include -#ifdef CONFIG_PPC_TRANSACTIONAL_MEM -/* void do_load_up_transact_altivec(struct thread_struct *thread) - * - * This is similar to load_up_altivec but for the transactional version of the - * vector regs. It doesn't mess with the task MSR or valid flags. - * Furthermore, VEC laziness is not supported with TM currently. - */ -_GLOBAL(do_load_up_transact_altivec) - mfmsr r6 - oris r5,r6,MSR_VEC@h - MTMSRD(r5) - isync - - li r4,1 - stw r4,THREAD_USED_VR(r3) - - li r10,THREAD_TRANSACT_VRSTATE+VRSTATE_VSCR - lvx v0,r10,r3 - mtvscr v0 - addi r10,r3,THREAD_TRANSACT_VRSTATE - REST_32VRS(0,r4,r10) - - blr -#endif - /* * Load state from memory into VMX registers including VSCR. * Assumes the caller has enabled VMX in the MSR. diff --cc arch/x86/lib/memcpy_64.S index 49e6ebac7e73,94c917af9688..779782f58324 --- a/arch/x86/lib/memcpy_64.S +++ b/arch/x86/lib/memcpy_64.S @@@ -273,7 -276,8 +276,8 @@@ ENTRY(memcpy_mcsafe_unrolled .L_done_memcpy_trap: xorq %rax, %rax ret -ENDPROC(memcpy_mcsafe) -EXPORT_SYMBOL_GPL(memcpy_mcsafe) +ENDPROC(memcpy_mcsafe_unrolled) ++EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled) .section .fixup, "ax" /* Return -EFAULT for any failure */