diff options
| author | Jan Beulich <jbeulich@novell.com> | 2008-12-16 06:30:08 -0500 |
|---|---|---|
| committer | Sam Ravnborg <sam@ravnborg.org> | 2008-12-19 16:47:10 -0500 |
| commit | 9bb482476c6c9d1ae033306440c51ceac93ea80c (patch) | |
| tree | b5e415eee46b66d9cc39e31d29d0d02994321d11 | |
| parent | ad7a953c522ceb496611d127e51e278bfe0ff483 (diff) | |
allow stripping of generated symbols under CONFIG_KALLSYMS_ALL
Building upon parts of the module stripping patch, this patch
introduces similar stripping for vmlinux when CONFIG_KALLSYMS_ALL=y.
Using CONFIG_KALLSYMS_STRIP_GENERATED reduces the overhead of
CONFIG_KALLSYMS_ALL from 245k/310k to 65k/80k for the (i386/x86-64)
kernels I tested with.
The patch also does away with the need to special case the kallsyms-
internal symbols by making them available even in the first linking
stage.
While it is a generated file, the patch includes the changes to
scripts/genksyms/keywords.c_shipped, as I'm unsure what the procedure
here is.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
| -rw-r--r-- | Makefile | 47 | ||||
| -rw-r--r-- | arch/x86/scripts/strip-symbols | 1 | ||||
| -rw-r--r-- | init/Kconfig | 7 | ||||
| -rw-r--r-- | kernel/kallsyms.c | 16 | ||||
| -rw-r--r-- | scripts/genksyms/keywords.c_shipped | 189 | ||||
| -rw-r--r-- | scripts/genksyms/keywords.gperf | 2 | ||||
| -rw-r--r-- | scripts/kallsyms.c | 21 |
7 files changed, 155 insertions, 128 deletions
| @@ -604,6 +604,9 @@ export INSTALL_PATH ?= /boot | |||
| 604 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | 604 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
| 605 | export MODLIB | 605 | export MODLIB |
| 606 | 606 | ||
| 607 | strip-symbols := $(srctree)/scripts/strip-symbols \ | ||
| 608 | $(wildcard $(srctree)/arch/$(ARCH)/scripts/strip-symbols) | ||
| 609 | |||
| 607 | # | 610 | # |
| 608 | # INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while | 611 | # INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while |
| 609 | # they get installed. If INSTALL_MOD_STRIP is '1', then the default | 612 | # they get installed. If INSTALL_MOD_STRIP is '1', then the default |
| @@ -611,8 +614,10 @@ export MODLIB | |||
| 611 | # be used as the option(s) to the objcopy command. | 614 | # be used as the option(s) to the objcopy command. |
| 612 | ifdef INSTALL_MOD_STRIP | 615 | ifdef INSTALL_MOD_STRIP |
| 613 | ifeq ($(INSTALL_MOD_STRIP),1) | 616 | ifeq ($(INSTALL_MOD_STRIP),1) |
| 614 | mod_strip_cmd = $(OBJCOPY) --strip-debug --strip-symbols \ | 617 | mod_strip_cmd = $(OBJCOPY) --strip-debug |
| 615 | $(srctree)/scripts/strip-symbols --wildcard | 618 | ifeq ($(CONFIG_KALLSYMS_ALL),$(CONFIG_KALLSYMS_STRIP_GENERATED)) |
| 619 | mod_strip_cmd += --wildcard $(addprefix --strip-symbols ,$(strip-symbols)) | ||
| 620 | endif | ||
| 616 | else | 621 | else |
| 617 | mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP) | 622 | mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP) |
| 618 | endif # INSTALL_MOD_STRIP=1 | 623 | endif # INSTALL_MOD_STRIP=1 |
| @@ -747,6 +752,7 @@ last_kallsyms := 2 | |||
| 747 | endif | 752 | endif |
| 748 | 753 | ||
| 749 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 754 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
| 755 | kallsyms.h := $(wildcard include/config/kallsyms/*.h) $(wildcard include/config/kallsyms/*/*.h) | ||
| 750 | 756 | ||
| 751 | define verify_kallsyms | 757 | define verify_kallsyms |
| 752 | $(Q)$(if $($(quiet)cmd_sysmap), \ | 758 | $(Q)$(if $($(quiet)cmd_sysmap), \ |
| @@ -771,24 +777,41 @@ endef | |||
| 771 | 777 | ||
| 772 | # Generate .S file with all kernel symbols | 778 | # Generate .S file with all kernel symbols |
| 773 | quiet_cmd_kallsyms = KSYM $@ | 779 | quiet_cmd_kallsyms = KSYM $@ |
| 774 | cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ | 780 | cmd_kallsyms = { test $* -eq 0 || $(NM) -n $<; } \ |
| 775 | $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ | 781 | | $(KALLSYMS) $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) >$@ |
| 776 | 782 | ||
| 777 | .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE | 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 | ||
| 778 | $(call if_changed_dep,as_o_S) | 788 | $(call if_changed_dep,as_o_S) |
| 779 | 789 | ||
| 780 | .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) | 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) | ||
| 781 | $(call cmd,kallsyms) | 795 | $(call cmd,kallsyms) |
| 782 | 796 | ||
| 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 | ||
| 783 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version | 805 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version |
| 784 | .tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE | 806 | .tmp_vmlinux%: $(vmlinux-lds) $(vmlinux-all) FORCE |
| 785 | $(call if_changed_rule,ksym_ld) | 807 | $(if $(filter 1,$*),$(call if_changed_rule,ksym_ld),$(call if_changed,vmlinux__)) |
| 786 | 808 | ||
| 787 | .tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE | 809 | .tmp_vmlinux0$(strip-ext): |
| 788 | $(call if_changed,vmlinux__) | 810 | $(Q)echo "placeholder" >$@ |
| 789 | 811 | ||
| 790 | .tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE | 812 | .tmp_vmlinux1: .tmp_kallsyms0.o |
| 791 | $(call if_changed,vmlinux__) | 813 | .tmp_vmlinux2: .tmp_kallsyms1.o |
| 814 | .tmp_vmlinux3: .tmp_kallsyms2.o | ||
| 792 | 815 | ||
| 793 | # Needs to visit scripts/ before $(KALLSYMS) can be used. | 816 | # Needs to visit scripts/ before $(KALLSYMS) can be used. |
| 794 | $(KALLSYMS): scripts ; | 817 | $(KALLSYMS): scripts ; |
diff --git a/arch/x86/scripts/strip-symbols b/arch/x86/scripts/strip-symbols new file mode 100644 index 000000000000..a2f1ccb827c7 --- /dev/null +++ b/arch/x86/scripts/strip-symbols | |||
| @@ -0,0 +1 @@ | |||
| __cpu_vendor_dev_X86_VENDOR_* | |||
diff --git a/init/Kconfig b/init/Kconfig index f763762d544a..0f5af409fef1 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
| @@ -588,6 +588,13 @@ config KALLSYMS_ALL | |||
| 588 | 588 | ||
| 589 | Say N. | 589 | Say N. |
| 590 | 590 | ||
| 591 | config KALLSYMS_STRIP_GENERATED | ||
| 592 | bool "Strip machine generated symbols from kallsyms" | ||
| 593 | depends on KALLSYMS_ALL | ||
| 594 | default y | ||
| 595 | help | ||
| 596 | Say N if you want kallsyms to retain even machine generated symbols. | ||
| 597 | |||
| 591 | config KALLSYMS_EXTRA_PASS | 598 | config KALLSYMS_EXTRA_PASS |
| 592 | bool "Do an extra kallsyms pass" | 599 | bool "Do an extra kallsyms pass" |
| 593 | depends on KALLSYMS | 600 | depends on KALLSYMS |
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 7b8b0f21a5b1..e694afa0eb8c 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c | |||
| @@ -30,20 +30,19 @@ | |||
| 30 | #define all_var 0 | 30 | #define all_var 0 |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | /* These will be re-linked against their real values during the second link stage */ | 33 | extern const unsigned long kallsyms_addresses[]; |
| 34 | extern const unsigned long kallsyms_addresses[] __attribute__((weak)); | 34 | extern const u8 kallsyms_names[]; |
| 35 | extern const u8 kallsyms_names[] __attribute__((weak)); | ||
| 36 | 35 | ||
| 37 | /* tell the compiler that the count isn't in the small data section if the arch | 36 | /* tell the compiler that the count isn't in the small data section if the arch |
| 38 | * has one (eg: FRV) | 37 | * has one (eg: FRV) |
| 39 | */ | 38 | */ |
| 40 | extern const unsigned long kallsyms_num_syms | 39 | extern const unsigned long kallsyms_num_syms |
| 41 | __attribute__((weak, section(".rodata"))); | 40 | __attribute__((__section__(".rodata"))); |
| 42 | 41 | ||
| 43 | extern const u8 kallsyms_token_table[] __attribute__((weak)); | 42 | extern const u8 kallsyms_token_table[]; |
| 44 | extern const u16 kallsyms_token_index[] __attribute__((weak)); | 43 | extern const u16 kallsyms_token_index[]; |
| 45 | 44 | ||
| 46 | extern const unsigned long kallsyms_markers[] __attribute__((weak)); | 45 | extern const unsigned long kallsyms_markers[]; |
| 47 | 46 | ||
| 48 | static inline int is_kernel_inittext(unsigned long addr) | 47 | static inline int is_kernel_inittext(unsigned long addr) |
| 49 | { | 48 | { |
| @@ -168,9 +167,6 @@ static unsigned long get_symbol_pos(unsigned long addr, | |||
| 168 | unsigned long symbol_start = 0, symbol_end = 0; | 167 | unsigned long symbol_start = 0, symbol_end = 0; |
| 169 | unsigned long i, low, high, mid; | 168 | unsigned long i, low, high, mid; |
| 170 | 169 | ||
| 171 | /* This kernel should never had been booted. */ | ||
| 172 | BUG_ON(!kallsyms_addresses); | ||
| 173 | |||
| 174 | /* do a binary search on the sorted kallsyms_addresses array */ | 170 | /* do a binary search on the sorted kallsyms_addresses array */ |
| 175 | low = 0; | 171 | low = 0; |
| 176 | high = kallsyms_num_syms; | 172 | high = kallsyms_num_syms; |
diff --git a/scripts/genksyms/keywords.c_shipped b/scripts/genksyms/keywords.c_shipped index 971e0113ae7a..83484fe93ede 100644 --- a/scripts/genksyms/keywords.c_shipped +++ b/scripts/genksyms/keywords.c_shipped | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* ANSI-C code produced by gperf version 3.0.2 */ | 1 | /* ANSI-C code produced by gperf version 3.0.1 */ |
| 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 */ | 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 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | 4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
| @@ -32,7 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | #line 3 "scripts/genksyms/keywords.gperf" | 33 | #line 3 "scripts/genksyms/keywords.gperf" |
| 34 | struct resword { const char *name; int token; }; | 34 | struct resword { const char *name; int token; }; |
| 35 | /* maximum key range = 62, duplicates = 0 */ | 35 | /* maximum key range = 64, duplicates = 0 */ |
| 36 | 36 | ||
| 37 | #ifdef __GNUC__ | 37 | #ifdef __GNUC__ |
| 38 | __inline | 38 | __inline |
| @@ -46,32 +46,32 @@ is_reserved_hash (register const char *str, register unsigned int len) | |||
| 46 | { | 46 | { |
| 47 | static const unsigned char asso_values[] = | 47 | static const unsigned char asso_values[] = |
| 48 | { | 48 | { |
| 49 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 49 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 50 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 50 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 51 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 51 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 52 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 52 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 53 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 53 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 54 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 54 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 55 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 5, | 55 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, |
| 56 | 65, 65, 65, 65, 65, 65, 35, 65, 65, 65, | 56 | 67, 67, 67, 67, 67, 67, 15, 67, 67, 67, |
| 57 | 0, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 57 | 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 58 | 65, 65, 65, 65, 65, 0, 65, 0, 65, 5, | 58 | 67, 67, 67, 67, 67, 0, 67, 0, 67, 5, |
| 59 | 20, 15, 10, 30, 65, 15, 65, 65, 20, 0, | 59 | 25, 20, 15, 30, 67, 15, 67, 67, 10, 0, |
| 60 | 10, 35, 20, 65, 10, 5, 0, 10, 5, 65, | 60 | 10, 40, 20, 67, 10, 5, 0, 10, 15, 67, |
| 61 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 61 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 62 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 62 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 63 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 63 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 64 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 64 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 65 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 65 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 66 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 66 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 67 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 67 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 68 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 68 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 69 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 69 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 70 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 70 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 71 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 71 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 72 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 72 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 73 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 73 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
| 74 | 65, 65, 65, 65, 65, 65 | 74 | 67, 67, 67, 67, 67, 67 |
| 75 | }; | 75 | }; |
| 76 | return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; | 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,116 +84,119 @@ is_reserved_word (register const char *str, register unsigned int len) | |||
| 84 | { | 84 | { |
| 85 | enum | 85 | enum |
| 86 | { | 86 | { |
| 87 | TOTAL_KEYWORDS = 43, | 87 | TOTAL_KEYWORDS = 45, |
| 88 | MIN_WORD_LENGTH = 3, | 88 | MIN_WORD_LENGTH = 3, |
| 89 | MAX_WORD_LENGTH = 24, | 89 | MAX_WORD_LENGTH = 24, |
| 90 | MIN_HASH_VALUE = 3, | 90 | MIN_HASH_VALUE = 3, |
| 91 | MAX_HASH_VALUE = 64 | 91 | MAX_HASH_VALUE = 66 |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | static const struct resword wordlist[] = | 94 | static const struct resword wordlist[] = |
| 95 | { | 95 | { |
| 96 | {""}, {""}, {""}, | 96 | {""}, {""}, {""}, |
| 97 | #line 26 "scripts/genksyms/keywords.gperf" | 97 | #line 28 "scripts/genksyms/keywords.gperf" |
| 98 | {"asm", ASM_KEYW}, | 98 | {"asm", ASM_KEYW}, |
| 99 | {""}, | 99 | {""}, |
| 100 | #line 8 "scripts/genksyms/keywords.gperf" | 100 | #line 10 "scripts/genksyms/keywords.gperf" |
| 101 | {"__asm", ASM_KEYW}, | 101 | {"__asm", ASM_KEYW}, |
| 102 | {""}, | 102 | {""}, |
| 103 | #line 9 "scripts/genksyms/keywords.gperf" | 103 | #line 11 "scripts/genksyms/keywords.gperf" |
| 104 | {"__asm__", ASM_KEYW}, | 104 | {"__asm__", ASM_KEYW}, |
| 105 | {""}, {""}, | 105 | {""}, {""}, |
| 106 | #line 52 "scripts/genksyms/keywords.gperf" | 106 | #line 54 "scripts/genksyms/keywords.gperf" |
| 107 | {"__typeof__", TYPEOF_KEYW}, | 107 | {"__typeof__", TYPEOF_KEYW}, |
| 108 | {""}, | 108 | {""}, |
| 109 | #line 12 "scripts/genksyms/keywords.gperf" | 109 | #line 14 "scripts/genksyms/keywords.gperf" |
| 110 | {"__const", CONST_KEYW}, | 110 | {"__const", CONST_KEYW}, |
| 111 | #line 11 "scripts/genksyms/keywords.gperf" | ||
| 112 | {"__attribute__", ATTRIBUTE_KEYW}, | ||
| 113 | #line 13 "scripts/genksyms/keywords.gperf" | 111 | #line 13 "scripts/genksyms/keywords.gperf" |
| 112 | {"__attribute__", ATTRIBUTE_KEYW}, | ||
| 113 | #line 15 "scripts/genksyms/keywords.gperf" | ||
| 114 | {"__const__", CONST_KEYW}, | 114 | {"__const__", CONST_KEYW}, |
| 115 | #line 18 "scripts/genksyms/keywords.gperf" | 115 | #line 20 "scripts/genksyms/keywords.gperf" |
| 116 | {"__signed__", SIGNED_KEYW}, | 116 | {"__signed__", SIGNED_KEYW}, |
| 117 | #line 44 "scripts/genksyms/keywords.gperf" | 117 | #line 46 "scripts/genksyms/keywords.gperf" |
| 118 | {"static", STATIC_KEYW}, | 118 | {"static", STATIC_KEYW}, |
| 119 | #line 20 "scripts/genksyms/keywords.gperf" | 119 | {""}, |
| 120 | {"__volatile__", VOLATILE_KEYW}, | 120 | #line 41 "scripts/genksyms/keywords.gperf" |
| 121 | #line 39 "scripts/genksyms/keywords.gperf" | ||
| 122 | {"int", INT_KEYW}, | 121 | {"int", INT_KEYW}, |
| 123 | #line 32 "scripts/genksyms/keywords.gperf" | 122 | #line 34 "scripts/genksyms/keywords.gperf" |
| 124 | {"char", CHAR_KEYW}, | 123 | {"char", CHAR_KEYW}, |
| 125 | #line 33 "scripts/genksyms/keywords.gperf" | 124 | #line 35 "scripts/genksyms/keywords.gperf" |
| 126 | {"const", CONST_KEYW}, | 125 | {"const", CONST_KEYW}, |
| 127 | #line 45 "scripts/genksyms/keywords.gperf" | 126 | #line 47 "scripts/genksyms/keywords.gperf" |
| 128 | {"struct", STRUCT_KEYW}, | 127 | {"struct", STRUCT_KEYW}, |
| 129 | #line 24 "scripts/genksyms/keywords.gperf" | 128 | #line 26 "scripts/genksyms/keywords.gperf" |
| 130 | {"__restrict__", RESTRICT_KEYW}, | 129 | {"__restrict__", RESTRICT_KEYW}, |
| 131 | #line 25 "scripts/genksyms/keywords.gperf" | 130 | #line 27 "scripts/genksyms/keywords.gperf" |
| 132 | {"restrict", RESTRICT_KEYW}, | 131 | {"restrict", RESTRICT_KEYW}, |
| 133 | #line 23 "scripts/genksyms/keywords.gperf" | 132 | #line 7 "scripts/genksyms/keywords.gperf" |
| 134 | {"_restrict", RESTRICT_KEYW}, | 133 | {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, |
| 135 | #line 16 "scripts/genksyms/keywords.gperf" | 134 | #line 18 "scripts/genksyms/keywords.gperf" |
| 136 | {"__inline__", INLINE_KEYW}, | 135 | {"__inline__", INLINE_KEYW}, |
| 137 | #line 10 "scripts/genksyms/keywords.gperf" | ||
| 138 | {"__attribute", ATTRIBUTE_KEYW}, | ||
| 139 | {""}, | 136 | {""}, |
| 140 | #line 14 "scripts/genksyms/keywords.gperf" | 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 | #line 12 "scripts/genksyms/keywords.gperf" | ||
| 145 | {"__attribute", ATTRIBUTE_KEYW}, | ||
| 146 | #line 6 "scripts/genksyms/keywords.gperf" | ||
| 147 | {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, | ||
| 148 | #line 16 "scripts/genksyms/keywords.gperf" | ||
| 141 | {"__extension__", EXTENSION_KEYW}, | 149 | {"__extension__", EXTENSION_KEYW}, |
| 142 | #line 35 "scripts/genksyms/keywords.gperf" | 150 | #line 37 "scripts/genksyms/keywords.gperf" |
| 143 | {"enum", ENUM_KEYW}, | 151 | {"enum", ENUM_KEYW}, |
| 144 | #line 19 "scripts/genksyms/keywords.gperf" | 152 | #line 8 "scripts/genksyms/keywords.gperf" |
| 145 | {"__volatile", VOLATILE_KEYW}, | 153 | {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, |
| 146 | #line 36 "scripts/genksyms/keywords.gperf" | 154 | #line 38 "scripts/genksyms/keywords.gperf" |
| 147 | {"extern", EXTERN_KEYW}, | 155 | {"extern", EXTERN_KEYW}, |
| 148 | {""}, | 156 | {""}, |
| 149 | #line 17 "scripts/genksyms/keywords.gperf" | 157 | #line 19 "scripts/genksyms/keywords.gperf" |
| 150 | {"__signed", SIGNED_KEYW}, | 158 | {"__signed", SIGNED_KEYW}, |
| 151 | #line 7 "scripts/genksyms/keywords.gperf" | 159 | #line 9 "scripts/genksyms/keywords.gperf" |
| 152 | {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, | 160 | {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, |
| 153 | {""}, | 161 | #line 49 "scripts/genksyms/keywords.gperf" |
| 154 | #line 51 "scripts/genksyms/keywords.gperf" | 162 | {"union", UNION_KEYW}, |
| 163 | #line 53 "scripts/genksyms/keywords.gperf" | ||
| 155 | {"typeof", TYPEOF_KEYW}, | 164 | {"typeof", TYPEOF_KEYW}, |
| 156 | #line 46 "scripts/genksyms/keywords.gperf" | 165 | #line 48 "scripts/genksyms/keywords.gperf" |
| 157 | {"typedef", TYPEDEF_KEYW}, | 166 | {"typedef", TYPEDEF_KEYW}, |
| 158 | #line 15 "scripts/genksyms/keywords.gperf" | 167 | #line 17 "scripts/genksyms/keywords.gperf" |
| 159 | {"__inline", INLINE_KEYW}, | 168 | {"__inline", INLINE_KEYW}, |
| 160 | #line 31 "scripts/genksyms/keywords.gperf" | 169 | #line 33 "scripts/genksyms/keywords.gperf" |
| 161 | {"auto", AUTO_KEYW}, | 170 | {"auto", AUTO_KEYW}, |
| 162 | #line 47 "scripts/genksyms/keywords.gperf" | 171 | #line 21 "scripts/genksyms/keywords.gperf" |
| 163 | {"union", UNION_KEYW}, | 172 | {"__volatile", VOLATILE_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}, | ||
| 171 | {""}, {""}, | 173 | {""}, {""}, |
| 172 | #line 50 "scripts/genksyms/keywords.gperf" | 174 | #line 50 "scripts/genksyms/keywords.gperf" |
| 173 | {"volatile", VOLATILE_KEYW}, | 175 | {"unsigned", UNSIGNED_KEYW}, |
| 174 | {""}, | ||
| 175 | #line 37 "scripts/genksyms/keywords.gperf" | ||
| 176 | {"float", FLOAT_KEYW}, | ||
| 177 | #line 34 "scripts/genksyms/keywords.gperf" | ||
| 178 | {"double", DOUBLE_KEYW}, | ||
| 179 | {""}, | 176 | {""}, |
| 180 | #line 5 "scripts/genksyms/keywords.gperf" | 177 | #line 44 "scripts/genksyms/keywords.gperf" |
| 181 | {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, | 178 | {"short", SHORT_KEYW}, |
| 182 | {""}, {""}, | 179 | #line 40 "scripts/genksyms/keywords.gperf" |
| 183 | #line 38 "scripts/genksyms/keywords.gperf" | ||
| 184 | {"inline", INLINE_KEYW}, | 180 | {"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 | {""}, | 181 | {""}, |
| 190 | #line 22 "scripts/genksyms/keywords.gperf" | 182 | #line 52 "scripts/genksyms/keywords.gperf" |
| 183 | {"volatile", VOLATILE_KEYW}, | ||
| 184 | #line 42 "scripts/genksyms/keywords.gperf" | ||
| 185 | {"long", LONG_KEYW}, | ||
| 186 | #line 24 "scripts/genksyms/keywords.gperf" | ||
| 191 | {"_Bool", BOOL_KEYW}, | 187 | {"_Bool", BOOL_KEYW}, |
| 192 | #line 43 "scripts/genksyms/keywords.gperf" | ||
| 193 | {"signed", SIGNED_KEYW}, | ||
| 194 | {""}, {""}, | 188 | {""}, {""}, |
| 195 | #line 40 "scripts/genksyms/keywords.gperf" | 189 | #line 43 "scripts/genksyms/keywords.gperf" |
| 196 | {"long", LONG_KEYW} | 190 | {"register", REGISTER_KEYW}, |
| 191 | #line 51 "scripts/genksyms/keywords.gperf" | ||
| 192 | {"void", VOID_KEYW}, | ||
| 193 | #line 39 "scripts/genksyms/keywords.gperf" | ||
| 194 | {"float", FLOAT_KEYW}, | ||
| 195 | #line 36 "scripts/genksyms/keywords.gperf" | ||
| 196 | {"double", DOUBLE_KEYW}, | ||
| 197 | {""}, {""}, {""}, {""}, | ||
| 198 | #line 45 "scripts/genksyms/keywords.gperf" | ||
| 199 | {"signed", SIGNED_KEYW} | ||
| 197 | }; | 200 | }; |
| 198 | 201 | ||
| 199 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | 202 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf index 5ef3733225fb..8abe7ab8d88f 100644 --- a/scripts/genksyms/keywords.gperf +++ b/scripts/genksyms/keywords.gperf | |||
| @@ -5,6 +5,8 @@ struct resword { const char *name; int token; } | |||
| 5 | EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW | 5 | EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW |
| 6 | EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW | 6 | EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW |
| 7 | EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW | 7 | EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW |
| 8 | EXPORT_UNUSED_SYMBOL, EXPORT_SYMBOL_KEYW | ||
| 9 | EXPORT_UNUSED_SYMBOL_GPL, EXPORT_SYMBOL_KEYW | ||
| 8 | __asm, ASM_KEYW | 10 | __asm, ASM_KEYW |
| 9 | __asm__, ASM_KEYW | 11 | __asm__, ASM_KEYW |
| 10 | __attribute, ATTRIBUTE_KEYW | 12 | __attribute, ATTRIBUTE_KEYW |
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index ad2434b26970..92758120a767 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
| @@ -130,18 +130,9 @@ static int read_symbol(FILE *in, struct sym_entry *s) | |||
| 130 | static int symbol_valid(struct sym_entry *s) | 130 | static int symbol_valid(struct sym_entry *s) |
| 131 | { | 131 | { |
| 132 | /* Symbols which vary between passes. Passes 1 and 2 must have | 132 | /* Symbols which vary between passes. Passes 1 and 2 must have |
| 133 | * identical symbol lists. The kallsyms_* symbols below are only added | 133 | * identical symbol lists. |
| 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. | ||
| 136 | */ | 134 | */ |
| 137 | static char *special_symbols[] = { | 135 | 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 | |||
| 145 | /* Exclude linker generated symbols which vary between passes */ | 136 | /* Exclude linker generated symbols which vary between passes */ |
| 146 | "_SDA_BASE_", /* ppc */ | 137 | "_SDA_BASE_", /* ppc */ |
| 147 | "_SDA2_BASE_", /* ppc */ | 138 | "_SDA2_BASE_", /* ppc */ |
| @@ -173,7 +164,9 @@ static int symbol_valid(struct sym_entry *s) | |||
| 173 | } | 164 | } |
| 174 | 165 | ||
| 175 | /* Exclude symbols which vary between passes. */ | 166 | /* Exclude symbols which vary between passes. */ |
| 176 | if (strstr((char *)s->sym + offset, "_compiled.")) | 167 | if (strstr((char *)s->sym + offset, "_compiled.") || |
| 168 | strncmp((char*)s->sym + offset, "__compound_literal.", 19) == 0 || | ||
| 169 | strncmp((char*)s->sym + offset, "__compound_literal$", 19) == 0) | ||
| 177 | return 0; | 170 | return 0; |
| 178 | 171 | ||
| 179 | for (i = 0; special_symbols[i]; i++) | 172 | for (i = 0; special_symbols[i]; i++) |
| @@ -550,8 +543,10 @@ int main(int argc, char **argv) | |||
| 550 | usage(); | 543 | usage(); |
| 551 | 544 | ||
| 552 | read_map(stdin); | 545 | read_map(stdin); |
| 553 | sort_symbols(); | 546 | if (table_cnt) { |
| 554 | optimize_token_table(); | 547 | sort_symbols(); |
| 548 | optimize_token_table(); | ||
| 549 | } | ||
| 555 | write_src(); | 550 | write_src(); |
| 556 | 551 | ||
| 557 | return 0; | 552 | return 0; |
