Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 21:28:19 +0000 (14:28 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 21:28:19 +0000 (14:28 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (33 commits)
  xtensa: use DATA_DATA in xtensa
  powerpc: add missing DATA_DATA to powerpc
  cris: use DATA_DATA in cris
  kallsyms: remove usage of memmem and _GNU_SOURCE from scripts/kallsyms.c
  kbuild: use -fno-optimize-sibling-calls unconditionally
  kconfig: reset generated values only if Kconfig and .config agree.
  kbuild: fix the warning when running make tags
  kconfig: strip 'CONFIG_' automatically in kernel configuration search
  kbuild: use POSIX BRE in headers install target
  Whitelist references from __dbe_table to .init
  modpost white list pattern adjustment
  kbuild: do section mismatch check on full vmlinux
  kbuild: whitelist references from variables named _timer to .init.text
  kbuild: remove hardcoded _logo names from modpost
  kbuild: remove hardcoded apic_es7000 from modpost
  kbuild: warn about references from .init.text to .exit.text
  kbuild: consolidate section checks
  kbuild: refactor code in modpost to improve maintainability
  kbuild: ignore section mismatch warnings originating from .note section
  kbuild: .paravirtprobe section is obsolete, so modpost doesn't need to handle it
  ...

1  2 
Makefile
arch/cris/arch-v32/vmlinux.lds.S
arch/powerpc/Makefile
arch/powerpc/kernel/vmlinux.lds.S
arch/xtensa/kernel/vmlinux.lds.S
scripts/kallsyms.c

diff --combined Makefile
+++ b/Makefile
@@@ -492,7 -492,7 +492,7 @@@ endi
  include $(srctree)/arch/$(ARCH)/Makefile
  
  ifdef CONFIG_FRAME_POINTER
- CFLAGS                += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
+ CFLAGS                += -fno-omit-frame-pointer -fno-optimize-sibling-calls
  else
  CFLAGS                += -fomit-frame-pointer
  endif
@@@ -514,12 -514,6 +514,12 @@@ CFLAGS += $(call cc-option,-Wdeclaratio
  # disable pointer signed / unsigned warnings in gcc 4.0
  CFLAGS += $(call cc-option,-Wno-pointer-sign,)
  
 +# Use --build-id when available.
 +LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
 +                            $(call ld-option, -Wl$(comma)--build-id,))
 +LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
 +LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
 +
  # Default kernel image to build when no specific target is given.
  # KBUILD_IMAGE may be overruled on the command line or
  # set in the environment
@@@ -618,7 -612,7 +618,7 @@@ quiet_cmd_vmlinux__ ?= LD      $
        cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
        -T $(vmlinux-lds) $(vmlinux-init)                          \
        --start-group $(vmlinux-main) --end-group                  \
-       $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
+       $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^)
  
  # Generate new vmlinux version
  quiet_cmd_vmlinux_version = GEN     .version
@@@ -742,15 -736,31 +742,31 @@@ debug_kallsyms: .tmp_map$(last_kallsyms
  
  endif # ifdef CONFIG_KALLSYMS
  
+ # Do modpost on a prelinked vmlinux. The finally linked vmlinux has
+ # relevant sections renamed as per the linker script.
+ quiet_cmd_vmlinux-modpost = LD      $@
+       cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@                          \
+        $(vmlinux-init) --start-group $(vmlinux-main) --end-group             \
+        $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^)
+ define rule_vmlinux-modpost
+       :
+       +$(call cmd,vmlinux-modpost)
+       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
+       $(Q)echo 'cmd_$@ := $(cmd_vmlinux-modpost)' > $(dot-target).cmd
+ endef
  # vmlinux image - including updated kernel symbols
- vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
+ vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) vmlinux.o FORCE
  ifdef CONFIG_HEADERS_CHECK
        $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
  endif
+       $(call vmlinux-modpost)
        $(call if_changed_rule,vmlinux__)
-       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
        $(Q)rm -f .old_version
  
+ vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
+       $(call if_changed_rule,vmlinux-modpost)
  # The actual objects are generated when descending, 
  # make sure no implicit rule kicks in
  $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
@@@ -1323,7 -1333,7 +1339,7 @@@ define xtag
                -I __initdata,__exitdata,__acquires,__releases \
                -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
                --extra=+f --c-kinds=+px \
-               --regex-asm='/ENTRY\(([^)]*)\).*/\1/'; \
+               --regex-asm='/^ENTRY\(([^)]*)\).*/\1/'; \
            $(all-kconfigs) | xargs $1 -a \
                --langdef=kconfig \
                --language-force=kconfig \
