2013-10-24 13:50:11 +00:00
|
|
|
--- a/scripts/kallsyms.c
|
|
|
|
+++ b/scripts/kallsyms.c
|
|
|
|
@@ -54,6 +54,7 @@ static struct text_range text_ranges[] =
|
|
|
|
static struct sym_entry *table;
|
|
|
|
static unsigned int table_size, table_cnt;
|
|
|
|
static int all_symbols = 0;
|
|
|
|
+static int uncompressed = 0;
|
|
|
|
static char symbol_prefix_char = '\0';
|
2013-11-05 17:46:18 +00:00
|
|
|
static unsigned long long kernel_start_addr = 0;
|
2013-10-24 13:50:11 +00:00
|
|
|
|
2013-11-05 17:46:18 +00:00
|
|
|
@@ -367,6 +368,9 @@ static void write_src(void)
|
2013-10-24 13:50:11 +00:00
|
|
|
|
|
|
|
free(markers);
|
|
|
|
|
|
|
|
+ if (uncompressed)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
output_label("kallsyms_token_table");
|
|
|
|
off = 0;
|
|
|
|
for (i = 0; i < 256; i++) {
|
2013-11-05 17:46:18 +00:00
|
|
|
@@ -425,6 +429,9 @@ static void *find_token(unsigned char *s
|
2013-10-24 13:50:11 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
+ if (uncompressed)
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
|
|
for (i = 0; i < len - 1; i++) {
|
|
|
|
if (str[i] == token[0] && str[i+1] == token[1])
|
|
|
|
return &str[i];
|
2013-11-05 17:46:18 +00:00
|
|
|
@@ -497,6 +504,9 @@ static void optimize_result(void)
|
2013-10-24 13:50:11 +00:00
|
|
|
{
|
|
|
|
int i, best;
|
|
|
|
|
|
|
|
+ if (uncompressed)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
/* using the '\0' symbol last allows compress_symbols to use standard
|
|
|
|
* fast string functions */
|
|
|
|
for (i = 255; i >= 0; i--) {
|
2013-11-05 17:46:18 +00:00
|
|
|
@@ -656,7 +666,9 @@ int main(int argc, char **argv)
|
|
|
|
} else if (strncmp(argv[i], "--page-offset=", 14) == 0) {
|
|
|
|
const char *p = &argv[i][14];
|
|
|
|
kernel_start_addr = strtoull(p, NULL, 16);
|
2013-10-24 13:50:11 +00:00
|
|
|
- } else
|
|
|
|
+ } else if (strcmp(argv[i], "--uncompressed") == 0)
|
|
|
|
+ uncompressed = 1;
|
|
|
|
+ else
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
} else if (argc != 1)
|
|
|
|
--- a/init/Kconfig
|
|
|
|
+++ b/init/Kconfig
|
|
|
|
@@ -1289,6 +1289,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
|
|
|
|
the unaligned access emulation.
|
|
|
|
see arch/parisc/kernel/unaligned.c for reference
|
|
|
|
|
|
|
|
+config KALLSYMS_UNCOMPRESSED
|
|
|
|
+ bool "Keep kallsyms uncompressed"
|
|
|
|
+ depends on KALLSYMS
|
|
|
|
+ help
|
|
|
|
+ Normally kallsyms contains compressed symbols (using a token table),
|
|
|
|
+ reducing the uncompressed kernel image size. Keeping the symbol table
|
|
|
|
+ uncompressed significantly improves the size of this part in compressed
|
|
|
|
+ kernel images.
|
|
|
|
+
|
|
|
|
+ Say N unless you need compressed kernel images to be small.
|
|
|
|
+
|
|
|
|
config HAVE_PCSPKR_PLATFORM
|
|
|
|
bool
|
|
|
|
|
|
|
|
--- a/scripts/link-vmlinux.sh
|
|
|
|
+++ b/scripts/link-vmlinux.sh
|
2014-02-13 12:57:36 +00:00
|
|
|
@@ -86,6 +86,10 @@ kallsyms()
|
|
|
|
kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
|
|
|
|
fi
|
2013-10-24 13:50:11 +00:00
|
|
|
|
|
|
|
+ if [ -n "${CONFIG_KALLSYMS_UNCOMPRESSED}" ]; then
|
|
|
|
+ kallsymopt="${kallsymopt} --uncompressed"
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
|
|
|
|
${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
|
|
|
|
|
|
|
|
--- a/kernel/kallsyms.c
|
|
|
|
+++ b/kernel/kallsyms.c
|
|
|
|
@@ -108,6 +108,11 @@ static unsigned int kallsyms_expand_symb
|
|
|
|
* For every byte on the compressed symbol data, copy the table
|
|
|
|
* entry for that byte.
|
|
|
|
*/
|
|
|
|
+#ifdef CONFIG_KALLSYMS_UNCOMPRESSED
|
|
|
|
+ memcpy(result, data + 1, len - 1);
|
|
|
|
+ result += len - 1;
|
|
|
|
+ len = 0;
|
|
|
|
+#endif
|
|
|
|
while (len) {
|
|
|
|
tptr = &kallsyms_token_table[kallsyms_token_index[*data]];
|
|
|
|
data++;
|
|
|
|
@@ -140,6 +145,9 @@ tail:
|
|
|
|
*/
|
|
|
|
static char kallsyms_get_symbol_type(unsigned int off)
|
|
|
|
{
|
|
|
|
+#ifdef CONFIG_KALLSYMS_UNCOMPRESSED
|
|
|
|
+ return kallsyms_names[off + 1];
|
|
|
|
+#endif
|
|
|
|
/*
|
|
|
|
* Get just the first code, look it up in the token table,
|
|
|
|
* and return the first char from this token.
|