1
0
Fork 0

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (30 commits)
  Use macros for .data.page_aligned section.
  Use macros for .bss.page_aligned section.
  Use new __init_task_data macro in arch init_task.c files.
  kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts.
  arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0
  kbuild: add static to prototypes
  kbuild: fail build if recordmcount.pl fails
  kbuild: set -fconserve-stack option for gcc 4.5
  kbuild: echo the record_mcount command
  gconfig: disable "typeahead find" search in treeviews
  kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling
  checkincludes.pl: add option to remove duplicates in place
  markup_oops: use modinfo to avoid confusion with underscored module names
  checkincludes.pl: provide usage helper
  checkincludes.pl: close file as soon as we're done with it
  ctags: usability fix
  kernel hacking: move STRIP_ASM_SYMS from General
  gitignore usr/initramfs_data.cpio.bz2 and usr/initramfs_data.cpio.lzma
  kbuild: Check if linker supports the -X option
  kbuild: introduce ld-option
  ...

Fix trivial conflict in scripts/basic/fixdep.c
hifive-unleashed-5.1
Linus Torvalds 2009-09-23 15:37:02 -07:00
commit c37efa9325
94 changed files with 475 additions and 356 deletions

View File

@ -65,6 +65,22 @@ INSTALL_PATH
INSTALL_PATH specifies where to place the updated kernel and system map INSTALL_PATH specifies where to place the updated kernel and system map
images. Default is /boot, but you can set it to other values. images. Default is /boot, but you can set it to other values.
INSTALLKERNEL
--------------------------------------------------
Install script called when using "make install".
The default name is "installkernel".
The script will be called with the following arguments:
$1 - kernel version
$2 - kernel image file
$3 - kernel map file
$4 - default install path (use root directory if blank)
The implmentation of "make install" is architecture specific
and it may differ from the above.
INSTALLKERNEL is provided to enable the possibility to
specify a custom installer when cross compiling a kernel.
MODLIB MODLIB
-------------------------------------------------- --------------------------------------------------

View File

@ -18,6 +18,7 @@ This document describes the Linux kernel Makefiles.
--- 3.9 Dependency tracking --- 3.9 Dependency tracking
--- 3.10 Special Rules --- 3.10 Special Rules
--- 3.11 $(CC) support functions --- 3.11 $(CC) support functions
--- 3.12 $(LD) support functions
=== 4 Host Program support === 4 Host Program support
--- 4.1 Simple Host Program --- 4.1 Simple Host Program
@ -435,14 +436,14 @@ more details, with real examples.
The second argument is optional, and if supplied will be used The second argument is optional, and if supplied will be used
if first argument is not supported. if first argument is not supported.
ld-option cc-ldoption
ld-option is used to check if $(CC) when used to link object files cc-ldoption is used to check if $(CC) when used to link object files
supports the given option. An optional second option may be supports the given option. An optional second option may be
specified if first option are not supported. specified if first option are not supported.
Example: Example:
#arch/i386/kernel/Makefile #arch/i386/kernel/Makefile
vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv) vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
In the above example, vsyscall-flags will be assigned the option In the above example, vsyscall-flags will be assigned the option
-Wl$(comma)--hash-style=sysv if it is supported by $(CC). -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
@ -570,6 +571,19 @@ more details, with real examples.
endif endif
endif endif
--- 3.12 $(LD) support functions
ld-option
ld-option is used to check if $(LD) supports the supplied option.
ld-option takes two options as arguments.
The second argument is an optional option that can be used if the
first option is not supported by $(LD).
Example:
#Makefile
LDFLAGS_vmlinux += $(call really-ld-option, -X)
=== 4 Host Program support === 4 Host Program support
Kbuild supports building executables on the host for use during the Kbuild supports building executables on the host for use during the

View File

@ -179,9 +179,46 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
# Alternatively CROSS_COMPILE can be set in the environment. # Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables # Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
#
# To force ARCH and CROSS_COMPILE settings include kernel.* files
# in the kernel tree - do not patch this file.
export KBUILD_BUILDHOST := $(SUBARCH) export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= # Kbuild save the ARCH and CROSS_COMPILE setting in kernel.* files.
# Restore these settings and check that user did not specify
# conflicting values.
saved_arch := $(shell cat include/generated/kernel.arch 2> /dev/null)
saved_cross := $(shell cat include/generated/kernel.cross 2> /dev/null)
ifneq ($(CROSS_COMPILE),)
ifneq ($(saved_cross),)
ifneq ($(CROSS_COMPILE),$(saved_cross))
$(error CROSS_COMPILE changed from \
"$(saved_cross)" to \
to "$(CROSS_COMPILE)". \
Use "make mrproper" to fix it up)
endif
endif
else
CROSS_COMPILE := $(saved_cross)
endif
ifneq ($(ARCH),)
ifneq ($(saved_arch),)
ifneq ($(saved_arch),$(ARCH))
$(error ARCH changed from \
"$(saved_arch)" to "$(ARCH)". \
Use "make mrproper" to fix it up)
endif
endif
else
ifneq ($(saved_arch),)
ARCH := $(saved_arch)
else
ARCH := $(SUBARCH)
endif
endif
# Architecture as present in compile.h # Architecture as present in compile.h
UTS_MACHINE := $(ARCH) UTS_MACHINE := $(ARCH)
@ -315,6 +352,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump OBJDUMP = $(CROSS_COMPILE)objdump
AWK = awk AWK = awk
GENKSYMS = scripts/genksyms/genksyms GENKSYMS = scripts/genksyms/genksyms
INSTALLKERNEL := installkernel
DEPMOD = /sbin/depmod DEPMOD = /sbin/depmod
KALLSYMS = scripts/kallsyms KALLSYMS = scripts/kallsyms
PERL = perl PERL = perl
@ -353,7 +391,8 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE export CPP AR NM STRIP OBJCOPY OBJDUMP
export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
@ -444,6 +483,11 @@ ifeq ($(config-targets),1)
include $(srctree)/arch/$(SRCARCH)/Makefile include $(srctree)/arch/$(SRCARCH)/Makefile
export KBUILD_DEFCONFIG KBUILD_KCONFIG export KBUILD_DEFCONFIG KBUILD_KCONFIG
# save ARCH & CROSS_COMPILE settings
$(shell mkdir -p include/generated && \
echo $(ARCH) > include/generated/kernel.arch && \
echo $(CROSS_COMPILE) > include/generated/kernel.cross)
config: scripts_basic outputmakefile FORCE config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux include/config $(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@ $(Q)$(MAKE) $(build)=scripts/kconfig $@
@ -571,6 +615,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
# revert to pre-gcc-4.4 behaviour of .eh_frame # revert to pre-gcc-4.4 behaviour of .eh_frame
KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
# conserve stack if available
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
# But warn user when we do so # But warn user when we do so
warn-assign = \ warn-assign = \
@ -591,12 +638,12 @@ endif
# Use --build-id when available. # Use --build-id when available.
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
$(call ld-option, -Wl$(comma)--build-id,)) $(call cc-ldoption, -Wl$(comma)--build-id,))
LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
ifeq ($(CONFIG_STRIP_ASM_SYMS),y) ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += -X LDFLAGS_vmlinux += $(call ld-option, -X,)
endif endif
# Default kernel image to build when no specific target is given. # Default kernel image to build when no specific target is given.
@ -980,11 +1027,6 @@ prepare0: archprepare FORCE
# All the preparing.. # All the preparing..
prepare: prepare0 prepare: prepare0
# Leave this as default for preprocessing vmlinux.lds.S, which is now
# done in arch/$(ARCH)/kernel/Makefile
export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
# The asm symlink changes when $(ARCH) changes. # The asm symlink changes when $(ARCH) changes.
# Detect this and ask user to run make mrproper # Detect this and ask user to run make mrproper
# If asm is a stale symlink (point to dir that does not exist) remove it # If asm is a stale symlink (point to dir that does not exist) remove it

View File

@ -14,7 +14,7 @@ LDFLAGS_vmlinux :=-p --no-undefined -X
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
LDFLAGS_vmlinux += --be8 LDFLAGS_vmlinux += --be8
endif endif
CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
GZFLAGS :=-9 GZFLAGS :=-9
#KBUILD_CFLAGS +=-pipe #KBUILD_CFLAGS +=-pipe
@ -279,7 +279,7 @@ define archhelp
echo ' (supply initrd image via make variable INITRD=<path>)' echo ' (supply initrd image via make variable INITRD=<path>)'
echo ' install - Install uncompressed kernel' echo ' install - Install uncompressed kernel'
echo ' zinstall - Install compressed kernel' echo ' zinstall - Install compressed kernel'
echo ' Install using (your) ~/bin/installkernel or' echo ' Install using (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) /sbin/installkernel or' echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH) and run lilo' echo ' install to $$(INSTALL_PATH) and run lilo'
endef endef

