From patchwork Sun Feb 2 05:09:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11361525 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC448924 for ; Sun, 2 Feb 2020 05:09:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82529205F4 for ; Sun, 2 Feb 2020 05:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580620176; bh=VzlLCw3+9FG6HTmHUocz4L1UN2bSC10HD/eqm7EGAmQ=; h=From:To:Cc:Subject:Date:List-ID:From; b=s9jiZyJQFJce5WVZ0VzaLUZpcOz2DNQSmdj9JmmP+XVwvDTgFBSkH9/lPqgskJI57 qGQeef0j91Auy3PhIJr4zIeIPLCsMks5RSEe87xQAuGDV/jhN6bFI5xF/bjQcwcViZ SA216R0i/RrDAMa96s1Q2bGDwn//tlwVcsksuiXg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725962AbgBBFJg (ORCPT ); Sun, 2 Feb 2020 00:09:36 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:58015 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgBBFJg (ORCPT ); Sun, 2 Feb 2020 00:09:36 -0500 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-11.nifty.com with ESMTP id 01259SCZ026546; Sun, 2 Feb 2020 14:09:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com 01259SCZ026546 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1580620168; bh=0KYkc3+fXPLDfoOu9nykrUesAlfwthN/qlBaxElOalE=; h=From:To:Cc:Subject:Date:From; b=NMHjpqsm8UEFuIo6bHwGU3Pf8KTgA5qcwn/OraUGIJmWAU9eGmcservBHTftCJQsa GrgqnOHWFfwR4C3raferS163o0qZoQOLx2wU183f7SoQppDW5xCVSPYeTsZAaUiCfk pU4h3OCnUKRXPDFPtgekz3AcGD0PLo4qSXsdl4upIhxNaBTJI9jVMyeEGqGSusSrxc ST86bjl/XZ1pRJPVFQ92e7XYiejloIRLvTCHjc8R9oUqMU3NPWIns5CMjYa5aWyaQl tRKGUTv+nvK0s6KB44WZ81tPvGnIeDjes+5SXKaNqYrbQe4d1cnVQm334UbJ9kBu+P KTZRxGU4ATsKg== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] scripts/kallsyms: rename local variables in read_symbol() Date: Sun, 2 Feb 2020 14:09:20 +0900 Message-Id: <20200202050922.12402-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org I will use 'sym' for the point to struce sym_entry in the next commit. Rename 'sym', 'stype' to 'name', 'type', which are more intuitive. Signed-off-by: Masahiro Yamada --- scripts/kallsyms.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 94153732ec00..5c34edd98b3e 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -176,43 +176,43 @@ static void check_symbol_range(const char *sym, unsigned long long addr, static int read_symbol(FILE *in, struct sym_entry *s) { - char sym[500], stype; + char name[500], type; int rc; - rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, sym); + rc = fscanf(in, "%llx %c %499s\n", &s->addr, &type, name); if (rc != 3) { - if (rc != EOF && fgets(sym, 500, in) == NULL) + if (rc != EOF && fgets(name, 500, in) == NULL) fprintf(stderr, "Read error or end of file.\n"); return -1; } - if (strlen(sym) >= KSYM_NAME_LEN) { + if (strlen(name) >= KSYM_NAME_LEN) { fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n" "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", - sym, strlen(sym), KSYM_NAME_LEN); + name, strlen(name), KSYM_NAME_LEN); return -1; } - if (is_ignored_symbol(sym, stype)) + if (is_ignored_symbol(name, type)) return -1; /* Ignore most absolute/undefined (?) symbols. */ - if (strcmp(sym, "_text") == 0) + if (strcmp(name, "_text") == 0) _text = s->addr; - check_symbol_range(sym, s->addr, text_ranges, ARRAY_SIZE(text_ranges)); - check_symbol_range(sym, s->addr, &percpu_range, 1); + check_symbol_range(name, s->addr, text_ranges, ARRAY_SIZE(text_ranges)); + check_symbol_range(name, s->addr, &percpu_range, 1); /* include the type field in the symbol name, so that it gets * compressed together */ - s->len = strlen(sym) + 1; + s->len = strlen(name) + 1; s->sym = malloc(s->len + 1); if (!s->sym) { fprintf(stderr, "kallsyms failure: " "unable to allocate required amount of memory\n"); exit(EXIT_FAILURE); } - strcpy(sym_name(s), sym); - s->sym[0] = stype; + strcpy(sym_name(s), name); + s->sym[0] = type; s->percpu_absolute = 0; From patchwork Sun Feb 2 05:09:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11361527 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FEA1924 for ; Sun, 2 Feb 2020 05:09:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 607672082E for ; Sun, 2 Feb 2020 05:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580620177; bh=CTMCGNaup9kKpQBv7l8zMDsY1qi/lcAHvIfULlIgxT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=REQqTwbos/7wYIU80hPZRTaid7ykXolwfBd2MlJkCecHm8acoueK8EMiNUh7mMJB+ gUDmKJrAoOYSJ3nzZV3J39loVQBdAJoLqQ34MNR/ttY8bcmVTh+G83GGYQP5a17+H1 b7Ncurd+GqfW3uUHQTW4t0iH54ZW2HZIQQUOKCNI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbgBBFJh (ORCPT ); Sun, 2 Feb 2020 00:09:37 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:58016 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgBBFJg (ORCPT ); Sun, 2 Feb 2020 00:09:36 -0500 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-11.nifty.com with ESMTP id 01259SCa026546; Sun, 2 Feb 2020 14:09:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com 01259SCa026546 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1580620169; bh=FpjGoOTnJWwYFpKXRxvhi50aKfy5TP5wYDQpTxXJcJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDXhjbdEQtbIIJ/NdixYN+61yLFuljjfkVdbLVfyH6kmreSFEIQAnFLCRmZn3mwVZ vo6wrMRhgzN40SQDAjLNXat0aaQ0o/SwZq9xEFsCLViUJ+hRsZUFQaKEQCwZiKgxYd Ut5d/W+ECZWdQL21RPu8wLSGb6o6ZYk0Q7IE7SdTK4rPb8/cJHFx+KuASShdaqz5DH 0qTRSj2znmRTa4GhzQrjkXUKupjJJM5+n5F4wu95h5hOoxjRaqJAFvboDx15HxYnQZ P08La33mOXK8O/+qktPLbxWWtA6TGkqy6H6FjnZoeGPag8NgSUrHpIs8/1IUBCyUlw 7/3JGm+xFfMTg== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] scripts/kallsyms: change table to store (strcut sym_entry *) Date: Sun, 2 Feb 2020 14:09:21 +0900 Message-Id: <20200202050922.12402-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200202050922.12402-1-masahiroy@kernel.org> References: <20200202050922.12402-1-masahiroy@kernel.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The symbol table is extended every 10000 addition by using realloc(), where data copy might occur to the new buffer. To decrease the amount of possible data copy, let's change the table to store the pointer. The symbol type + symbol name part is appended at the end of (struct sym_entry), and allocated together with the struct body. Signed-off-by: Masahiro Yamada --- scripts/kallsyms.c | 121 ++++++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 5c34edd98b3e..a566d8201b56 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -33,8 +33,8 @@ struct sym_entry { unsigned long long addr; unsigned int len; unsigned int start_pos; - unsigned char *sym; unsigned int percpu_absolute; + unsigned char sym[0]; }; struct addr_range { @@ -55,7 +55,7 @@ static struct addr_range percpu_range = { "__per_cpu_start", "__per_cpu_end", -1ULL, 0 }; -static struct sym_entry *table; +static struct sym_entry **table; static unsigned int table_size, table_cnt; static int all_symbols; static int absolute_percpu; @@ -174,49 +174,55 @@ static void check_symbol_range(const char *sym, unsigned long long addr, } } -static int read_symbol(FILE *in, struct sym_entry *s) +static struct sym_entry *read_symbol(FILE *in) { char name[500], type; + unsigned long long addr; + unsigned int len; + struct sym_entry *sym; int rc; - rc = fscanf(in, "%llx %c %499s\n", &s->addr, &type, name); + rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name); if (rc != 3) { if (rc != EOF && fgets(name, 500, in) == NULL) fprintf(stderr, "Read error or end of file.\n"); - return -1; + return NULL; } if (strlen(name) >= KSYM_NAME_LEN) { fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n" "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", name, strlen(name), KSYM_NAME_LEN); - return -1; + return NULL; } if (is_ignored_symbol(name, type)) - return -1; + return NULL; /* Ignore most absolute/undefined (?) symbols. */ if (strcmp(name, "_text") == 0) - _text = s->addr; + _text = addr; - check_symbol_range(name, s->addr, text_ranges, ARRAY_SIZE(text_ranges)); - check_symbol_range(name, s->addr, &percpu_range, 1); + check_symbol_range(name, addr, text_ranges, ARRAY_SIZE(text_ranges)); + check_symbol_range(name, addr, &percpu_range, 1); /* include the type field in the symbol name, so that it gets * compressed together */ - s->len = strlen(name) + 1; - s->sym = malloc(s->len + 1); - if (!s->sym) { + + len = strlen(name) + 1; + + sym = malloc(sizeof(*sym) + len); + if (!sym) { fprintf(stderr, "kallsyms failure: " "unable to allocate required amount of memory\n"); exit(EXIT_FAILURE); } - strcpy(sym_name(s), name); - s->sym[0] = type; - - s->percpu_absolute = 0; + sym->addr = addr; + sym->len = len; + sym->sym[0] = type; + memcpy(sym_name(sym), name, len); + sym->percpu_absolute = 0; - return 0; + return sym; } static int symbol_in_range(const struct sym_entry *s, @@ -268,12 +274,12 @@ static void shrink_table(void) pos = 0; for (i = 0; i < table_cnt; i++) { - if (symbol_valid(&table[i])) { + if (symbol_valid(table[i])) { if (pos != i) table[pos] = table[i]; pos++; } else { - free(table[i].sym); + free(table[i]); } } table_cnt = pos; @@ -287,7 +293,15 @@ static void shrink_table(void) static void read_map(FILE *in) { + struct sym_entry *sym; + while (!feof(in)) { + sym = read_symbol(in); + if (!sym) + continue; + + sym->start_pos = table_cnt; + if (table_cnt >= table_size) { table_size += 10000; table = realloc(table, sizeof(*table) * table_size); @@ -296,10 +310,8 @@ static void read_map(FILE *in) exit (1); } } - if (read_symbol(in, &table[table_cnt]) == 0) { - table[table_cnt].start_pos = table_cnt; - table_cnt++; - } + + table[table_cnt++] = sym; } } @@ -387,27 +399,27 @@ static void write_src(void) int overflow; if (!absolute_percpu) { - offset = table[i].addr - relative_base; + offset = table[i]->addr - relative_base; overflow = (offset < 0 || offset > UINT_MAX); - } else if (symbol_absolute(&table[i])) { - offset = table[i].addr; + } else if (symbol_absolute(table[i])) { + offset = table[i]->addr; overflow = (offset < 0 || offset > INT_MAX); } else { - offset = relative_base - table[i].addr - 1; + offset = relative_base - table[i]->addr - 1; overflow = (offset < INT_MIN || offset >= 0); } if (overflow) { fprintf(stderr, "kallsyms failure: " "%s symbol value %#llx out of range in relative mode\n", - symbol_absolute(&table[i]) ? "absolute" : "relative", - table[i].addr); + symbol_absolute(table[i]) ? "absolute" : "relative", + table[i]->addr); exit(EXIT_FAILURE); } printf("\t.long\t%#x\n", (int)offset); - } else if (!symbol_absolute(&table[i])) { - output_address(table[i].addr); + } else if (!symbol_absolute(table[i])) { + output_address(table[i]->addr); } else { - printf("\tPTR\t%#llx\n", table[i].addr); + printf("\tPTR\t%#llx\n", table[i]->addr); } } printf("\n"); @@ -437,12 +449,12 @@ static void write_src(void) if ((i & 0xFF) == 0) markers[i >> 8] = off; - printf("\t.byte 0x%02x", table[i].len); - for (k = 0; k < table[i].len; k++) - printf(", 0x%02x", table[i].sym[k]); + printf("\t.byte 0x%02x", table[i]->len); + for (k = 0; k < table[i]->len; k++) + printf(", 0x%02x", table[i]->sym[k]); printf("\n"); - off += table[i].len + 1; + off += table[i]->len + 1; } printf("\n"); @@ -496,7 +508,7 @@ static void build_initial_tok_table(void) unsigned int i; for (i = 0; i < table_cnt; i++) - learn_symbol(table[i].sym, table[i].len); + learn_symbol(table[i]->sym, table[i]->len); } static unsigned char *find_token(unsigned char *str, int len, @@ -520,15 +532,15 @@ static void compress_symbols(const unsigned char *str, int idx) for (i = 0; i < table_cnt; i++) { - len = table[i].len; - p1 = table[i].sym; + len = table[i]->len; + p1 = table[i]->sym; /* find the token on the symbol */ p2 = find_token(p1, len, str); if (!p2) continue; /* decrease the counts for this symbol's tokens */ - forget_symbol(table[i].sym, len); + forget_symbol(table[i]->sym, len); size = len; @@ -547,10 +559,10 @@ static void compress_symbols(const unsigned char *str, int idx) } while (p2); - table[i].len = len; + table[i]->len = len; /* increase the counts for this symbol's new tokens */ - learn_symbol(table[i].sym, len); + learn_symbol(table[i]->sym, len); } } @@ -606,8 +618,8 @@ static void insert_real_symbols_in_table(void) unsigned int i, j, c; for (i = 0; i < table_cnt; i++) { - for (j = 0; j < table[i].len; j++) { - c = table[i].sym[j]; + for (j = 0; j < table[i]->len; j++) { + c = table[i]->sym[j]; best_table[c][0]=c; best_table_len[c]=1; } @@ -660,13 +672,10 @@ static int may_be_linker_script_provide_symbol(const struct sym_entry *se) static int compare_symbols(const void *a, const void *b) { - const struct sym_entry *sa; - const struct sym_entry *sb; + const struct sym_entry *sa = *(const struct sym_entry **)a; + const struct sym_entry *sb = *(const struct sym_entry **)b; int wa, wb; - sa = a; - sb = b; - /* sort by address first */ if (sa->addr > sb->addr) return 1; @@ -697,7 +706,7 @@ static int compare_symbols(const void *a, const void *b) static void sort_symbols(void) { - qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols); + qsort(table, table_cnt, sizeof(table[0]), compare_symbols); } static void make_percpus_absolute(void) @@ -705,14 +714,14 @@ static void make_percpus_absolute(void) unsigned int i; for (i = 0; i < table_cnt; i++) - if (symbol_in_range(&table[i], &percpu_range, 1)) { + if (symbol_in_range(table[i], &percpu_range, 1)) { /* * Keep the 'A' override for percpu symbols to * ensure consistent behavior compared to older * versions of this tool. */ - table[i].sym[0] = 'A'; - table[i].percpu_absolute = 1; + table[i]->sym[0] = 'A'; + table[i]->percpu_absolute = 1; } } @@ -722,12 +731,12 @@ static void record_relative_base(void) unsigned int i; for (i = 0; i < table_cnt; i++) - if (!symbol_absolute(&table[i])) { + if (!symbol_absolute(table[i])) { /* * The table is sorted by address. * Take the first non-absolute symbol value. */ - relative_base = table[i].addr; + relative_base = table[i]->addr; return; } } From patchwork Sun Feb 2 05:09:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11361529 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77EB01395 for ; Sun, 2 Feb 2020 05:10:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55BC92082E for ; Sun, 2 Feb 2020 05:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580620209; bh=zJUlgm6fmNJjWr3K8JXOgKCLNhmff7rt+0qwd5hayLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=n/5Ewk5oPVNYoRXVWGvryKP19sB/SszDLAMRa64eCy3vihcG0Iz3J/Lw3W2h5WgKL /f7UZStkenBQd1paJs8JNWidRk2beRIV8S8IzIRgigbLjy4BvmLC3qUKgXrlEpfynW +ngRmv+tZelJcsWeKT0GsiBPYSWZFhtov8W5aR5Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725942AbgBBFKI (ORCPT ); Sun, 2 Feb 2020 00:10:08 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:58679 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgBBFKI (ORCPT ); Sun, 2 Feb 2020 00:10:08 -0500 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-11.nifty.com with ESMTP id 01259SCb026546; Sun, 2 Feb 2020 14:09:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com 01259SCb026546 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1580620170; bh=2v/7U9X2Qp7z2QLvT/nW2vuRmHa6cW+zJRprBKgnT/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WMhW0/CsotXG4ZcVQGOMx8A5baPUx6bkpXJ3dKGgnDmY3vO2+SsPevLkAQoFQx/Zh /vjbnpWVYI5ugvU3uo/GfH5EanX0PUErp0G4QKnC38jYRklLZ9/AKr64jOhBvgfGGf A6PuPtu4wf1FEY2qITNhnbe5c+xIMFwsTTHoxoKeomXsXZ0qRaSIO5PXNnDb47SKKi 507rPjZ1SGQty1hweR4ZshgU4rv0zrb1dNy+Uu7LYUIR4AC80audAhsgOu+uE1O9Jm bNyY59vMSSnMABQ38pMs53B2UtAmagFB7tlN2CtLXWv4NYBjgn9CBuUJK5A4GujoDm 6BNxlwQAusQwQ== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Greg Kroah-Hartman , Marc Zyngier , Masami Hiramatsu , Thomas Gleixner , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] kallsyms: fix type of kallsyms_token_table[] Date: Sun, 2 Feb 2020 14:09:22 +0900 Message-Id: <20200202050922.12402-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200202050922.12402-1-masahiroy@kernel.org> References: <20200202050922.12402-1-masahiroy@kernel.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org kallsyms_token_table[] only contains ASCII characters. It should be char instead of u8. Signed-off-by: Masahiro Yamada Reviewed-by: Masami Hiramatsu --- kernel/kallsyms.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 136ce049c4ad..53f84f685841 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -44,7 +44,7 @@ __attribute__((weak, section(".rodata"))); extern const unsigned long kallsyms_relative_base __attribute__((weak, section(".rodata"))); -extern const u8 kallsyms_token_table[] __weak; +extern const char kallsyms_token_table[] __weak; extern const u16 kallsyms_token_index[] __weak; extern const unsigned int kallsyms_markers[] __weak; @@ -58,7 +58,8 @@ static unsigned int kallsyms_expand_symbol(unsigned int off, char *result, size_t maxlen) { int len, skipped_first = 0; - const u8 *tptr, *data; + const char *tptr; + const u8 *data; /* Get the compressed symbol length from the first symbol byte. */ data = &kallsyms_names[off];