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

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
kbuild: fix kbuild.txt typos
kbuild: print usage with no arguments in scripts/config
Revert "kbuild: strip generated symbols from *.ko"

+200 -266
+15 -14
Documentation/kbuild/kbuild.txt
··· 3 3 KCPPFLAGS 4 4 -------------------------------------------------- 5 5 Additional options to pass when preprocessing. The preprocessing options 6 - will be used in all cases where kbuild do preprocessing including 6 + will be used in all cases where kbuild does preprocessing including 7 7 building C files and assembler files. 8 8 9 9 KAFLAGS ··· 16 16 17 17 KBUILD_VERBOSE 18 18 -------------------------------------------------- 19 - Set the kbuild verbosity. Can be assinged same values as "V=...". 19 + Set the kbuild verbosity. Can be assigned same values as "V=...". 20 20 See make help for the full list. 21 21 Setting "V=..." takes precedence over KBUILD_VERBOSE. 22 22 ··· 35 35 -------------------------------------------------- 36 36 Specify the output directory when building the kernel. 37 37 The output directory can also be specificed using "O=...". 38 - Setting "O=..." takes precedence over KBUILD_OUTPUT 38 + Setting "O=..." takes precedence over KBUILD_OUTPUT. 39 39 40 40 ARCH 41 41 -------------------------------------------------- 42 42 Set ARCH to the architecture to be built. 43 43 In most cases the name of the architecture is the same as the 44 44 directory name found in the arch/ directory. 45 - But some architectures suach as x86 and sparc has aliases. 45 + But some architectures such as x86 and sparc have aliases. 46 46 x86: i386 for 32 bit, x86_64 for 64 bit 47 47 sparc: sparc for 32 bit, sparc64 for 64 bit 48 48 ··· 63 63 INSTALL_PATH 64 64 -------------------------------------------------- 65 65 INSTALL_PATH specifies where to place the updated kernel and system map 66 - images. Default is /boot, but you can set it to other values 66 + images. Default is /boot, but you can set it to other values. 67 67 68 68 69 69 MODLIB ··· 90 90 91 91 INSTALL_FW_PATH 92 92 -------------------------------------------------- 93 - INSTALL_FW_PATH specify where to install the firmware blobs. 93 + INSTALL_FW_PATH specifies where to install the firmware blobs. 94 94 The default value is: 95 95 96 96 $(INSTALL_MOD_PATH)/lib/firmware ··· 99 99 100 100 INSTALL_HDR_PATH 101 101 -------------------------------------------------- 102 - INSTALL_HDR_PATH specify where to install user space headers when 102 + INSTALL_HDR_PATH specifies where to install user space headers when 103 103 executing "make headers_*". 104 104 The default value is: 105 105 ··· 112 112 113 113 KBUILD_MODPOST_WARN 114 114 -------------------------------------------------- 115 - KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined 116 - symbols in the final module linking stage. 115 + KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined 116 + symbols in the final module linking stage. It changes such errors 117 + into warnings. 117 118 118 - KBUILD_MODPOST_FINAL 119 + KBUILD_MODPOST_NOFINAL 119 120 -------------------------------------------------- 120 121 KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. 121 - This is solely usefull to speed up test compiles. 122 + This is solely useful to speed up test compiles. 122 123 123 124 KBUILD_EXTRA_SYMBOLS 124 125 -------------------------------------------------- 125 - For modules use symbols from another modules. 126 + For modules that use symbols from other modules. 126 127 See more details in modules.txt. 127 128 128 129 ALLSOURCE_ARCHS 129 130 -------------------------------------------------- 130 - For tags/TAGS/cscope targets, you can specify more than one archs 131 - to be included in the databases, separated by blankspace. e.g. 131 + For tags/TAGS/cscope targets, you can specify more than one arch 132 + to be included in the databases, separated by blank space. E.g.: 132 133 133 134 $ make ALLSOURCE_ARCHS="x86 mips arm" tags
+18 -41
Makefile
··· 610 610 MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 611 611 export MODLIB 612 612 613 - strip-symbols := $(srctree)/scripts/strip-symbols \ 614 - $(wildcard $(srctree)/arch/$(ARCH)/scripts/strip-symbols) 615 - 616 613 # 617 - # INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while 618 - # they get installed. If INSTALL_MOD_STRIP is '1', then the default 619 - # options (see below) will be used. Otherwise, INSTALL_MOD_STRIP will 620 - # be used as the option(s) to the objcopy command. 614 + # INSTALL_MOD_STRIP, if defined, will cause modules to be 615 + # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then 616 + # the default option --strip-debug will be used. Otherwise, 617 + # INSTALL_MOD_STRIP will used as the options to the strip command. 618 + 621 619 ifdef INSTALL_MOD_STRIP 622 620 ifeq ($(INSTALL_MOD_STRIP),1) 623 - mod_strip_cmd = $(OBJCOPY) --strip-debug 624 - ifeq ($(CONFIG_KALLSYMS_ALL),$(CONFIG_KALLSYMS_STRIP_GENERATED)) 625 - mod_strip_cmd += --wildcard $(addprefix --strip-symbols ,$(strip-symbols)) 626 - endif 621 + mod_strip_cmd = $(STRIP) --strip-debug 627 622 else 628 - mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP) 623 + mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) 629 624 endif # INSTALL_MOD_STRIP=1 630 625 else 631 - mod_strip_cmd = false 626 + mod_strip_cmd = true 632 627 endif # INSTALL_MOD_STRIP 633 628 export mod_strip_cmd 634 629 ··· 753 758 endif 754 759 755 760 kallsyms.o := .tmp_kallsyms$(last_kallsyms).o 756 - kallsyms.h := $(wildcard include/config/kallsyms/*.h) $(wildcard include/config/kallsyms/*/*.h) 757 761 758 762 define verify_kallsyms 759 763 $(Q)$(if $($(quiet)cmd_sysmap), \ ··· 777 783 778 784 # Generate .S file with all kernel symbols 779 785 quiet_cmd_kallsyms = KSYM $@ 780 - cmd_kallsyms = { test $* -eq 0 || $(NM) -n $<; } \ 781 - | $(KALLSYMS) $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) >$@ 786 + cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ 787 + $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ 782 788 783 - quiet_cmd_kstrip = STRIP $@ 784 - cmd_kstrip = $(OBJCOPY) --wildcard $(addprefix --strip$(if $(CONFIG_RELOCATABLE),-unneeded)-symbols ,$(filter %/scripts/strip-symbols,$^)) $< $@ 785 - 786 - $(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): KBUILD_AFLAGS += -Wa,--strip-local-absolute 787 - $(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): %.o: %.S scripts FORCE 789 + .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE 788 790 $(call if_changed_dep,as_o_S) 789 791 790 - ifeq ($(CONFIG_KALLSYMS_STRIP_GENERATED),y) 791 - strip-ext := .stripped 792 - endif 793 - 794 - .tmp_kallsyms%.S: .tmp_vmlinux%$(strip-ext) $(KALLSYMS) $(kallsyms.h) 792 + .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) 795 793 $(call cmd,kallsyms) 796 794 797 - # make -jN seems to have problems with intermediate files, see bug #3330. 798 - .SECONDARY: $(foreach n,1 2 3,.tmp_vmlinux$(n).stripped) 799 - .tmp_vmlinux%.stripped: .tmp_vmlinux% $(strip-symbols) $(kallsyms.h) 800 - $(call cmd,kstrip) 801 - 802 - ifneq ($(CONFIG_DEBUG_INFO),y) 803 - .tmp_vmlinux%: LDFLAGS_vmlinux += -S 804 - endif 805 795 # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version 806 - .tmp_vmlinux%: $(vmlinux-lds) $(vmlinux-all) FORCE 807 - $(if $(filter 1,$*),$(call if_changed_rule,ksym_ld),$(call if_changed,vmlinux__)) 796 + .tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE 797 + $(call if_changed_rule,ksym_ld) 808 798 809 - .tmp_vmlinux0$(strip-ext): 810 - $(Q)echo "placeholder" >$@ 799 + .tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE 800 + $(call if_changed,vmlinux__) 811 801 812 - .tmp_vmlinux1: .tmp_kallsyms0.o 813 - .tmp_vmlinux2: .tmp_kallsyms1.o 814 - .tmp_vmlinux3: .tmp_kallsyms2.o 802 + .tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE 803 + $(call if_changed,vmlinux__) 815 804 816 805 # Needs to visit scripts/ before $(KALLSYMS) can be used. 817 806 $(KALLSYMS): scripts ;
-1
arch/x86/scripts/strip-symbols
··· 1 - __cpu_vendor_dev_X86_VENDOR_*
-7
init/Kconfig
··· 725 725 726 726 Say N. 727 727 728 - config KALLSYMS_STRIP_GENERATED 729 - bool "Strip machine generated symbols from kallsyms" 730 - depends on KALLSYMS_ALL 731 - default y 732 - help 733 - Say N if you want kallsyms to retain even machine generated symbols. 734 - 735 728 config KALLSYMS_EXTRA_PASS 736 729 bool "Do an extra kallsyms pass" 737 730 depends on KALLSYMS
+10 -6
kernel/kallsyms.c
··· 30 30 #define all_var 0 31 31 #endif 32 32 33 - extern const unsigned long kallsyms_addresses[]; 34 - extern const u8 kallsyms_names[]; 33 + /* These will be re-linked against their real values during the second link stage */ 34 + extern const unsigned long kallsyms_addresses[] __attribute__((weak)); 35 + extern const u8 kallsyms_names[] __attribute__((weak)); 35 36 36 37 /* tell the compiler that the count isn't in the small data section if the arch 37 38 * has one (eg: FRV) 38 39 */ 39 40 extern const unsigned long kallsyms_num_syms 40 - __attribute__((__section__(".rodata"))); 41 + __attribute__((weak, section(".rodata"))); 41 42 42 - extern const u8 kallsyms_token_table[]; 43 - extern const u16 kallsyms_token_index[]; 43 + extern const u8 kallsyms_token_table[] __attribute__((weak)); 44 + extern const u16 kallsyms_token_index[] __attribute__((weak)); 44 45 45 - extern const unsigned long kallsyms_markers[]; 46 + extern const unsigned long kallsyms_markers[] __attribute__((weak)); 46 47 47 48 static inline int is_kernel_inittext(unsigned long addr) 48 49 { ··· 167 166 { 168 167 unsigned long symbol_start = 0, symbol_end = 0; 169 168 unsigned long i, low, high, mid; 169 + 170 + /* This kernel should never had been booted. */ 171 + BUG_ON(!kallsyms_addresses); 170 172 171 173 /* do a binary search on the sorted kallsyms_addresses array */ 172 174 low = 0;
+20 -35
scripts/Makefile.build
··· 151 151 $(obj)/%.i: $(src)/%.c FORCE 152 152 $(call if_changed_dep,cc_i_c) 153 153 154 - cmd_genksyms = \ 154 + cmd_gensymtypes = \ 155 155 $(CPP) -D__GENKSYMS__ $(c_flags) $< | \ 156 - $(GENKSYMS) -T $@ -A -a $(ARCH) \ 156 + $(GENKSYMS) -T $@ -a $(ARCH) \ 157 157 $(if $(KBUILD_PRESERVE),-p) \ 158 158 $(if $(1),-r $(firstword $(wildcard $(@:.symtypes=.symref) /dev/null))) 159 159 160 160 quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ 161 161 cmd_cc_symtypes_c = \ 162 162 set -e; \ 163 - $(call cmd_genksyms, true) >/dev/null; \ 163 + $(call cmd_gensymtypes, true) >/dev/null; \ 164 164 test -s $@ || rm -f $@ 165 165 166 166 $(obj)/%.symtypes : $(src)/%.c FORCE ··· 177 177 178 178 else 179 179 # When module versioning is enabled the following steps are executed: 180 - # o compile a .tmp_<file>.s from <file>.c 181 - # o if .tmp_<file>.s doesn't contain a __ksymtab version, i.e. does 182 - # not export symbols, we just assemble .tmp_<file>.s to <file>.o and 180 + # o compile a .tmp_<file>.o from <file>.c 181 + # o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does 182 + # not export symbols, we just rename .tmp_<file>.o to <file>.o and 183 183 # are done. 184 184 # o otherwise, we calculate symbol versions using the good old 185 185 # genksyms on the preprocessed source and postprocess them in a way 186 - # that they are usable as assembly source 187 - # o assemble <file>.o from .tmp_<file>.s forcing inclusion of directives 188 - # defining the actual values of __crc_*, followed by objcopy-ing them 189 - # to force these symbols to be local to permit stripping them later. 190 - s_file = $(@D)/.tmp_$(@F:.o=.s) 191 - v_file = $(@D)/.tmp_$(@F:.o=.v) 192 - tmp_o_file = $(@D)/.tmp_$(@F) 193 - no_g_c_flags = $(filter-out -g%,$(c_flags)) 186 + # that they are usable as a linker script 187 + # o generate <file>.o from .tmp_<file>.o using the linker to 188 + # replace the unresolved symbols __crc_exported_symbol with 189 + # the actual value of the checksum generated by genksyms 194 190 195 - cmd_cc_o_c = $(CC) $(c_flags) -S -o $(s_file) $< 196 - 191 + cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< 197 192 cmd_modversions = \ 198 - if grep -q __ksymtab $(s_file); then \ 199 - if $(call cmd_genksyms, $(KBUILD_SYMTYPES)) > $(v_file) \ 200 - && $(CC) $(no_g_c_flags) -c -Wa,$(v_file) \ 201 - -o $(tmp_o_file) $(s_file) \ 202 - && $(OBJCOPY) -L '__crc_*' -L '___crc_*' -w \ 203 - $(tmp_o_file) $@; \ 204 - then \ 205 - : ; \ 206 - else \ 207 - rm -f $@; exit 1; \ 208 - fi; \ 193 + if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ 194 + $(call cmd_gensymtypes, $(KBUILD_SYMTYPES)) \ 195 + > $(@D)/.tmp_$(@F:.o=.ver); \ 196 + \ 197 + $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ 198 + -T $(@D)/.tmp_$(@F:.o=.ver); \ 199 + rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ 209 200 else \ 210 - rm -f $(v_file); \ 211 - $(CC) $(no_g_c_flags) -c -o $@ $(s_file); \ 201 + mv -f $(@D)/.tmp_$(@F) $@; \ 212 202 fi; 213 203 endif 214 204 ··· 215 225 $(cmd_record_mcount) \ 216 226 scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ 217 227 $(dot-target).tmp; \ 218 - if [ -r $(@D)/.tmp_$(@F:.o=.v) ]; then \ 219 - echo >> $(dot-target).tmp; \ 220 - echo '$@: $(GENKSYMS)' >> $(dot-target).tmp; \ 221 - echo '$(GENKSYMS):: ;' >> $(dot-target).tmp; \ 222 - fi; \ 223 - rm -f $(depfile) $(@D)/.tmp_$(@F:.o=.?); \ 228 + rm -f $(depfile); \ 224 229 mv -f $(dot-target).tmp $(dot-target).cmd 225 230 endef 226 231
+1 -2
scripts/Makefile.modinst
··· 17 17 @: 18 18 19 19 quiet_cmd_modules_install = INSTALL $@ 20 - cmd_modules_install = mkdir -p $(2); \ 21 - $(mod_strip_cmd) $@ $(2)/$(notdir $@) || cp $@ $(2) 20 + cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) 22 21 23 22 # Modules built outside the kernel source tree go into extra by default 24 23 INSTALL_MOD_DIR ?= extra
+4
scripts/config
··· 60 60 FN=.config 61 61 fi 62 62 63 + if [ "$1" = "" ] ; then 64 + usage 65 + fi 66 + 63 67 while [ "$1" != "" ] ; do 64 68 CMD="$1" 65 69 shift
+6 -15
scripts/genksyms/genksyms.c
··· 43 43 char *cur_filename; 44 44 45 45 static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types, 46 - flag_preserve, flag_warnings, flag_asm; 46 + flag_preserve, flag_warnings; 47 47 static const char *arch = ""; 48 48 static const char *mod_prefix = ""; 49 49 ··· 610 610 if (flag_dump_defs) 611 611 fputs(">\n", debugfile); 612 612 613 - /* Used as assembly source or a linker script. */ 614 - printf(flag_asm 615 - ? ".equiv %s__crc_%s, %#08lx\n" 616 - : "%s__crc_%s = %#08lx ;\n", 617 - mod_prefix, name, crc); 613 + /* Used as a linker script. */ 614 + printf("%s__crc_%s = 0x%08lx ;\n", mod_prefix, name, crc); 618 615 } 619 616 } 620 617 ··· 648 651 649 652 static void genksyms_usage(void) 650 653 { 651 - fputs("Usage:\n" "genksyms [-aAdDTwqhV] > /path/to/.tmp_obj.ver\n" "\n" 654 + fputs("Usage:\n" "genksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\n" "\n" 652 655 #ifdef __GNU_LIBRARY__ 653 656 " -a, --arch Select architecture\n" 654 - " -A, --asm Generate assembly rather than linker script\n" 655 657 " -d, --debug Increment the debug level (repeatable)\n" 656 658 " -D, --dump Dump expanded symbol defs (for debugging only)\n" 657 659 " -r, --reference file Read reference symbols from a file\n" ··· 662 666 " -V, --version Print the release version\n" 663 667 #else /* __GNU_LIBRARY__ */ 664 668 " -a Select architecture\n" 665 - " -A Generate assembly rather than linker script\n" 666 669 " -d Increment the debug level (repeatable)\n" 667 670 " -D Dump expanded symbol defs (for debugging only)\n" 668 671 " -r file Read reference symbols from a file\n" ··· 683 688 #ifdef __GNU_LIBRARY__ 684 689 struct option long_opts[] = { 685 690 {"arch", 1, 0, 'a'}, 686 - {"asm", 0, 0, 'A'}, 687 691 {"debug", 0, 0, 'd'}, 688 692 {"warnings", 0, 0, 'w'}, 689 693 {"quiet", 0, 0, 'q'}, ··· 695 701 {0, 0, 0, 0} 696 702 }; 697 703 698 - while ((o = getopt_long(argc, argv, "a:dwqVADr:T:ph", 704 + while ((o = getopt_long(argc, argv, "a:dwqVDr:T:ph", 699 705 &long_opts[0], NULL)) != EOF) 700 706 #else /* __GNU_LIBRARY__ */ 701 - while ((o = getopt(argc, argv, "a:dwqVADr:T:ph")) != EOF) 707 + while ((o = getopt(argc, argv, "a:dwqVDr:T:ph")) != EOF) 702 708 #endif /* __GNU_LIBRARY__ */ 703 709 switch (o) { 704 710 case 'a': ··· 715 721 break; 716 722 case 'V': 717 723 fputs("genksyms version 2.5.60\n", stderr); 718 - break; 719 - case 'A': 720 - flag_asm = 1; 721 724 break; 722 725 case 'D': 723 726 flag_dump_defs = 1;
+108 -111
scripts/genksyms/keywords.c_shipped
··· 1 - /* ANSI-C code produced by gperf version 3.0.1 */ 1 + /* ANSI-C code produced by gperf version 3.0.2 */ 2 2 /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ 3 3 4 4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ ··· 32 32 33 33 #line 3 "scripts/genksyms/keywords.gperf" 34 34 struct resword { const char *name; int token; }; 35 - /* maximum key range = 64, duplicates = 0 */ 35 + /* maximum key range = 62, duplicates = 0 */ 36 36 37 37 #ifdef __GNUC__ 38 38 __inline ··· 46 46 { 47 47 static const unsigned char asso_values[] = 48 48 { 49 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 50 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 51 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 52 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 53 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 54 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 55 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 56 - 67, 67, 67, 67, 67, 67, 15, 67, 67, 67, 57 - 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, 58 - 67, 67, 67, 67, 67, 0, 67, 0, 67, 5, 59 - 25, 20, 15, 30, 67, 15, 67, 67, 10, 0, 60 - 10, 40, 20, 67, 10, 5, 0, 10, 15, 67, 61 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 62 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 63 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 64 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 65 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 66 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 69 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 70 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 71 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 72 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 73 - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 74 - 67, 67, 67, 67, 67, 67 49 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 50 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 51 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 52 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 53 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 54 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 55 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 5, 56 + 65, 65, 65, 65, 65, 65, 35, 65, 65, 65, 57 + 0, 65, 65, 65, 65, 65, 65, 65, 65, 65, 58 + 65, 65, 65, 65, 65, 0, 65, 0, 65, 5, 59 + 20, 15, 10, 30, 65, 15, 65, 65, 20, 0, 60 + 10, 35, 20, 65, 10, 5, 0, 10, 5, 65, 61 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 62 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 63 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 67 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 68 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 69 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 70 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 71 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 72 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 73 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 74 + 65, 65, 65, 65, 65, 65 75 75 }; 76 76 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; 77 77 } ··· 84 84 { 85 85 enum 86 86 { 87 - TOTAL_KEYWORDS = 45, 87 + TOTAL_KEYWORDS = 43, 88 88 MIN_WORD_LENGTH = 3, 89 89 MAX_WORD_LENGTH = 24, 90 90 MIN_HASH_VALUE = 3, 91 - MAX_HASH_VALUE = 66 91 + MAX_HASH_VALUE = 64 92 92 }; 93 93 94 94 static const struct resword wordlist[] = 95 95 { 96 96 {""}, {""}, {""}, 97 - #line 28 "scripts/genksyms/keywords.gperf" 97 + #line 26 "scripts/genksyms/keywords.gperf" 98 98 {"asm", ASM_KEYW}, 99 99 {""}, 100 - #line 10 "scripts/genksyms/keywords.gperf" 100 + #line 8 "scripts/genksyms/keywords.gperf" 101 101 {"__asm", ASM_KEYW}, 102 102 {""}, 103 - #line 11 "scripts/genksyms/keywords.gperf" 103 + #line 9 "scripts/genksyms/keywords.gperf" 104 104 {"__asm__", ASM_KEYW}, 105 105 {""}, {""}, 106 - #line 54 "scripts/genksyms/keywords.gperf" 106 + #line 52 "scripts/genksyms/keywords.gperf" 107 107 {"__typeof__", TYPEOF_KEYW}, 108 108 {""}, 109 - #line 14 "scripts/genksyms/keywords.gperf" 110 - {"__const", CONST_KEYW}, 111 - #line 13 "scripts/genksyms/keywords.gperf" 112 - {"__attribute__", ATTRIBUTE_KEYW}, 113 - #line 15 "scripts/genksyms/keywords.gperf" 114 - {"__const__", CONST_KEYW}, 115 - #line 20 "scripts/genksyms/keywords.gperf" 116 - {"__signed__", SIGNED_KEYW}, 117 - #line 46 "scripts/genksyms/keywords.gperf" 118 - {"static", STATIC_KEYW}, 119 - {""}, 120 - #line 41 "scripts/genksyms/keywords.gperf" 121 - {"int", INT_KEYW}, 122 - #line 34 "scripts/genksyms/keywords.gperf" 123 - {"char", CHAR_KEYW}, 124 - #line 35 "scripts/genksyms/keywords.gperf" 125 - {"const", CONST_KEYW}, 126 - #line 47 "scripts/genksyms/keywords.gperf" 127 - {"struct", STRUCT_KEYW}, 128 - #line 26 "scripts/genksyms/keywords.gperf" 129 - {"__restrict__", RESTRICT_KEYW}, 130 - #line 27 "scripts/genksyms/keywords.gperf" 131 - {"restrict", RESTRICT_KEYW}, 132 - #line 7 "scripts/genksyms/keywords.gperf" 133 - {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 134 - #line 18 "scripts/genksyms/keywords.gperf" 135 - {"__inline__", INLINE_KEYW}, 136 - {""}, 137 - #line 22 "scripts/genksyms/keywords.gperf" 138 - {"__volatile__", VOLATILE_KEYW}, 139 - #line 5 "scripts/genksyms/keywords.gperf" 140 - {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 141 - #line 25 "scripts/genksyms/keywords.gperf" 142 - {"_restrict", RESTRICT_KEYW}, 143 - {""}, 144 109 #line 12 "scripts/genksyms/keywords.gperf" 145 - {"__attribute", ATTRIBUTE_KEYW}, 146 - #line 6 "scripts/genksyms/keywords.gperf" 147 - {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 110 + {"__const", CONST_KEYW}, 111 + #line 11 "scripts/genksyms/keywords.gperf" 112 + {"__attribute__", ATTRIBUTE_KEYW}, 113 + #line 13 "scripts/genksyms/keywords.gperf" 114 + {"__const__", CONST_KEYW}, 115 + #line 18 "scripts/genksyms/keywords.gperf" 116 + {"__signed__", SIGNED_KEYW}, 117 + #line 44 "scripts/genksyms/keywords.gperf" 118 + {"static", STATIC_KEYW}, 119 + #line 20 "scripts/genksyms/keywords.gperf" 120 + {"__volatile__", VOLATILE_KEYW}, 121 + #line 39 "scripts/genksyms/keywords.gperf" 122 + {"int", INT_KEYW}, 123 + #line 32 "scripts/genksyms/keywords.gperf" 124 + {"char", CHAR_KEYW}, 125 + #line 33 "scripts/genksyms/keywords.gperf" 126 + {"const", CONST_KEYW}, 127 + #line 45 "scripts/genksyms/keywords.gperf" 128 + {"struct", STRUCT_KEYW}, 129 + #line 24 "scripts/genksyms/keywords.gperf" 130 + {"__restrict__", RESTRICT_KEYW}, 131 + #line 25 "scripts/genksyms/keywords.gperf" 132 + {"restrict", RESTRICT_KEYW}, 133 + #line 23 "scripts/genksyms/keywords.gperf" 134 + {"_restrict", RESTRICT_KEYW}, 148 135 #line 16 "scripts/genksyms/keywords.gperf" 136 + {"__inline__", INLINE_KEYW}, 137 + #line 10 "scripts/genksyms/keywords.gperf" 138 + {"__attribute", ATTRIBUTE_KEYW}, 139 + {""}, 140 + #line 14 "scripts/genksyms/keywords.gperf" 149 141 {"__extension__", EXTENSION_KEYW}, 150 - #line 37 "scripts/genksyms/keywords.gperf" 142 + #line 35 "scripts/genksyms/keywords.gperf" 151 143 {"enum", ENUM_KEYW}, 152 - #line 8 "scripts/genksyms/keywords.gperf" 153 - {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, 154 - #line 38 "scripts/genksyms/keywords.gperf" 144 + #line 19 "scripts/genksyms/keywords.gperf" 145 + {"__volatile", VOLATILE_KEYW}, 146 + #line 36 "scripts/genksyms/keywords.gperf" 155 147 {"extern", EXTERN_KEYW}, 156 148 {""}, 157 - #line 19 "scripts/genksyms/keywords.gperf" 158 - {"__signed", SIGNED_KEYW}, 159 - #line 9 "scripts/genksyms/keywords.gperf" 160 - {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 161 - #line 49 "scripts/genksyms/keywords.gperf" 162 - {"union", UNION_KEYW}, 163 - #line 53 "scripts/genksyms/keywords.gperf" 164 - {"typeof", TYPEOF_KEYW}, 165 - #line 48 "scripts/genksyms/keywords.gperf" 166 - {"typedef", TYPEDEF_KEYW}, 167 149 #line 17 "scripts/genksyms/keywords.gperf" 150 + {"__signed", SIGNED_KEYW}, 151 + #line 7 "scripts/genksyms/keywords.gperf" 152 + {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 153 + {""}, 154 + #line 51 "scripts/genksyms/keywords.gperf" 155 + {"typeof", TYPEOF_KEYW}, 156 + #line 46 "scripts/genksyms/keywords.gperf" 157 + {"typedef", TYPEDEF_KEYW}, 158 + #line 15 "scripts/genksyms/keywords.gperf" 168 159 {"__inline", INLINE_KEYW}, 169 - #line 33 "scripts/genksyms/keywords.gperf" 160 + #line 31 "scripts/genksyms/keywords.gperf" 170 161 {"auto", AUTO_KEYW}, 171 - #line 21 "scripts/genksyms/keywords.gperf" 172 - {"__volatile", VOLATILE_KEYW}, 162 + #line 47 "scripts/genksyms/keywords.gperf" 163 + {"union", UNION_KEYW}, 164 + {""}, {""}, 165 + #line 48 "scripts/genksyms/keywords.gperf" 166 + {"unsigned", UNSIGNED_KEYW}, 167 + #line 49 "scripts/genksyms/keywords.gperf" 168 + {"void", VOID_KEYW}, 169 + #line 42 "scripts/genksyms/keywords.gperf" 170 + {"short", SHORT_KEYW}, 173 171 {""}, {""}, 174 172 #line 50 "scripts/genksyms/keywords.gperf" 175 - {"unsigned", UNSIGNED_KEYW}, 176 - {""}, 177 - #line 44 "scripts/genksyms/keywords.gperf" 178 - {"short", SHORT_KEYW}, 179 - #line 40 "scripts/genksyms/keywords.gperf" 180 - {"inline", INLINE_KEYW}, 181 - {""}, 182 - #line 52 "scripts/genksyms/keywords.gperf" 183 173 {"volatile", VOLATILE_KEYW}, 184 - #line 42 "scripts/genksyms/keywords.gperf" 185 - {"long", LONG_KEYW}, 186 - #line 24 "scripts/genksyms/keywords.gperf" 187 - {"_Bool", BOOL_KEYW}, 188 - {""}, {""}, 189 - #line 43 "scripts/genksyms/keywords.gperf" 190 - {"register", REGISTER_KEYW}, 191 - #line 51 "scripts/genksyms/keywords.gperf" 192 - {"void", VOID_KEYW}, 193 - #line 39 "scripts/genksyms/keywords.gperf" 174 + {""}, 175 + #line 37 "scripts/genksyms/keywords.gperf" 194 176 {"float", FLOAT_KEYW}, 195 - #line 36 "scripts/genksyms/keywords.gperf" 177 + #line 34 "scripts/genksyms/keywords.gperf" 196 178 {"double", DOUBLE_KEYW}, 197 - {""}, {""}, {""}, {""}, 198 - #line 45 "scripts/genksyms/keywords.gperf" 199 - {"signed", SIGNED_KEYW} 179 + {""}, 180 + #line 5 "scripts/genksyms/keywords.gperf" 181 + {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 182 + {""}, {""}, 183 + #line 38 "scripts/genksyms/keywords.gperf" 184 + {"inline", INLINE_KEYW}, 185 + #line 6 "scripts/genksyms/keywords.gperf" 186 + {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 187 + #line 41 "scripts/genksyms/keywords.gperf" 188 + {"register", REGISTER_KEYW}, 189 + {""}, 190 + #line 22 "scripts/genksyms/keywords.gperf" 191 + {"_Bool", BOOL_KEYW}, 192 + #line 43 "scripts/genksyms/keywords.gperf" 193 + {"signed", SIGNED_KEYW}, 194 + {""}, {""}, 195 + #line 40 "scripts/genksyms/keywords.gperf" 196 + {"long", LONG_KEYW} 200 197 }; 201 198 202 199 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-2
scripts/genksyms/keywords.gperf
··· 5 5 EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW 6 6 EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW 7 7 EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW 8 - EXPORT_UNUSED_SYMBOL, EXPORT_SYMBOL_KEYW 9 - EXPORT_UNUSED_SYMBOL_GPL, EXPORT_SYMBOL_KEYW 10 8 __asm, ASM_KEYW 11 9 __asm__, ASM_KEYW 12 10 __attribute, ATTRIBUTE_KEYW
+13 -8
scripts/kallsyms.c
··· 130 130 static int symbol_valid(struct sym_entry *s) 131 131 { 132 132 /* Symbols which vary between passes. Passes 1 and 2 must have 133 - * identical symbol lists. 133 + * identical symbol lists. The kallsyms_* symbols below are only added 134 + * after pass 1, they would be included in pass 2 when --all-symbols is 135 + * specified so exclude them to get a stable symbol list. 134 136 */ 135 137 static char *special_symbols[] = { 138 + "kallsyms_addresses", 139 + "kallsyms_num_syms", 140 + "kallsyms_names", 141 + "kallsyms_markers", 142 + "kallsyms_token_table", 143 + "kallsyms_token_index", 144 + 136 145 /* Exclude linker generated symbols which vary between passes */ 137 146 "_SDA_BASE_", /* ppc */ 138 147 "_SDA2_BASE_", /* ppc */ ··· 173 164 } 174 165 175 166 /* Exclude symbols which vary between passes. */ 176 - if (strstr((char *)s->sym + offset, "_compiled.") || 177 - strncmp((char*)s->sym + offset, "__compound_literal.", 19) == 0 || 178 - strncmp((char*)s->sym + offset, "__compound_literal$", 19) == 0) 167 + if (strstr((char *)s->sym + offset, "_compiled.")) 179 168 return 0; 180 169 181 170 for (i = 0; special_symbols[i]; i++) ··· 550 543 usage(); 551 544 552 545 read_map(stdin); 553 - if (table_cnt) { 554 - sort_symbols(); 555 - optimize_token_table(); 556 - } 546 + sort_symbols(); 547 + optimize_token_table(); 557 548 write_src(); 558 549 559 550 return 0;
+5 -2
scripts/mksysmap
··· 37 37 38 38 # readprofile starts reading symbols when _stext is found, and 39 39 # continue until it finds a symbol which is not either of 'T', 't', 40 - # 'W' or 'w'. 40 + # 'W' or 'w'. __crc_ are 'A' and placed in the middle 41 + # so we just ignore them to let readprofile continue to work. 42 + # (At least sparc64 has __crc_ in the middle). 41 43 42 - $NM -n $1 | grep -v '\( [aNUw] \)\|\( \$[adt]\)' > $2 44 + $NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $2 45 +
-22
scripts/strip-symbols
··· 1 - <*> 2 - *.h 3 - __compound_literal[$.][0-9]* 4 - __crc_[a-zA-Z_]* 5 - __exitcall_[a-zA-Z_]* 6 - __func__[$.][0-9]* 7 - __FUNCTION__[$.][0-9]* 8 - gcc[0-9]_compiled[$.] 9 - __initcall_[a-zA-Z_]* 10 - __kcrctab_[a-zA-Z_]* 11 - __kstrtab_[a-zA-Z_]* 12 - __ksymtab_[a-zA-Z_]* 13 - __mod_[a-zA-Z_]*[0-9] 14 - __module_depends 15 - __param_[a-zA-Z_]* 16 - __pci_fixup_*PCI_ANY_IDPCI_ANY_ID* 17 - __pci_fixup_*PCI_ANY_IDPCI_DEVICE_ID_* 18 - __pci_fixup_*PCI_VENDOR_ID_*PCI_ANY_ID* 19 - __pci_fixup_*PCI_VENDOR_ID_*PCI_DEVICE_ID_* 20 - __PRETTY_FUNCTION__[$.][0-9]* 21 - __setup_[a-zA-Z_]* 22 - ____versions