View File

@ -21,8 +21,8 @@
# #
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
if [ "$(basename $2)" = "zImage" ]; then if [ "$(basename $2)" = "zImage" ]; then
# Compressed install # Compressed install

View File

@ -2,6 +2,7 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET)
AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
ifdef CONFIG_DYNAMIC_FTRACE ifdef CONFIG_DYNAMIC_FTRACE

View File

@ -24,8 +24,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* *
* The things we do for performance.. * The things we do for performance..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -18,8 +18,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
/* /*
* Initial thread structure. Must be aligned on an 8192-byte boundary. * Initial thread structure. Must be aligned on an 8192-byte boundary.
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -24,11 +24,9 @@
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/sections.h> #include <asm/sections.h>
#define __page_aligned __attribute__((section(".data.page_aligned")))
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned; pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_data;
struct page *empty_zero_page; struct page *empty_zero_page;
EXPORT_SYMBOL(empty_zero_page); EXPORT_SYMBOL(empty_zero_page);

View File

@ -155,7 +155,7 @@ define archhelp
echo '* vmImage.gz - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.gz)' echo '* vmImage.gz - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.gz)'
echo ' vmImage.lzma - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzma)' echo ' vmImage.lzma - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzma)'
echo ' install - Install kernel using' echo ' install - Install kernel using'
echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or' echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or' echo ' (distribution) PATH: $(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH)' echo ' install to $$(INSTALL_PATH)'
endef endef

View File

@ -36,9 +36,9 @@ verify "$3"
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if which ${CROSS_COMPILE}installkernel >/dev/null 2>&1; then if which ${INSTALLKERNEL} >/dev/null 2>&1; then
exec ${CROSS_COMPILE}installkernel "$@" exec ${INSTALLKERNEL} "$@"
fi fi
# Default install - same as make zlilo # Default install - same as make zlilo

View File

@ -42,8 +42,6 @@ LD = $(CROSS_COMPILE)ld -mcrislinux
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc) KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc) KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
KBUILD_CPPFLAGS += $(inc) KBUILD_CPPFLAGS += $(inc)

View File

@ -3,6 +3,7 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
CPPFLAGS_vmlinux.lds := -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
extra-y := vmlinux.lds extra-y := vmlinux.lds
obj-y := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o obj-y := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o

View File

@ -45,8 +45,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -19,8 +19,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -31,7 +31,6 @@ EXPORT_SYMBOL(init_task);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };

View File

@ -21,8 +21,8 @@
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
# Default install - same as make zlilo # Default install - same as make zlilo

View File

@ -10,7 +10,7 @@ quiet_cmd_gate = GATE $@
cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@
GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \ GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv) $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate) $(call if_changed,gate)

View File

@ -33,7 +33,8 @@ union {
struct thread_info thread_info; struct thread_info thread_info;
} s; } s;
unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)]; unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)];
} init_task_mem asm ("init_task") __attribute__((section(".data.init_task"))) = {{ } init_task_mem asm ("init_task") __init_task_data =
{{
.task = INIT_TASK(init_task_mem.s.task), .task = INIT_TASK(init_task_mem.s.task),
.thread_info = INIT_THREAD_INFO(init_task_mem.s.task) .thread_info = INIT_THREAD_INFO(init_task_mem.s.task)
}}; }};

View File

@ -24,8 +24,8 @@
# User may have a custom install script # User may have a custom install script
if [ -x /sbin/installkernel ]; then if [ -x /sbin/${INSTALLKERNEL} ]; then
exec /sbin/installkernel "$@" exec /sbin/${INSTALLKERNEL} "$@"
fi fi
if [ "$2" = "zImage" ]; then if [ "$2" = "zImage" ]; then

View File

@ -20,8 +20,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -33,8 +33,8 @@ verify "$3"
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
# Default install - same as make zlilo # Default install - same as make zlilo

View File

@ -42,9 +42,9 @@
*/ */
static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
union thread_union init_thread_union union thread_union init_thread_union __init_task_data
__attribute__((section(".data.init_task"), aligned(THREAD_SIZE))) __attribute__((aligned(THREAD_SIZE))) =
= { INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* initial task structure */ /* initial task structure */
struct task_struct init_task = INIT_TASK(init_task); struct task_struct init_task = INIT_TASK(init_task);

View File

@ -31,7 +31,6 @@ EXPORT_SYMBOL(init_task);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };

View File

@ -19,8 +19,7 @@
static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
struct task_struct init_task = INIT_TASK(init_task); struct task_struct init_task = INIT_TASK(init_task);

View File

@ -627,16 +627,6 @@ endif
cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
drivers-$(CONFIG_PCI) += arch/mips/pci/ drivers-$(CONFIG_PCI) += arch/mips/pci/
ifdef CONFIG_32BIT
ifdef CONFIG_CPU_LITTLE_ENDIAN
JIFFIES = jiffies_64
else
JIFFIES = jiffies_64 + 4
endif
else
JIFFIES = jiffies_64
endif
# #
# Automatically detect the build format. By default we choose # Automatically detect the build format. By default we choose
# the elf format according to the load address. # the elf format according to the load address.
@ -660,8 +650,9 @@ ifdef CONFIG_64BIT
endif endif
KBUILD_AFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y)
KBUILD_CFLAGS += $(cflags-y) \ KBUILD_CFLAGS += $(cflags-y)
-D"VMLINUX_LOAD_ADDRESS=$(load-y)" KBUILD_CPPFLAGS += -D"VMLINUX_LOAD_ADDRESS=$(load-y)"
KBUILD_CPPFLAGS += -D"DATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)"
LDFLAGS += -m $(ld-emul) LDFLAGS += -m $(ld-emul)
@ -676,18 +667,6 @@ endif
OBJCOPYFLAGS += --remove-section=.reginfo OBJCOPYFLAGS += --remove-section=.reginfo
#
# Choosing incompatible machines durings configuration will result in
# error messages during linking. Select a default linkscript if
# none has been choosen above.
#
CPPFLAGS_vmlinux.lds := \
$(KBUILD_CFLAGS) \
-D"LOADADDR=$(load-y)" \
-D"JIFFIES=$(JIFFIES)" \
-D"DATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)"
head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
libs-y += arch/mips/lib/ libs-y += arch/mips/lib/

View File