@@@ -49,7 -49,7 +49,7 @@@ SECTION
        ___data_start = . ;
        __Sdata = . ;
        .data : {                     /* Data */
-               *(.data)
+               DATA_DATA
        }
        __edata = . ;           /* End of data section. */
        _edata = . ;
        }
        SECURITY_INIT
  
 -      . =  ALIGN (8192);
 -      __per_cpu_start = .;
 -      .data.percpu  : { *(.data.percpu) }
 -      __per_cpu_end = .;
 +      PERCPU(8192)
  
  #ifdef CONFIG_BLK_DEV_INITRD
        .init.ramfs : {
diff --combined arch/powerpc/Makefile
@@@ -148,7 -148,7 +148,7 @@@ all: $(KBUILD_IMAGE
  
  CPPFLAGS_vmlinux.lds  := -Upowerpc
  
 -BOOT_TARGETS = zImage zImage.initrd zImage.dts zImage.dts_initrd uImage
 +BOOT_TARGETS = zImage zImage.initrd uImage
  
  PHONY += $(BOOT_TARGETS)
  
@@@ -201,6 -201,14 +201,14 @@@ checkbin
                        false; \
                fi ; \
        fi
+       @if test "$(call cc-fullversion)" = "040200" \
+           && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
+               echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
+               echo 'kernel with modules enabled.' ; \
+               echo -n '*** Please use a different GCC version or ' ; \
+               echo 'disable kernel modules' ; \
+               false ; \
+       fi
        @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
                echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
                echo 'correctly with old versions of binutils.' ; \
@@@ -7,7 -7,6 +7,7 @@@
  #define PROVIDE32(x)  PROVIDE(x)
  #endif
  #include <asm-generic/vmlinux.lds.h>
 +#include <asm/cache.h>
  
  ENTRY(_stext)
  
@@@ -63,8 -62,6 +63,8 @@@ SECTION
                __stop___ex_table = .;
        }
  
 +      NOTES
 +
        BUG_TABLE
  
  /*
        .data.percpu : {
                __per_cpu_start = .;
                *(.data.percpu)
 +              *(.data.percpu.shared_aligned)
                __per_cpu_end = .;
        }
  
        }
  #else
        .data : {
-               *(.data .data.rel* .toc1)
+               DATA_DATA
+               *(.data.rel*)
+               *(.toc1)
                *(.branch_lt)
        }
  
                *(.data.cacheline_aligned)
        }
  
 +      . = ALIGN(L1_CACHE_BYTES);
 +      .data.read_mostly : {
 +              *(.data.read_mostly)
 +      }
 +
        . = ALIGN(PAGE_SIZE);
        __data_nosave : {
                __nosave_begin = .;
@@@ -118,7 -118,8 +118,8 @@@ SECTION
    _fdata = .;
    .data :
    {
-     *(.data) CONSTRUCTORS
+     DATA_DATA
+     CONSTRUCTORS
      . = ALIGN(XCHAL_ICACHE_LINESIZE);
      *(.data.cacheline_aligned)
    }
    __initramfs_end = .;
  #endif
  
 -  . = ALIGN(4096);
 -  __per_cpu_start = .;
 -  .data.percpu  : { *(.data.percpu) }
 -  __per_cpu_end = .;
 +  PERCPU(4096)
  
  
    /* We need this dummy segment here */
diff --combined scripts/kallsyms.c
   *
   */
  
- #define _GNU_SOURCE
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <ctype.h>
  
 -#define KSYM_NAME_LEN         127
 +#define KSYM_NAME_LEN         128
  
  
  struct sym_entry {
@@@ -254,7 -252,7 +252,7 @@@ static void write_src(void
        unsigned int i, k, off;
        unsigned int best_idx[256];
        unsigned int *markers;
 -      char buf[KSYM_NAME_LEN+1];
 +      char buf[KSYM_NAME_LEN];
  
        printf("#include <asm/types.h>\n");
        printf("#if BITS_PER_LONG == 64\n");
@@@ -378,6 -376,17 +376,17 @@@ static void build_initial_tok_table(voi
        table_cnt = pos;
  }
  
+ static void *find_token(unsigned char *str, int len, unsigned char *token)
+ {
+       int i;
+       for (i = 0; i < len - 1; i++) {
+               if (str[i] == token[0] && str[i+1] == token[1])
+                       return &str[i];
+       }
+       return NULL;
+ }
  /* replace a given token in all the valid symbols. Use the sampled symbols
   * to update the counts */
  static void compress_symbols(unsigned char *str, int idx)
                p1 = table[i].sym;
  
                /* find the token on the symbol */
-               p2 = memmem(p1, len, str, 2);
+               p2 = find_token(p1, len, str);
                if (!p2) continue;
  
                /* decrease the counts for this symbol's tokens */
                        if (size < 2) break;
  
                        /* find the token on the symbol */
-                       p2 = memmem(p1, size, str, 2);
+                       p2 = find_token(p1, size, str);
  
                } while (p2);