From 1513b39a8c8e21e3f8fbebab9fb4c41040ccf695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 27 Oct 2014 18:14:39 +0000 Subject: kernel: start working on 3.18 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit: 1) Copies 3.14 patches 2) Drops mainlined stuff 3) Modifies some patches to apply Signed-off-by: Rafał Miłecki SVN-Revision: 43093 --- .../patches-3.18/203-kallsyms_uncompressed.patch | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 target/linux/generic/patches-3.18/203-kallsyms_uncompressed.patch (limited to 'target/linux/generic/patches-3.18/203-kallsyms_uncompressed.patch') diff --git a/target/linux/generic/patches-3.18/203-kallsyms_uncompressed.patch b/target/linux/generic/patches-3.18/203-kallsyms_uncompressed.patch new file mode 100644 index 0000000000..53229f071a --- /dev/null +++ b/target/linux/generic/patches-3.18/203-kallsyms_uncompressed.patch @@ -0,0 +1,108 @@ +--- a/scripts/kallsyms.c ++++ b/scripts/kallsyms.c +@@ -59,6 +59,7 @@ static struct sym_entry *table; + static unsigned int table_size, table_cnt; + static int all_symbols = 0; + static int absolute_percpu = 0; ++static int uncompressed = 0; + static char symbol_prefix_char = '\0'; + static unsigned long long kernel_start_addr = 0; + +@@ -392,6 +393,9 @@ static void write_src(void) + + free(markers); + ++ if (uncompressed) ++ return; ++ + output_label("kallsyms_token_table"); + off = 0; + for (i = 0; i < 256; i++) { +@@ -450,6 +454,9 @@ static void *find_token(unsigned char *s + { + 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]; +@@ -522,6 +529,9 @@ static void optimize_result(void) + { + 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--) { +@@ -692,7 +702,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); +- } else ++ } else if (strcmp(argv[i], "--uncompressed") == 0) ++ uncompressed = 1; ++ else + usage(); + } + } else if (argc != 1) +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1338,6 +1338,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 +@@ -90,6 +90,10 @@ kallsyms() + kallsymopt="${kallsymopt} --absolute-percpu" + fi + ++ 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 +@@ -109,6 +109,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++; +@@ -141,6 +146,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. -- cgit v1.2.3