@ -21,9 +21,8 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* *
* The things we do for performance.. * The things we do for performance..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data
__attribute__((__section__(".data.init_task"), __attribute__((__aligned__(THREAD_SIZE))) =
__aligned__(THREAD_SIZE))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -10,7 +10,16 @@ PHDRS {
text PT_LOAD FLAGS(7); /* RWX */ text PT_LOAD FLAGS(7); /* RWX */
note PT_NOTE FLAGS(4); /* R__ */ note PT_NOTE FLAGS(4); /* R__ */
} }
jiffies = JIFFIES;
ifdef CONFIG_32BIT
ifdef CONFIG_CPU_LITTLE_ENDIAN
jiffies = jiffies_64;
else
jiffies = jiffies_64 + 4;
endif
else
jiffies = jiffies_64;
endif
SECTIONS SECTIONS
{ {
@ -29,7 +38,7 @@ SECTIONS
/* . = 0xa800000000300000; */ /* . = 0xa800000000300000; */
. = 0xffffffff80300000; . = 0xffffffff80300000;
#endif #endif
. = LOADADDR; . = VMLINUX_LOAD_ADDRESS;
/* read-only */ /* read-only */
_text = .; /* Text and read-only data */ _text = .; /* Text and read-only data */
.text : { .text : {

View File

@ -27,8 +27,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -118,8 +118,8 @@ define archhelp
@echo '* vmlinux - Uncompressed kernel image (./vmlinux)' @echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
@echo ' palo - Bootable image (./lifimage)' @echo ' palo - Bootable image (./lifimage)'
@echo ' install - Install kernel using' @echo ' install - Install kernel using'
@echo ' (your) ~/bin/installkernel or' @echo ' (your) ~/bin/$(INSTALLKERNEL) or'
@echo ' (distribution) /sbin/installkernel or' @echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
@echo ' copy to $$(INSTALL_PATH)' @echo ' copy to $$(INSTALL_PATH)'
endef endef

View File

@ -21,8 +21,8 @@
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
# Default install # Default install

View File

@ -43,8 +43,8 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data
__attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = __attribute__((aligned(128))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
#if PT_NLEVELS == 3 #if PT_NLEVELS == 3

View File

@ -158,8 +158,6 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
# Default to zImage, override when needed # Default to zImage, override when needed
all: zImage all: zImage
CPPFLAGS_vmlinux.lds := -Upowerpc
BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.% BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
PHONY += $(BOOT_TARGETS) PHONY += $(BOOT_TARGETS)
@ -182,8 +180,8 @@ define archhelp
@echo ' simpleImage.<dt> - Firmware independent image.' @echo ' simpleImage.<dt> - Firmware independent image.'
@echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)'
@echo ' install - Install kernel using' @echo ' install - Install kernel using'
@echo ' (your) ~/bin/installkernel or' @echo ' (your) ~/bin/$(INSTALLKERNEL) or'
@echo ' (distribution) /sbin/installkernel or' @echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
@echo ' install to $$(INSTALL_PATH) and run lilo' @echo ' install to $$(INSTALL_PATH) and run lilo'
@echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs'
@echo '' @echo ''

View File

@ -23,8 +23,8 @@ set -e
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
# Default install # Default install

View File

@ -16,8 +16,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -13,6 +13,7 @@
#include <linux/kexec.h> #include <linux/kexec.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/thread_info.h> #include <linux/thread_info.h>
#include <linux/init_task.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/page.h> #include <asm/page.h>
@ -249,8 +250,8 @@ static void kexec_prepare_cpus(void)
* We could use a smaller stack if we don't care about anything using * We could use a smaller stack if we don't care about anything using
* current, but that audit has not been performed. * current, but that audit has not been performed.
*/ */
static union thread_union kexec_stack static union thread_union kexec_stack __init_task_data =
__attribute__((__section__(".data.init_task"))) = { }; { };
/* Our assembly helper, in kexec_stub.S */ /* Our assembly helper, in kexec_stub.S */
extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start, extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,

View File

@ -1,3 +1,4 @@
/* /*
* Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp.
* <benh@kernel.crashing.org> * <benh@kernel.crashing.org>
@ -74,7 +75,7 @@ static int vdso_ready;
static union { static union {
struct vdso_data data; struct vdso_data data;
u8 page[PAGE_SIZE]; u8 page[PAGE_SIZE];
} vdso_data_store __attribute__((__section__(".data.page_aligned"))); } vdso_data_store __page_aligned_data;
struct vdso_data *vdso_data = &vdso_data_store.data; struct vdso_data *vdso_data = &vdso_data_store.data;
/* Format of the patch table */ /* Format of the patch table */

View File

@ -16,7 +16,7 @@ GCOV_PROFILE := n
EXTRA_CFLAGS := -shared -fno-common -fno-builtin EXTRA_CFLAGS := -shared -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv) $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
EXTRA_AFLAGS := -D__VDSO32__ -s EXTRA_AFLAGS := -D__VDSO32__ -s
obj-y += vdso32_wrapper.o obj-y += vdso32_wrapper.o

View File

@ -1,7 +1,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/linkage.h>
#include <asm/page.h> #include <asm/page.h>
.section ".data.page_aligned" __PAGE_ALIGNED_DATA
.globl vdso32_start, vdso32_end .globl vdso32_start, vdso32_end
.balign PAGE_SIZE .balign PAGE_SIZE

View File

@ -11,7 +11,7 @@ GCOV_PROFILE := n
EXTRA_CFLAGS := -shared -fno-common -fno-builtin EXTRA_CFLAGS := -shared -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv) $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
EXTRA_AFLAGS := -D__VDSO64__ -s EXTRA_AFLAGS := -D__VDSO64__ -s
obj-y += vdso64_wrapper.o obj-y += vdso64_wrapper.o

View File

@ -1,7 +1,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/linkage.h>
#include <asm/page.h> #include <asm/page.h>
.section ".data.page_aligned" __PAGE_ALIGNED_DATA
.globl vdso64_start, vdso64_end .globl vdso64_start, vdso64_end
.balign PAGE_SIZE .balign PAGE_SIZE

View File

@ -21,8 +21,8 @@
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
# Default install - same as make zlilo # Default install - same as make zlilo

View File

@ -25,8 +25,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -75,7 +75,7 @@ __setup("vdso=", vdso_setup);
static union { static union {
struct vdso_data data; struct vdso_data data;
u8 page[PAGE_SIZE]; u8 page[PAGE_SIZE];
} vdso_data_store __attribute__((__section__(".data.page_aligned"))); } vdso_data_store __page_aligned_data;
struct vdso_data *vdso_data = &vdso_data_store.data; struct vdso_data *vdso_data = &vdso_data_store.data;
/* /*

View File

@ -13,7 +13,7 @@ KBUILD_AFLAGS_31 += -m31 -s
KBUILD_CFLAGS_31 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_31 := $(filter-out -m64,$(KBUILD_CFLAGS))
KBUILD_CFLAGS_31 += -m31 -fPIC -shared -fno-common -fno-builtin KBUILD_CFLAGS_31 += -m31 -fPIC -shared -fno-common -fno-builtin
KBUILD_CFLAGS_31 += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ KBUILD_CFLAGS_31 += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv) $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
$(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_31) $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_31)
$(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_31) $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_31)

View File

@ -1,7 +1,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/linkage.h>
#include <asm/page.h> #include <asm/page.h>
.section ".data.page_aligned" __PAGE_ALIGNED_DATA
.globl vdso32_start, vdso32_end .globl vdso32_start, vdso32_end
.balign PAGE_SIZE .balign PAGE_SIZE

View File

@ -13,7 +13,7 @@ KBUILD_AFLAGS_64 += -m64 -s
KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin
KBUILD_CFLAGS_64 += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ KBUILD_CFLAGS_64 += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv) $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
$(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64) $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
$(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64) $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64)

View File

@ -1,7 +1,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/linkage.h>
#include <asm/page.h> #include <asm/page.h>
.section ".data.page_aligned" __PAGE_ALIGNED_DATA
.globl vdso64_start, vdso64_end .globl vdso64_start, vdso64_end
.balign PAGE_SIZE .balign PAGE_SIZE

View File

@ -34,8 +34,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"), __aligned__(THREAD_SIZE))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -23,8 +23,8 @@
# User may have a custom install script # User may have a custom install script
if [ -x /sbin/installkernel ]; then if [ -x /sbin/${INSTALLKERNEL} ]; then
exec /sbin/installkernel "$@" exec /sbin/${INSTALLKERNEL} "$@"
fi fi
if [ "$2" = "zImage" ]; then if [ "$2" = "zImage" ]; then

View File

@ -17,8 +17,7 @@ struct pt_regs fake_swapper_regs;
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -165,11 +165,9 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
} }
#ifdef CONFIG_IRQSTACKS #ifdef CONFIG_IRQSTACKS
static char softirq_stack[NR_CPUS * THREAD_SIZE] static char softirq_stack[NR_CPUS * THREAD_SIZE] __page_aligned_bss;
__attribute__((__section__(".bss.page_aligned")));
static char hardirq_stack[NR_CPUS * THREAD_SIZE] static char hardirq_stack[NR_CPUS * THREAD_SIZE] __page_aligned_bss;
__attribute__((__section__(".bss.page_aligned")));
/* /*
* allocate per-cpu stacks for hardirq and for softirq processing * allocate per-cpu stacks for hardirq and for softirq processing

View File

@ -15,7 +15,7 @@ quiet_cmd_syscall = SYSCALL $@
export CPPFLAGS_vsyscall.lds += -P -C -Ush export CPPFLAGS_vsyscall.lds += -P -C -Ush
vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv) $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags) SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags)

View File

@ -31,7 +31,6 @@ export BITS := 32
#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7 #KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
KBUILD_AFLAGS += -m32 KBUILD_AFLAGS += -m32
CPPFLAGS_vmlinux.lds += -m32
#LDFLAGS_vmlinux = -N -Ttext 0xf0004000 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000
# Since 2.5.40, the first stage is left not btfix-ed. # Since 2.5.40, the first stage is left not btfix-ed.
@ -45,9 +44,6 @@ else
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64 CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
# Undefine sparc when processing vmlinux.lds - it is used
# And teach CPP we are doing 64 bit builds (for this case)
CPPFLAGS_vmlinux.lds += -m64 -Usparc
LDFLAGS := -m elf64_sparc LDFLAGS := -m elf64_sparc
export BITS := 64 export BITS := 64

View File

@ -7,6 +7,10 @@ ccflags-y := -Werror
extra-y := head_$(BITS).o extra-y := head_$(BITS).o
extra-y += init_task.o extra-y += init_task.o
# Undefine sparc when processing vmlinux.lds - it is used
# And teach CPP we are doing $(BITS) builds (for this case)
CPPFLAGS_vmlinux.lds := -Usparc -m$(BITS)
extra-y += vmlinux.lds extra-y += vmlinux.lds
obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o

View File

@ -18,6 +18,5 @@ EXPORT_SYMBOL(init_task);
* If this is not aligned on a 8k boundry, then you should change code * If this is not aligned on a 8k boundry, then you should change code
* in etrap.S which assumes it. * in etrap.S which assumes it.
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((section (".data.init_task"))) { INIT_THREAD_INFO(init_task) };
= { INIT_THREAD_INFO(init_task) };

View File

@ -96,11 +96,10 @@ CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,)
$(call cc-option, -fno-stack-protector,) \ $(call cc-option, -fno-stack-protector,) \
$(call cc-option, -fno-stack-protector-all,) $(call cc-option, -fno-stack-protector-all,)
CONFIG_KERNEL_STACK_ORDER ?= 2 # Options used by linker script
STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) export LDS_START := $(START)
export LDS_ELF_ARCH := $(ELF_ARCH)
CPPFLAGS_vmlinux.lds = -U$(SUBARCH) -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ export LDS_ELF_FORMAT := $(ELF_FORMAT)
-DELF_FORMAT="$(ELF_FORMAT)" -DKERNEL_STACK_SIZE=$(STACK_SIZE)
# The wrappers will select whether using "malloc" or the kernel allocator. # The wrappers will select whether using "malloc" or the kernel allocator.
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc

View File

@ -3,6 +3,9 @@
# Licensed under the GPL # Licensed under the GPL
# #
CPPFLAGS_vmlinux.lds := -U$(SUBARCH) -DSTART=$(LDS_START) \
-DELF_ARCH=$(LDS_ELF_ARCH) \
-DELF_FORMAT=$(LDS_ELF_FORMAT)
extra-y := vmlinux.lds extra-y := vmlinux.lds
clean-files := clean-files :=

View File

@ -30,8 +30,7 @@ EXPORT_SYMBOL(init_task);
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
union thread_union cpu0_irqstack union thread_union cpu0_irqstack

View File

@ -1,3 +1,6 @@
KERNEL_STACK_SIZE = 4096 * (1 << CONFIG_KERNEL_STACK_ORDER);
#ifdef CONFIG_LD_SCRIPT_STATIC #ifdef CONFIG_LD_SCRIPT_STATIC
#include "uml.lds.S" #include "uml.lds.S"
#else #else

View File

@ -179,8 +179,8 @@ archclean:
define archhelp define archhelp
echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
echo ' install - Install kernel using' echo ' install - Install kernel using'
echo ' (your) ~/bin/installkernel or' echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) /sbin/installkernel or' echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH) and run lilo' echo ' install to $$(INSTALL_PATH) and run lilo'
echo ' fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)' echo ' fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
echo ' fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)' echo ' fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'

View File

@ -33,8 +33,8 @@ verify "$3"
# User may have a custom install script # User may have a custom install script
if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
# Default install - same as make zlilo # Default install - same as make zlilo

View File

@ -1,6 +1,8 @@
#ifndef _ASM_X86_CACHE_H #ifndef _ASM_X86_CACHE_H
#define _ASM_X86_CACHE_H #define _ASM_X86_CACHE_H
#include <linux/linkage.h>
/* L1 cache line size */ /* L1 cache line size */
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
@ -13,7 +15,7 @@
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define __cacheline_aligned_in_smp \ #define __cacheline_aligned_in_smp \
__attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \
__attribute__((__section__(".data.page_aligned"))) __page_aligned_data
#endif #endif
#endif #endif

View File

@ -608,7 +608,7 @@ ENTRY(initial_code)
/* /*
* BSS section * BSS section
*/ */
.section ".bss.page_aligned","wa" __PAGE_ALIGNED_BSS
.align PAGE_SIZE_asm .align PAGE_SIZE_asm
#ifdef CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
swapper_pg_pmd: swapper_pg_pmd:
@ -626,7 +626,7 @@ ENTRY(empty_zero_page)
* This starts the data section. * This starts the data section.
*/ */
#ifdef CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
.section ".data.page_aligned","wa" __PAGE_ALIGNED_DATA
/* Page-aligned for the benefit of paravirt? */ /* Page-aligned for the benefit of paravirt? */
.align PAGE_SIZE_asm .align PAGE_SIZE_asm
ENTRY(swapper_pg_dir) ENTRY(swapper_pg_dir)

View File

@ -418,7 +418,7 @@ ENTRY(phys_base)
ENTRY(idt_table) ENTRY(idt_table)
.skip IDT_ENTRIES * 16 .skip IDT_ENTRIES * 16
.section .bss.page_aligned, "aw", @nobits __PAGE_ALIGNED_BSS
.align PAGE_SIZE .align PAGE_SIZE
ENTRY(empty_zero_page) ENTRY(empty_zero_page)
.skip PAGE_SIZE .skip PAGE_SIZE

View File

@ -20,8 +20,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
* way process stacks are handled. This is done by having a special * way process stacks are handled. This is done by having a special
* "init_task" linker map entry.. * "init_task" linker map entry..
*/ */
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
/* /*

View File

@ -122,7 +122,7 @@ quiet_cmd_vdso = VDSO $@
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^)
VDSO_LDFLAGS = -fPIC -shared $(call ld-option, -Wl$(comma)--hash-style=sysv) VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
GCOV_PROFILE := n GCOV_PROFILE := n
# #

View File

@ -27,7 +27,8 @@ sed-y = -e 's/(\(\.[a-z]*it\|\.ref\|\)\.text)/(\1.literal \1.text)/g' \
-e 's/(\(\.text\.[a-z]*\))/(\1.literal \1)/g' -e 's/(\(\.text\.[a-z]*\))/(\1.literal \1)/g'
quiet_cmd__cpp_lds_S = LDS $@ quiet_cmd__cpp_lds_S = LDS $@
cmd__cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ $< | sed $(sed-y) >$@ cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa -D__ASSEMBLY__ $< \
| sed $(sed-y) >$@
$(obj)/vmlinux.lds: $(src)/vmlinux.lds.S FORCE $(obj)/vmlinux.lds: $(src)/vmlinux.lds.S FORCE
$(call if_changed_dep,_cpp_lds_S) $(call if_changed_dep,_cpp_lds_S)

View File

@ -235,7 +235,7 @@ should_never_return:
* BSS section * BSS section
*/ */
.section ".bss.page_aligned", "w" __PAGE_ALIGNED_BSS
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
ENTRY(swapper_pg_dir) ENTRY(swapper_pg_dir)
.fill PAGE_SIZE, 1, 0 .fill PAGE_SIZE, 1, 0

View File

@ -23,8 +23,7 @@
static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
union thread_union init_thread_union union thread_union init_thread_union __init_task_data =
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) }; { INIT_THREAD_INFO(init_task) };
struct task_struct init_task = INIT_TASK(init_task); struct task_struct init_task = INIT_TASK(init_task);

View File

@ -57,6 +57,7 @@
#ifdef __ASSEMBLY__ #ifdef __ASSEMBLY__
#ifndef LINKER_SCRIPT
#define ALIGN __ALIGN #define ALIGN __ALIGN
#define ALIGN_STR __ALIGN_STR #define ALIGN_STR __ALIGN_STR
@ -66,6 +67,7 @@
ALIGN; \ ALIGN; \
name: name:
#endif #endif
#endif /* LINKER_SCRIPT */
#ifndef WEAK #ifndef WEAK
#define WEAK(name) \ #define WEAK(name) \

View File

@ -1006,14 +1006,6 @@ config SLUB_DEBUG
SLUB sysfs support. /sys/slab will not exist and there will be SLUB sysfs support. /sys/slab will not exist and there will be
no support for cache validation etc. no support for cache validation etc.
config STRIP_ASM_SYMS
bool "Strip assembler-generated symbols during link"
default n
help
Strip internal assembler-generated symbols during a link (symbols
that look like '.Lxxx') so they don't pollute the output of
get_wchan() and suchlike.
config COMPAT_BRK config COMPAT_BRK
bool "Disable heap randomization" bool "Disable heap randomization"
default y default y

View File

@ -50,6 +50,14 @@ config MAGIC_SYSRQ
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does. unless you really know what this hack does.
config STRIP_ASM_SYMS
bool "Strip assembler-generated symbols during link"
default n
help
Strip internal assembler-generated symbols during a link (symbols
that look like '.Lxxx') so they don't pollute the output of
get_wchan() and suchlike.
config UNUSED_SYMBOLS config UNUSED_SYMBOLS
bool "Enable unused/obsolete exported symbols" bool "Enable unused/obsolete exported symbols"
default y if X86 default y if X86

View File

@ -83,11 +83,12 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
# is automatically cleaned up. # is automatically cleaned up.
try-run = $(shell set -e; \ try-run = $(shell set -e; \
TMP="$(TMPOUT).$$$$.tmp"; \ TMP="$(TMPOUT).$$$$.tmp"; \
TMPO="$(TMPOUT).$$$$.o"; \
if ($(1)) >/dev/null 2>&1; \ if ($(1)) >/dev/null 2>&1; \
then echo "$(2)"; \ then echo "$(2)"; \
else echo "$(3)"; \ else echo "$(3)"; \
fi; \ fi; \
rm -f "$$TMP") rm -f "$$TMP" "$$TMPO")
# as-option # as-option
# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
@ -105,12 +106,12 @@ as-instr = $(call try-run,\
# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
cc-option = $(call try-run,\ cc-option = $(call try-run,\
$(CC) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2)) $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2))
# cc-option-yn # cc-option-yn
# Usage: flag := $(call cc-option-yn,-march=winchip-c6) # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
cc-option-yn = $(call try-run,\ cc-option-yn = $(call try-run,\
$(CC) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n) $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n)
# cc-option-align # cc-option-align
# Prefix align with either -falign or -malign # Prefix align with either -falign or -malign
@ -130,11 +131,16 @@ cc-fullversion = $(shell $(CONFIG_SHELL) \
# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3)) cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3))
# ld-option # cc-ldoption
# Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both) # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
ld-option = $(call try-run,\ cc-ldoption = $(call try-run,\
$(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2))
# ld-option
# Usage: LDFLAGS += $(call ld-option, -X)
ld-option = $(call try-run,\
$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
###### ######
### ###

View File

@ -206,7 +206,7 @@ cmd_modversions = \
endif endif
ifdef CONFIG_FTRACE_MCOUNT_RECORD ifdef CONFIG_FTRACE_MCOUNT_RECORD
cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
"$(if $(CONFIG_64BIT),64,32)" \ "$(if $(CONFIG_64BIT),64,32)" \
"$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
"$(if $(part-of-module),1,0)" "$(@)"; "$(if $(part-of-module),1,0)" "$(@)";
@ -216,6 +216,7 @@ define rule_cc_o_c
$(call echo-cmd,checksrc) $(cmd_checksrc) \ $(call echo-cmd,checksrc) $(cmd_checksrc) \
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
$(cmd_modversions) \ $(cmd_modversions) \
$(call echo-cmd,record_mcount) \
$(cmd_record_mcount) \ $(cmd_record_mcount) \
scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
$(dot-target).tmp; \ $(dot-target).tmp; \
@ -269,7 +270,8 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always)
# Linker scripts preprocessor (.lds.S -> .lds) # Linker scripts preprocessor (.lds.S -> .lds)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
quiet_cmd_cpp_lds_S = LDS $@ quiet_cmd_cpp_lds_S = LDS $@
cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -C -U$(ARCH) \
-D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
$(obj)/%.lds: $(src)/%.lds.S FORCE $(obj)/%.lds: $(src)/%.lds.S FORCE
$(call if_changed_dep,cpp_lds_S) $(call if_changed_dep,cpp_lds_S)

View File

@ -71,7 +71,7 @@ FILELINE * docsection;
static char *srctree, *kernsrctree; static char *srctree, *kernsrctree;
void usage (void) static void usage (void)
{ {
fprintf(stderr, "Usage: docproc {doc|depend} file\n"); fprintf(stderr, "Usage: docproc {doc|depend} file\n");
fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
@ -84,7 +84,7 @@ void usage (void)
/* /*
* Execute kernel-doc with parameters given in svec * Execute kernel-doc with parameters given in svec
*/ */
void exec_kernel_doc(char **svec) static void exec_kernel_doc(char **svec)
{ {
pid_t pid; pid_t pid;
int ret; int ret;
@ -129,7 +129,7 @@ struct symfile
struct symfile symfilelist[MAXFILES]; struct symfile symfilelist[MAXFILES];
int symfilecnt = 0; int symfilecnt = 0;
void add_new_symbol(struct symfile *sym, char * symname) static void add_new_symbol(struct symfile *sym, char * symname)
{ {
sym->symbollist = sym->symbollist =
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
@ -137,14 +137,14 @@ void add_new_symbol(struct symfile *sym, char * symname)
} }
/* Add a filename to the list */ /* Add a filename to the list */
struct symfile * add_new_file(char * filename) static struct symfile * add_new_file(char * filename)
{ {
symfilelist[symfilecnt++].filename = strdup(filename); symfilelist[symfilecnt++].filename = strdup(filename);
return &symfilelist[symfilecnt - 1]; return &symfilelist[symfilecnt - 1];
} }
/* Check if file already are present in the list */ /* Check if file already are present in the list */
struct symfile * filename_exist(char * filename) static struct symfile * filename_exist(char * filename)
{ {
int i; int i;
for (i=0; i < symfilecnt; i++) for (i=0; i < symfilecnt; i++)
@ -157,20 +157,20 @@ struct symfile * filename_exist(char * filename)
* List all files referenced within the template file. * List all files referenced within the template file.
* Files are separated by tabs. * Files are separated by tabs.
*/ */
void adddep(char * file) { printf("\t%s", file); } static void adddep(char * file) { printf("\t%s", file); }
void adddep2(char * file, char * line) { line = line; adddep(file); } static void adddep2(char * file, char * line) { line = line; adddep(file); }
void noaction(char * line) { line = line; } static void noaction(char * line) { line = line; }
void noaction2(char * file, char * line) { file = file; line = line; } static void noaction2(char * file, char * line) { file = file; line = line; }
/* Echo the line without further action */ /* Echo the line without further action */
void printline(char * line) { printf("%s", line); } static void printline(char * line) { printf("%s", line); }
/* /*
* Find all symbols in filename that are exported with EXPORT_SYMBOL & * Find all symbols in filename that are exported with EXPORT_SYMBOL &
* EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly). * EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly).
* All symbols located are stored in symfilelist. * All symbols located are stored in symfilelist.
*/ */
void find_export_symbols(char * filename) static void find_export_symbols(char * filename)
{ {
FILE * fp; FILE * fp;
struct symfile *sym; struct symfile *sym;
@ -227,7 +227,7 @@ void find_export_symbols(char * filename)
* intfunc uses -nofunction * intfunc uses -nofunction
* extfunc uses -function * extfunc uses -function
*/ */
void docfunctions(char * filename, char * type) static void docfunctions(char * filename, char * type)
{ {
int i,j; int i,j;
int symcnt = 0; int symcnt = 0;
@ -258,15 +258,15 @@ void docfunctions(char * filename, char * type)
fflush(stdout); fflush(stdout);
free(vec); free(vec);
} }
void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); } static void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); }
void extfunc(char * filename) { docfunctions(filename, FUNCTION); } static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
/* /*
* Document specific function(s) in a file. * Document specific function(s) in a file.
* Call kernel-doc with the following parameters: * Call kernel-doc with the following parameters:
* kernel-doc -docbook -function function1 [-function function2] * kernel-doc -docbook -function function1 [-function function2]
*/ */
void singfunc(char * filename, char * line) static void singfunc(char * filename, char * line)
{ {
char *vec[200]; /* Enough for specific functions */ char *vec[200]; /* Enough for specific functions */
int i, idx = 0; int i, idx = 0;
@ -297,7 +297,7 @@ void singfunc(char * filename, char * line)
* Call kernel-doc with the following parameters: * Call kernel-doc with the following parameters:
* kernel-doc -docbook -function "doc section" filename * kernel-doc -docbook -function "doc section" filename
*/ */
void docsect(char *filename, char *line) static void docsect(char *filename, char *line)
{ {
char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */
char *s; char *s;
@ -324,7 +324,7 @@ void docsect(char *filename, char *line)
* 5) Lines containing !P * 5) Lines containing !P
* 6) Default lines - lines not matching the above * 6) Default lines - lines not matching the above
*/ */
void parse_file(FILE *infile) static void parse_file(FILE *infile)
{ {
char line[MAXLINESZ]; char line[MAXLINESZ];
char * s; char * s;

View File

@ -124,7 +124,7 @@ char *target;
char *depfile; char *depfile;
char *cmdline; char *cmdline;
void usage(void) static void usage(void)
{ {
fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n"); fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
exit(1); exit(1);
@ -133,7 +133,7 @@ void usage(void)
/* /*
* Print out the commandline prefixed with cmd_<target filename> := * Print out the commandline prefixed with cmd_<target filename> :=
*/ */
void print_cmdline(void) static void print_cmdline(void)
{ {
printf("cmd_%s := %s\n\n", target, cmdline); printf("cmd_%s := %s\n\n", target, cmdline);
} }
@ -146,7 +146,7 @@ int len_config = 0;
* Grow the configuration string to a desired length. * Grow the configuration string to a desired length.
* Usually the first growth is plenty. * Usually the first growth is plenty.
*/ */
void grow_config(int len) static void grow_config(int len)
{ {
while (len_config + len > size_config) { while (len_config + len > size_config) {
if (size_config == 0) if (size_config == 0)
@ -162,7 +162,7 @@ void grow_config(int len)
/* /*
* Lookup a value in the configuration string. * Lookup a value in the configuration string.
*/ */
int is_defined_config(const char * name, int len) static int is_defined_config(const char * name, int len)
{ {
const char * pconfig; const char * pconfig;
const char * plast = str_config + len_config - len; const char * plast = str_config + len_config - len;
@ -178,7 +178,7 @@ int is_defined_config(const char * name, int len)
/* /*
* Add a new value to the configuration string. * Add a new value to the configuration string.
*/ */
void define_config(const char * name, int len) static void define_config(const char * name, int len)
{ {
grow_config(len + 1); grow_config(len + 1);
@ -190,7 +190,7 @@ void define_config(const char * name, int len)
/* /*
* Clear the set of configuration strings. * Clear the set of configuration strings.
*/ */
void clear_config(void) static void clear_config(void)
{ {
len_config = 0; len_config = 0;
define_config("", 0); define_config("", 0);
@ -199,7 +199,7 @@ void clear_config(void)
/* /*
* Record the use of a CONFIG_* word. * Record the use of a CONFIG_* word.
*/ */
void use_config(char *m, int slen) static void use_config(char *m, int slen)
{ {
char s[PATH_MAX]; char s[PATH_MAX];
char *p; char *p;
@ -220,7 +220,7 @@ void use_config(char *m, int slen)
printf(" $(wildcard include/config/%s.h) \\\n", s); printf(" $(wildcard include/config/%s.h) \\\n", s);
} }
void parse_config_file(char *map, size_t len) static void parse_config_file(char *map, size_t len)
{ {
int *end = (int *) (map + len); int *end = (int *) (map + len);
/* start at +1, so that p can never be < map */ /* start at +1, so that p can never be < map */
@ -254,7 +254,7 @@ void parse_config_file(char *map, size_t len)
} }
/* test is s ends in sub */ /* test is s ends in sub */
int strrcmp(char *s, char *sub) static int strrcmp(char *s, char *sub)
{ {
int slen = strlen(s); int slen = strlen(s);
int sublen = strlen(sub); int sublen = strlen(sub);
@ -265,7 +265,7 @@ int strrcmp(char *s, char *sub)
return memcmp(s + slen - sublen, sub, sublen); return memcmp(s + slen - sublen, sub, sublen);
} }
void do_config_file(char *filename) static void do_config_file(char *filename)
{ {
struct stat st; struct stat st;
int fd; int fd;
@ -296,7 +296,7 @@ void do_config_file(char *filename)
close(fd); close(fd);
} }
void parse_dep_file(void *map, size_t len) static void parse_dep_file(void *map, size_t len)
{ {
char *m = map; char *m = map;
char *end = m + len; char *end = m + len;
@ -336,7 +336,7 @@ void parse_dep_file(void *map, size_t len)
printf("$(deps_%s):\n", target); printf("$(deps_%s):\n", target);
} }
void print_deps(void) static void print_deps(void)
{ {
struct stat st; struct stat st;
int fd; int fd;
@ -368,7 +368,7 @@ void print_deps(void)
close(fd); close(fd);
} }
void traps(void) static void traps(void)
{ {
static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
int *p = (int *)test; int *p = (int *)test;

View File

@ -21,7 +21,7 @@ static void usage(void)
* http://www.cse.yorku.ca/~oz/hash.html * http://www.cse.yorku.ca/~oz/hash.html
*/ */
unsigned int djb2_hash(char *str) static unsigned int djb2_hash(char *str)
{ {
unsigned long hash = 5381; unsigned long hash = 5381;
int c; int c;
@ -34,7 +34,7 @@ unsigned int djb2_hash(char *str)
return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1)); return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1));
} }
unsigned int r5_hash(char *str) static unsigned int r5_hash(char *str)
{ {
unsigned long hash = 0; unsigned long hash = 0;
int c; int c;

View File

@ -1,24 +1,85 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# checkincludes: Find files included more than once in (other) files. # checkincludes: find/remove files included more than once
#
# Copyright abandoned, 2000, Niels Kristian Bech Jensen <nkbj@image.dk>. # Copyright abandoned, 2000, Niels Kristian Bech Jensen <nkbj@image.dk>.
# Copyright 2009 Luis R. Rodriguez <mcgrof@gmail.com>
#
# This script checks for duplicate includes. It also has support
# to remove them in place. Note that this will not take into
# consideration macros so you should run this only if you know
# you do have real dups and do not have them under #ifdef's. You
# could also just review the results.
sub usage {
print "Usage: checkincludes.pl [-r]\n";
print "By default we just warn of duplicates\n";
print "To remove duplicated includes in place use -r\n";
exit 1;
}
my $remove = 0;
if ($#ARGV < 0) {
usage();
}
if ($#ARGV >= 1) {
if ($ARGV[0] =~ /^-/) {
if ($ARGV[0] eq "-r") {
$remove = 1;
shift;
} else {
usage();
}
}
}
foreach $file (@ARGV) { foreach $file (@ARGV) {
open(FILE, $file) or die "Cannot open $file: $!.\n"; open(FILE, $file) or die "Cannot open $file: $!.\n";
my %includedfiles = (); my %includedfiles = ();
my @file_lines = ();
while (<FILE>) { while (<FILE>) {
if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) {
++$includedfiles{$1}; ++$includedfiles{$1};
} }
push(@file_lines, $_);
} }
close(FILE);
if (!$remove) {
foreach $filename (keys %includedfiles) { foreach $filename (keys %includedfiles) {
if ($includedfiles{$filename} > 1) { if ($includedfiles{$filename} > 1) {
print "$file: $filename is included more than once.\n"; print "$file: $filename is included more than once.\n";
} }
} }
next;
}
open(FILE,">$file") || die("Cannot write to $file: $!");
my $dups = 0;
foreach (@file_lines) {
if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) {
foreach $filename (keys %includedfiles) {
if ($1 eq $filename) {
if ($includedfiles{$filename} > 1) {
$includedfiles{$filename}--;
$dups++;
} else {
print FILE $_;
}
}
}
} else {
print FILE $_;
}
}
if ($dups > 0) {
print "$file: removed $dups duplicate includes\n";
}
close(FILE); close(FILE);
} }

View File

@ -38,14 +38,14 @@ static int conf_cnt;
static char line[128]; static char line[128];
static struct menu *rootEntry; static struct menu *rootEntry;
static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); static void print_help(struct menu *menu)
static const char *get_help(struct menu *menu)
{ {
if (menu_has_help(menu)) struct gstr help = str_new();
return _(menu_get_help(menu));
else menu_get_ext_help(menu, &help);
return nohelp_text;
printf("\n%s\n", str_get(&help));
str_free(&help);
} }
static void strip(char *str) static void strip(char *str)
@ -121,7 +121,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
return 1; return 1;
} }
int conf_string(struct menu *menu) static int conf_string(struct menu *menu)
{ {
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
const char *def; const char *def;
@ -140,7 +140,7 @@ int conf_string(struct menu *menu)
case '?': case '?':
/* print help */ /* print help */
if (line[1] == '\n') { if (line[1] == '\n') {
printf("\n%s\n", get_help(menu)); print_help(menu);
def = NULL; def = NULL;
break; break;
} }
@ -220,7 +220,7 @@ static int conf_sym(struct menu *menu)
if (sym_set_tristate_value(sym, newval)) if (sym_set_tristate_value(sym, newval))
return 0; return 0;
help: help:
printf("\n%s\n", get_help(menu)); print_help(menu);
} }
} }
@ -307,7 +307,7 @@ static int conf_choice(struct menu *menu)
fgets(line, 128, stdin); fgets(line, 128, stdin);
strip(line); strip(line);
if (line[0] == '?') { if (line[0] == '?') {
printf("\n%s\n", get_help(menu)); print_help(menu);
continue; continue;
} }
if (!line[0]) if (!line[0])
@ -331,7 +331,7 @@ static int conf_choice(struct menu *menu)
if (!child) if (!child)
continue; continue;
if (line[strlen(line) - 1] == '?') { if (line[strlen(line) - 1] == '?') {
printf("\n%s\n", get_help(child)); print_help(child);
continue; continue;
} }
sym_set_choice_value(sym, child->sym); sym_set_choice_value(sym, child->sym);

View File

@ -560,7 +560,7 @@ int conf_write(const char *name)
return 0; return 0;
} }
int conf_split_config(void) static int conf_split_config(void)
{ {
const char *name; const char *name;
char path[128]; char path[128];

View File

@ -348,7 +348,7 @@ struct expr *expr_trans_bool(struct expr *e)
/* /*
* e1 || e2 -> ? * e1 || e2 -> ?
*/ */
struct expr *expr_join_or(struct expr *e1, struct expr *e2) static struct expr *expr_join_or(struct expr *e1, struct expr *e2)
{ {
struct expr *tmp; struct expr *tmp;
struct symbol *sym1, *sym2; struct symbol *sym1, *sym2;
@ -412,7 +412,7 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2)
return NULL; return NULL;
} }
struct expr *expr_join_and(struct expr *e1, struct expr *e2) static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
{ {
struct expr *tmp; struct expr *tmp;
struct symbol *sym1, *sym2; struct symbol *sym1, *sym2;
@ -1098,6 +1098,8 @@ void expr_fprint(struct expr *e, FILE *out)
static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str)
{ {
str_append((struct gstr*)data, str); str_append((struct gstr*)data, str);
if (sym)
str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym));
} }
void expr_gstr_print(struct expr *e, struct gstr *gs) void expr_gstr_print(struct expr *e, struct gstr *gs)

View File

@ -456,19 +456,9 @@ static void text_insert_help(struct menu *menu)
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
GtkTextIter start, end; GtkTextIter start, end;
const char *prompt = _(menu_get_prompt(menu)); const char *prompt = _(menu_get_prompt(menu));
gchar *name; struct gstr help = str_new();
const char *help;
help = menu_get_help(menu); menu_get_ext_help(menu, &help);
/* Gettextize if the help text not empty */
if ((help != 0) && (help[0] != 0))
help = _(help);
if (menu->sym && menu->sym->name)
name = g_strdup_printf(menu->sym->name);
else
name = g_strdup("");
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
gtk_text_buffer_get_bounds(buffer, &start, &end); gtk_text_buffer_get_bounds(buffer, &start, &end);
@ -478,14 +468,11 @@ static void text_insert_help(struct menu *menu)
gtk_text_buffer_get_end_iter(buffer, &end); gtk_text_buffer_get_end_iter(buffer, &end);
gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1, gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1,
NULL); NULL);
gtk_text_buffer_insert_at_cursor(buffer, " ", 1);
gtk_text_buffer_get_end_iter(buffer, &end);
gtk_text_buffer_insert_with_tags(buffer, &end, name, -1, tag1,
NULL);
gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2); gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2);
gtk_text_buffer_get_end_iter(buffer, &end); gtk_text_buffer_get_end_iter(buffer, &end);
gtk_text_buffer_insert_with_tags(buffer, &end, help, -1, tag2, gtk_text_buffer_insert_with_tags(buffer, &end, str_get(&help), -1, tag2,
NULL); NULL);
str_free(&help);
} }

View File

@ -547,7 +547,7 @@
<property name="headers_visible">True</property> <property name="headers_visible">True</property>
<property name="rules_hint">False</property> <property name="rules_hint">False</property>
<property name="reorderable">False</property> <property name="reorderable">False</property>
<property name="enable_search">True</property> <property name="enable_search">False</property>
<signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:58:22 GMT"/> <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:58:22 GMT"/>
<signal name="button_press_event" handler="on_treeview1_button_press_event" last_modification_time="Sun, 12 Jan 2003 16:03:52 GMT"/> <signal name="button_press_event" handler="on_treeview1_button_press_event" last_modification_time="Sun, 12 Jan 2003 16:03:52 GMT"/>
<signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 16:11:44 GMT"/> <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 16:11:44 GMT"/>
@ -582,7 +582,7 @@
<property name="headers_visible">True</property> <property name="headers_visible">True</property>
<property name="rules_hint">False</property> <property name="rules_hint">False</property>
<property name="reorderable">False</property> <property name="reorderable">False</property>
<property name="enable_search">True</property> <property name="enable_search">False</property>
<signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:57:55 GMT"/> <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:57:55 GMT"/>
<signal name="button_press_event" handler="on_treeview2_button_press_event" last_modification_time="Sun, 12 Jan 2003 15:57:58 GMT"/> <signal name="button_press_event" handler="on_treeview2_button_press_event" last_modification_time="Sun, 12 Jan 2003 15:57:58 GMT"/>
<signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 15:58:01 GMT"/> <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 15:58:01 GMT"/>

View File

@ -166,7 +166,7 @@ static int message__add(const char *msg, char *option, char *file, int lineno)
return rc; return rc;
} }
void menu_build_message_list(struct menu *menu) static void menu_build_message_list(struct menu *menu)
{ {
struct menu *child; struct menu *child;
@ -211,7 +211,7 @@ static void message__print_gettext_msgid_msgstr(struct message *self)
"msgstr \"\"\n", self->msg); "msgstr \"\"\n", self->msg);
} }
void menu__xgettext(void) static void menu__xgettext(void)
{ {
struct message *m = message__list; struct message *m = message__list;

View File

@ -17,6 +17,8 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu));
P(menu_get_parent_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu));
P(menu_has_help,bool,(struct menu *menu)); P(menu_has_help,bool,(struct menu *menu));
P(menu_get_help,const char *,(struct menu *menu)); P(menu_get_help,const char *,(struct menu *menu));
P(get_symbol_str,void,(struct gstr *r, struct symbol *sym));
P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
/* symbol.c */ /* symbol.c */
P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);

View File

@ -199,8 +199,6 @@ inputbox_instructions_string[] = N_(
setmod_text[] = N_( setmod_text[] = N_(
"This feature depends on another which has been configured as a module.\n" "This feature depends on another which has been configured as a module.\n"
"As a result, this feature will be built as a module."), "As a result, this feature will be built as a module."),
nohelp_text[] = N_(
"There is no help available for this kernel option.\n"),
load_config_text[] = N_( load_config_text[] = N_(
"Enter the name of the configuration file you wish to load. " "Enter the name of the configuration file you wish to load. "
"Accept the name shown to restore the configuration you " "Accept the name shown to restore the configuration you "
@ -284,66 +282,6 @@ static void show_textbox(const char *title, const char *text, int r, int c);
static void show_helptext(const char *title, const char *text); static void show_helptext(const char *title, const char *text);
static void show_help(struct menu *menu); static void show_help(struct menu *menu);
static void get_prompt_str(struct gstr *r, struct property *prop)
{
int i, j;
struct menu *submenu[8], *menu;
str_printf(r, _("Prompt: %s\n"), _(prop->text));
str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
prop->menu->lineno);
if (!expr_is_yes(prop->visible.expr)) {
str_append(r, _(" Depends on: "));
expr_gstr_print(prop->visible.expr, r);
str_append(r, "\n");
}
menu = prop->menu->parent;
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent)
submenu[i++] = menu;
if (i > 0) {
str_printf(r, _(" Location:\n"));
for (j = 4; --i >= 0; j += 2) {
menu = submenu[i];
str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu)));
if (menu->sym) {
str_printf(r, " (%s [=%s])", menu->sym->name ?
menu->sym->name : _("<choice>"),
sym_get_string_value(menu->sym));
}
str_append(r, "\n");
}
}
}
static void get_symbol_str(struct gstr *r, struct symbol *sym)
{
bool hit;
struct property *prop;
if (sym && sym->name)
str_printf(r, "Symbol: %s [=%s]\n", sym->name,
sym_get_string_value(sym));
for_all_prompts(sym, prop)
get_prompt_str(r, prop);
hit = false;
for_all_properties(sym, prop, P_SELECT) {
if (!hit) {
str_append(r, " Selects: ");
hit = true;
} else
str_printf(r, " && ");
expr_gstr_print(prop->expr, r);
}
if (hit)
str_append(r, "\n");
if (sym->rev_dep.expr) {
str_append(r, _(" Selected by: "));
expr_gstr_print(sym->rev_dep.expr, r);
str_append(r, "\n");
}
str_append(r, "\n\n");
}
static struct gstr get_relations_str(struct symbol **sym_arr) static struct gstr get_relations_str(struct symbol **sym_arr)
{ {
struct symbol *sym; struct symbol *sym;
@ -699,19 +637,9 @@ static void show_helptext(const char *title, const char *text)
static void show_help(struct menu *menu) static void show_help(struct menu *menu)
{ {
struct gstr help = str_new(); struct gstr help = str_new();
struct symbol *sym = menu->sym;
if (menu_has_help(menu)) menu_get_ext_help(menu, &help);
{
if (sym->name) {
str_printf(&help, "CONFIG_%s:\n\n", sym->name);
str_append(&help, _(menu_get_help(menu)));
str_append(&help, "\n");
}
} else {
str_append(&help, nohelp_text);
}
get_symbol_str(&help, sym);
show_helptext(_(menu_get_prompt(menu)), str_get(&help)); show_helptext(_(menu_get_prompt(menu)), str_get(&help));
str_free(&help); str_free(&help);
} }

View File

@ -9,6 +9,9 @@
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
#include "lkc.h" #include "lkc.h"
static const char nohelp_text[] = N_(
"There is no help available for this kernel option.\n");
struct menu rootmenu; struct menu rootmenu;
static struct menu **last_entry_ptr; static struct menu **last_entry_ptr;
@ -74,7 +77,7 @@ void menu_end_menu(void)
current_menu = current_menu->parent; current_menu = current_menu->parent;
} }
struct expr *menu_check_dep(struct expr *e) static struct expr *menu_check_dep(struct expr *e)
{ {
if (!e) if (!e)
return e; return e;
@ -184,7 +187,7 @@ static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2)
(sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
} }
void sym_check_prop(struct symbol *sym) static void sym_check_prop(struct symbol *sym)
{ {
struct property *prop; struct property *prop;
struct symbol *sym2; struct symbol *sym2;
@ -451,3 +454,80 @@ const char *menu_get_help(struct menu *menu)
else else
return ""; return "";
} }
static void get_prompt_str(struct gstr *r, struct property *prop)
{
int i, j;
struct menu *submenu[8], *menu;
str_printf(r, _("Prompt: %s\n"), _(prop->text));
str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
prop->menu->lineno);
if (!expr_is_yes(prop->visible.expr)) {
str_append(r, _(" Depends on: "));
expr_gstr_print(prop->visible.expr, r);
str_append(r, "\n");
}
menu = prop->menu->parent;
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent)
submenu[i++] = menu;
if (i > 0) {
str_printf(r, _(" Location:\n"));
for (j = 4; --i >= 0; j += 2) {
menu = submenu[i];
str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu)));
if (menu->sym) {
str_printf(r, " (%s [=%s])", menu->sym->name ?
menu->sym->name : _("<choice>"),
sym_get_string_value(menu->sym));
}
str_append(r, "\n");
}
}
}
void get_symbol_str(struct gstr *r, struct symbol *sym)
{
bool hit;
struct property *prop;
if (sym && sym->name)
str_printf(r, "Symbol: %s [=%s]\n", sym->name,
sym_get_string_value(sym));
for_all_prompts(sym, prop)
get_prompt_str(r, prop);
hit = false;
for_all_properties(sym, prop, P_SELECT) {
if (!hit) {
str_append(r, " Selects: ");
hit = true;
} else
str_printf(r, " && ");
expr_gstr_print(prop->expr, r);
}
if (hit)
str_append(r, "\n");
if (sym->rev_dep.expr) {
str_append(r, _(" Selected by: "));
expr_gstr_print(sym->rev_dep.expr, r);
str_append(r, "\n");
}
str_append(r, "\n\n");
}
void menu_get_ext_help(struct menu *menu, struct gstr *help)
{
struct symbol *sym = menu->sym;
if (menu_has_help(menu)) {
if (sym->name) {
str_printf(help, "CONFIG_%s:\n\n", sym->name);
str_append(help, _(menu_get_help(menu)));
str_append(help, "\n");
}
} else {
str_append(help, nohelp_text);
}
if (sym)
get_symbol_str(help, sym);
}

