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 ...
This commit is contained in:
commit
84d69848c9
262 changed files with 1094 additions and 1403 deletions
|
|
@ -41,6 +41,7 @@ This document describes the Linux kernel Makefiles.
|
|||
--- 6.8 Custom kbuild commands
|
||||
--- 6.9 Preprocessing linker scripts
|
||||
--- 6.10 Generic header files
|
||||
--- 6.11 Post-link pass
|
||||
|
||||
=== 7 Kbuild syntax for exported headers
|
||||
--- 7.1 header-y
|
||||
|
|
@ -1237,6 +1238,21 @@ When kbuild executes, the following steps are followed (roughly):
|
|||
to list the file in the Kbuild file.
|
||||
See "7.4 generic-y" for further info on syntax etc.
|
||||
|
||||
--- 6.11 Post-link pass
|
||||
|
||||
If the file arch/xxx/Makefile.postlink exists, this makefile
|
||||
will be invoked for post-link objects (vmlinux and modules.ko)
|
||||
for architectures to run post-link passes on. Must also handle
|
||||
the clean target.
|
||||
|
||||
This pass runs after kallsyms generation. If the architecture
|
||||
needs to modify symbol locations, rather than manipulate the
|
||||
kallsyms, it may be easier to add another postlink target for
|
||||
.tmp_vmlinux? targets to be called from link-vmlinux.sh.
|
||||
|
||||
For example, powerpc uses this to check relocation sanity of
|
||||
the linked vmlinux file.
|
||||
|
||||
=== 7 Kbuild syntax for exported headers
|
||||
|
||||
The kernel includes a set of headers that is exported to userspace.
|
||||
|
|
|
|||
19
Makefile
19
Makefile
|
|
@ -623,6 +623,11 @@ 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
|
||||
|
|
@ -803,6 +808,10 @@ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
|
|||
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
|
||||
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
|
||||
|
||||
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
|
||||
LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
|
||||
LDFLAGS_vmlinux += $(call ld-option, -X,)
|
||||
endif
|
||||
|
|
@ -942,9 +951,12 @@ endif
|
|||
include/generated/autoksyms.h: FORCE
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh true
|
||||
|
||||
# Final link of vmlinux
|
||||
cmd_link-vmlinux = $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux)
|
||||
quiet_cmd_link-vmlinux = LINK $@
|
||||
ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
|
||||
|
||||
# Final link of vmlinux with optional arch pass after final link
|
||||
cmd_link-vmlinux = \
|
||||
$(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
|
||||
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
|
||||
|
||||
vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE
|
||||
+$(call if_changed,link-vmlinux)
|
||||
|
|
@ -1271,6 +1283,7 @@ $(clean-dirs):
|
|||
|
||||
vmlinuxclean:
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
|
||||
$(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean)
|
||||
|
||||
clean: archclean vmlinuxclean
|
||||
|
||||
|
|
|
|||
21
arch/Kconfig
21
arch/Kconfig
|
|
@ -450,6 +450,27 @@ config CC_STACKPROTECTOR_STRONG
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
generic-y += clkdev.h
|
||||
generic-y += cputime.h
|
||||
generic-y += exec.h
|
||||
generic-y += export.h
|
||||
generic-y += irq_work.h
|
||||
generic-y += mcs_spinlock.h
|
||||
generic-y += mm-arch-hooks.h
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ ccflags-y := -Wno-sign-compare
|
|||
|
||||
obj-y := entry.o traps.o process.o osf_sys.o irq.o \
|
||||
irq_alpha.o signal.o setup.o ptrace.o time.o \
|
||||
alpha_ksyms.o systbls.o err_common.o io.o
|
||||
systbls.o err_common.o io.o
|
||||
|
||||
obj-$(CONFIG_VGA_HOSE) += console.o
|
||||
obj-$(CONFIG_SMP) += smp.o
|
||||
|
|
|
|||
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* linux/arch/alpha/kernel/alpha_ksyms.c
|
||||
*
|
||||
* Export the alpha-specific functions that are needed for loadable
|
||||
* modules.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <asm/console.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/checksum.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/machvec.h>
|
||||
|
||||
#include <linux/syscalls.h>
|
||||
|
||||
/* these are C runtime functions with special calling conventions: */
|
||||
extern void __divl (void);
|
||||
extern void __reml (void);
|
||||
extern void __divq (void);
|
||||
extern void __remq (void);
|
||||
extern void __divlu (void);
|
||||
extern void __remlu (void);
|
||||
extern void __divqu (void);
|
||||
extern void __remqu (void);
|
||||
|
||||
EXPORT_SYMBOL(alpha_mv);
|
||||
EXPORT_SYMBOL(callback_getenv);
|
||||
EXPORT_SYMBOL(callback_setenv);
|
||||
EXPORT_SYMBOL(callback_save_env);
|
||||
|
||||
/* platform dependent support */
|
||||
EXPORT_SYMBOL(strcat);
|
||||
EXPORT_SYMBOL(strcpy);
|
||||
EXPORT_SYMBOL(strlen);
|
||||
EXPORT_SYMBOL(strncpy);
|
||||
EXPORT_SYMBOL(strncat);
|
||||
EXPORT_SYMBOL(strchr);
|
||||
EXPORT_SYMBOL(strrchr);
|
||||
EXPORT_SYMBOL(memmove);
|
||||
EXPORT_SYMBOL(__memcpy);
|
||||
EXPORT_SYMBOL(__memset);
|
||||
EXPORT_SYMBOL(___memset);
|
||||
EXPORT_SYMBOL(__memsetw);
|
||||
EXPORT_SYMBOL(__constant_c_memset);
|
||||
EXPORT_SYMBOL(copy_page);
|
||||
EXPORT_SYMBOL(clear_page);
|
||||
|
||||
EXPORT_SYMBOL(alpha_read_fp_reg);
|
||||
EXPORT_SYMBOL(alpha_read_fp_reg_s);
|
||||
EXPORT_SYMBOL(alpha_write_fp_reg);
|
||||
EXPORT_SYMBOL(alpha_write_fp_reg_s);
|
||||
|
||||
/* Networking helper routines. */
|
||||
EXPORT_SYMBOL(csum_tcpudp_magic);
|
||||
EXPORT_SYMBOL(ip_compute_csum);
|
||||
EXPORT_SYMBOL(ip_fast_csum);
|
||||
EXPORT_SYMBOL(csum_partial_copy_nocheck);
|
||||
EXPORT_SYMBOL(csum_partial_copy_from_user);
|
||||
EXPORT_SYMBOL(csum_ipv6_magic);
|
||||
|
||||
#ifdef CONFIG_MATHEMU_MODULE
|
||||
extern long (*alpha_fp_emul_imprecise)(struct pt_regs *, unsigned long);
|
||||
extern long (*alpha_fp_emul) (unsigned long pc);
|
||||
EXPORT_SYMBOL(alpha_fp_emul_imprecise);
|
||||
EXPORT_SYMBOL(alpha_fp_emul);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following are specially called from the uaccess assembly stubs.
|
||||
*/
|
||||
EXPORT_SYMBOL(__copy_user);
|
||||
EXPORT_SYMBOL(__do_clear_user);
|
||||
|
||||
/*
|
||||
* SMP-specific symbols.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
EXPORT_SYMBOL(_atomic_dec_and_lock);
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
/*
|
||||
* The following are special because they're not called
|
||||
* explicitly (the C compiler or assembler generates them in
|
||||
* response to division operations). Fortunately, their
|
||||
* interface isn't gonna change any time soon now, so it's OK
|
||||
* to leave it out of version control.
|
||||
*/
|
||||
# undef memcpy
|
||||
# undef memset
|
||||
EXPORT_SYMBOL(__divl);
|
||||
EXPORT_SYMBOL(__divlu);
|
||||
EXPORT_SYMBOL(__divq);
|
||||
EXPORT_SYMBOL(__divqu);
|
||||
EXPORT_SYMBOL(__reml);
|
||||
EXPORT_SYMBOL(__remlu);
|
||||
EXPORT_SYMBOL(__remq);
|
||||
EXPORT_SYMBOL(__remqu);
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
EXPORT_SYMBOL(memset);
|
||||
EXPORT_SYMBOL(memchr);
|
||||
|
|
@ -144,9 +144,11 @@
|
|||
else beforehand. Fine. We'll do it ourselves. */
|
||||
#if 0
|
||||
#define ALIAS_MV(system) \
|
||||
struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv")));
|
||||
struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv"))); \
|
||||
EXPORT_SYMBOL(alpha_mv);
|
||||
#else
|
||||
#define ALIAS_MV(system) \
|
||||
asm(".global alpha_mv\nalpha_mv = " #system "_mv");
|
||||
asm(".global alpha_mv\nalpha_mv = " #system "_mv"); \
|
||||
EXPORT_SYMBOL(alpha_mv);
|
||||
#endif
|
||||
#endif /* GENERIC */
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE;
|
|||
|
||||
#ifdef CONFIG_ALPHA_GENERIC
|
||||
struct alpha_machine_vector alpha_mv;
|
||||
EXPORT_SYMBOL(alpha_mv);
|
||||
#endif
|
||||
|
||||
#ifndef alpha_using_srm
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
|
||||
#include <asm/console.h>
|
||||
#include <asm/export.h>
|
||||
|
||||
.text
|
||||
#define HWRPB_CRB_OFFSET 0xc0
|
||||
|
|
@ -92,6 +93,10 @@ CALLBACK(reset_env, CCB_RESET_ENV, 4)
|
|||
CALLBACK(save_env, CCB_SAVE_ENV, 1)
|
||||
CALLBACK(pswitch, CCB_PSWITCH, 3)
|
||||
CALLBACK(bios_emul, CCB_BIOS_EMUL, 5)
|
||||
|
||||
EXPORT_SYMBOL(callback_getenv)
|
||||
EXPORT_SYMBOL(callback_setenv)
|
||||
EXPORT_SYMBOL(callback_save_env)
|
||||
|
||||
.data
|
||||
__alpha_using_srm: # For use by bootpheader
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
|||
(__force u64)saddr + (__force u64)daddr +
|
||||
(__force u64)sum + ((len + proto) << 8));
|
||||
}
|
||||
EXPORT_SYMBOL(csum_tcpudp_magic);
|
||||
|
||||
__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
__u32 len, __u8 proto, __wsum sum)
|
||||
|
|
@ -144,6 +145,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
|||
{
|
||||
return (__force __sum16)~do_csum(iph,ihl*4);
|
||||
}
|
||||
EXPORT_SYMBOL(ip_fast_csum);
|
||||
|
||||
/*
|
||||
* computes the checksum of a memory block at buff, length len,
|
||||
|
|
@ -178,3 +180,4 @@ __sum16 ip_compute_csum(const void *buff, int len)
|
|||
{
|
||||
return (__force __sum16)~from64to16(do_csum(buff,len));
|
||||
}
|
||||
EXPORT_SYMBOL(ip_compute_csum);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Zero an entire page.
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
.text
|
||||
.align 4
|
||||
.global clear_page
|
||||
|
|
@ -37,3 +37,4 @@ clear_page:
|
|||
nop
|
||||
|
||||
.end clear_page
|
||||
EXPORT_SYMBOL(clear_page)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
* Clobbers:
|
||||
* $1,$2,$3,$4,$5,$6
|
||||
*/
|
||||
#include <asm/export.h>
|
||||
|
||||
/* Allow an exception for an insn; exit if we get one. */
|
||||
#define EX(x,y...) \
|
||||
|
|
@ -111,3 +112,4 @@ $exception:
|
|||
ret $31, ($28), 1 # .. e1 :
|
||||
|
||||
.end __do_clear_user
|
||||
EXPORT_SYMBOL(__do_clear_user)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copy an entire page.
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
.text
|
||||
.align 4
|
||||
.global copy_page
|
||||
|
|
@ -47,3 +47,4 @@ copy_page:
|
|||
nop
|
||||
|
||||
.end copy_page
|
||||
EXPORT_SYMBOL(copy_page)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
* $1,$2,$3,$4,$5,$6,$7
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
|
||||
/* Allow an exception for an insn; exit if we get one. */
|
||||
#define EXI(x,y...) \
|
||||
99: x,##y; \
|
||||
|
|
@ -143,3 +145,4 @@ $101:
|
|||
ret $31,($28),1
|
||||
|
||||
.end __copy_user
|
||||
EXPORT_SYMBOL(__copy_user)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
* added by Ivan Kokshaysky <ink@jurassic.park.msu.ru>
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
.globl csum_ipv6_magic
|
||||
.align 4
|
||||
.ent csum_ipv6_magic
|
||||
|
|
@ -113,3 +114,4 @@ csum_ipv6_magic:
|
|||
ret # .. e1 :
|
||||
|
||||
.end csum_ipv6_magic
|
||||
EXPORT_SYMBOL(csum_ipv6_magic)
|
||||
|
|
|
|||
|
|
@ -374,6 +374,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
|
|||
}
|
||||
return (__force __wsum)checksum;
|
||||
}
|
||||
EXPORT_SYMBOL(csum_partial_copy_from_user);
|
||||
|
||||
__wsum
|
||||
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
|
||||
|
|
@ -386,3 +387,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
|
|||
set_fs(oldfs);
|
||||
return checksum;
|
||||
}
|
||||
EXPORT_SYMBOL(csum_partial_copy_nocheck);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/export.h>
|
||||
|
||||
asm (".text \n\
|
||||
.global _atomic_dec_and_lock \n\
|
||||
|
|
@ -39,3 +40,4 @@ static int __used atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock)
|
|||
spin_unlock(lock);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(_atomic_dec_and_lock);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
* $28 - compare status
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
#define halt .long 0
|
||||
|
||||
/*
|
||||
|
|
@ -151,6 +152,7 @@ ufunction:
|
|||
addq $30,STACK,$30
|
||||
ret $31,($23),1
|
||||
.end ufunction
|
||||
EXPORT_SYMBOL(ufunction)
|
||||
|
||||
/*
|
||||
* Uhh.. Ugly signed division. I'd rather not have it at all, but
|
||||
|
|
@ -193,3 +195,4 @@ sfunction:
|
|||
addq $30,STACK,$30
|
||||
ret $31,($23),1
|
||||
.end sfunction
|
||||
EXPORT_SYMBOL(sfunction)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Zero an entire page.
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
.text
|
||||
.align 4
|
||||
.global clear_page
|
||||
|
|
@ -52,3 +52,4 @@ clear_page:
|
|||
nop
|
||||
|
||||
.end clear_page
|
||||
EXPORT_SYMBOL(clear_page)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
* want to leave a hole (and we also want to avoid repeating lots of work)
|
||||
*/
|
||||
|
||||
#include <asm/export.h>
|
||||
/* Allow an exception for an insn; exit if we get one. */
|
||||
#define EX(x,y...) \
|
||||
99: x,##y; \
|
||||
|
|
@ -222,4 +223,4 @@ $exception: # Destination for exception recovery(?)
|
|||
nop # .. E .. .. :
|
||||
ret $31, ($28), 1 # L0 .. .. .. : L U L U
|
||||
.end __do_clear_user
|
||||
|
||||
EXPORT_SYMBOL(__do_clear_user)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue