aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kallsyms.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2008-12-16 06:30:08 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-12-19 16:47:10 -0500
commit9bb482476c6c9d1ae033306440c51ceac93ea80c (patch)
treeb5e415eee46b66d9cc39e31d29d0d02994321d11 /scripts/kallsyms.c
parentad7a953c522ceb496611d127e51e278bfe0ff483 (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>
Diffstat (limited to 'scripts/kallsyms.c')
-rw-r--r--scripts/kallsyms.c21
1 files changed, 8 insertions, 13 deletions
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)
130static int symbol_valid(struct sym_entry *s) 130static 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;