View File

@ -1042,12 +1042,10 @@ void ConfigInfoView::menuInfo(void)
if (showDebug()) if (showDebug())
debug = debug_info(sym); debug = debug_info(sym);
help = menu_get_help(menu); struct gstr help_gstr = str_new();
/* Gettextize if the help text not empty */ menu_get_ext_help(menu, &help_gstr);
if (help.isEmpty()) help = print_filter(str_get(&help_gstr));
help = print_filter(menu_get_help(menu)); str_free(&help_gstr);
else
help = print_filter(_(menu_get_help(menu)));
} else if (menu->prompt) { } else if (menu->prompt) {
head += "<big><b>"; head += "<big><b>";
head += print_filter(_(menu->prompt->text)); head += print_filter(_(menu->prompt->text));

View File

@ -36,7 +36,7 @@ tristate modules_val;
struct expr *sym_env_list; struct expr *sym_env_list;
void sym_add_default(struct symbol *sym, const char *def) static void sym_add_default(struct symbol *sym, const char *def)
{ {
struct property *prop = prop_alloc(P_DEFAULT, sym); struct property *prop = prop_alloc(P_DEFAULT, sym);
@ -125,7 +125,7 @@ struct property *sym_get_default_prop(struct symbol *sym)
return NULL; return NULL;
} }
struct property *sym_get_range_prop(struct symbol *sym) static struct property *sym_get_range_prop(struct symbol *sym)
{ {
struct property *prop; struct property *prop;
@ -943,7 +943,7 @@ const char *prop_get_type_name(enum prop_type type)
return "unknown"; return "unknown";
} }
void prop_add_env(const char *env) static void prop_add_env(const char *env)
{ {
struct symbol *sym, *sym2; struct symbol *sym, *sym2;
struct property *prop; struct property *prop;

View File

@ -184,10 +184,7 @@ if ($target eq "0") {
# if it's a module, we need to find the .ko file and calculate a load offset # if it's a module, we need to find the .ko file and calculate a load offset
if ($module ne "") { if ($module ne "") {
my $dir = dirname($filename); my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`;
$dir = $dir . "/";
my $mod = $module . ".ko";
my $modulefile = `find $dir -name $mod | head -1`;
chomp($modulefile); chomp($modulefile);
$filename = $modulefile; $filename = $modulefile;
if ($filename eq "") { if ($filename eq "") {

View File

@ -101,7 +101,8 @@ exuberant()
-I ____cacheline_aligned_in_smp \ -I ____cacheline_aligned_in_smp \
-I ____cacheline_internodealigned_in_smp \ -I ____cacheline_internodealigned_in_smp \
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
--extra=+f --c-kinds=+px \ -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
--extra=+f --c-kinds=-px \
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \ --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/'

2
usr/.gitignore vendored
View File

@ -4,5 +4,7 @@
gen_init_cpio gen_init_cpio
initramfs_data.cpio initramfs_data.cpio
initramfs_data.cpio.gz initramfs_data.cpio.gz
initramfs_data.cpio.bz2
initramfs_data.cpio.lzma
initramfs_list initramfs_list
include include

View File

@ -6,7 +6,7 @@ klibcdirs:;
PHONY += klibcdirs PHONY += klibcdirs
# Gzip, but no bzip2 # Gzip
suffix_$(CONFIG_INITRAMFS_COMPRESSION_GZIP) = .gz suffix_$(CONFIG_INITRAMFS_COMPRESSION_GZIP) = .gz
# Bzip2 # Bzip2