From patchwork Tue Aug 28 15:00:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10578709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA304139B for ; Tue, 28 Aug 2018 15:21:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA5E52A5D5 for ; Tue, 28 Aug 2018 15:21:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8C842A5ED; Tue, 28 Aug 2018 15:21:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89F192A5E8 for ; Tue, 28 Aug 2018 15:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbeH1TNW convert rfc822-to-8bit (ORCPT ); Tue, 28 Aug 2018 15:13:22 -0400 Received: from prv1-mh.provo.novell.com ([137.65.248.33]:37195 "EHLO prv1-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726807AbeH1TNW (ORCPT ); Tue, 28 Aug 2018 15:13:22 -0400 X-Greylist: delayed 1219 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 Aug 2018 15:13:22 EDT Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Tue, 28 Aug 2018 09:00:59 -0600 Message-Id: <5B8563A702000078001E2A82@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.0.2 Date: Tue, 28 Aug 2018 09:00:55 -0600 From: "Jan Beulich" To: Cc: "Michal Marek" , "Masahiro Yamada" Subject: [PATCH] kallsyms: reduce size a little on 64-bit Mime-Version: 1.0 Content-Disposition: inline Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both kallsyms_num_syms and kallsyms_markers[] don't really need to use unsigned long as their (base) types; unsigned int fully suffices. Signed-off-by: Jan Beulich --- kernel/kallsyms.c | 4 ++-- scripts/kallsyms.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) --- 4.19-rc1/kernel/kallsyms.c +++ 4.19-rc1-kallsyms-reduce-size/kernel/kallsyms.c @@ -37,7 +37,7 @@ extern const u8 kallsyms_names[] __weak; * Tell the compiler that the count isn't in the small data section if the arch * has one (eg: FRV). */ -extern const unsigned long kallsyms_num_syms +extern const unsigned int kallsyms_num_syms __attribute__((weak, section(".rodata"))); extern const unsigned long kallsyms_relative_base @@ -46,7 +46,7 @@ __attribute__((weak, section(".rodata")) extern const u8 kallsyms_token_table[] __weak; extern const u16 kallsyms_token_index[] __weak; -extern const unsigned long kallsyms_markers[] __weak; +extern const unsigned int kallsyms_markers[] __weak; /* * Expand a compressed symbol data into the resulting uncompressed string, --- 4.19-rc1/scripts/kallsyms.c +++ 4.19-rc1-kallsyms-reduce-size/scripts/kallsyms.c @@ -182,6 +182,8 @@ static int symbol_in_range(struct sym_en for (i = 0; i < entries; ++i) { ar = &ranges[i]; + if (!ar->end) + continue; if (s->addr >= ar->start && s->addr <= ar->end) return 1; } @@ -405,7 +407,7 @@ static void write_src(void) } output_label("kallsyms_num_syms"); - printf("\tPTR\t%u\n", table_cnt); + printf("\t.long\t%u\n", table_cnt); printf("\n"); /* table of offset markers, that give the offset in the compressed stream @@ -434,7 +436,7 @@ static void write_src(void) output_label("kallsyms_markers"); for (i = 0; i < ((table_cnt + 255) >> 8); i++) - printf("\tPTR\t%d\n", markers[i]); + printf("\t.long\t%u\n", markers[i]); printf("\n"); free(markers);