From patchwork Wed May 9 07:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135206 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5309397lji; Wed, 9 May 2018 00:25:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo6Y9qsuWrD+UvLLk3LC4ksx4D3Z2MNjKrrID5Ae3EKx3a7KE6FwRhJ2ewItC4cYmJKvCLx X-Received: by 2002:a63:6fc8:: with SMTP id k191-v6mr35094990pgc.330.1525850735595; Wed, 09 May 2018 00:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525850735; cv=none; d=google.com; s=arc-20160816; b=jUzhYud2yzb6FqDPmSBWO7eSrAPL8x8K19IwanEXZNLWv552vYoINdBiF5pD5neGY5 gHC9/ahu6rtFSyB603zR19JXNDDmajPLgdRcepbauOMnnteZmzaHsHSPW8BYstvrwjwg T0lcEtbnm/scBRasHmvpnBSc46hGISPh59k4SxlXMgkRg/QOw00bOdeMsFf2POkqOhX7 GJeljmRMkEr60Q14Pww9FCnkDS1u+sP2xGl1o4B9kkmGlfp/4o9uBOHj0FaheECQbD8Z V+KKR2lzId+xNWbwozinKHw0L6oMucsRgAzEiZnjc6y18/77Ec8uOEvgktLrOfk0SSKl KVdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=LSg+NhNBxIuxf4HCWPbHsIcLNCNwXBF+p2zvctk59vQ=; b=0Wy1IS1/X9ml1mxIzbdfdqS6J1UcQf1tSsqf/pbLAWhoic0nIchQpbydoFU0VLa0O3 xevsY/TekyButH8KIkZnAEyZgICA1mK+dko7d45H5n1IKTd+nydTOlQnjkcL+Wv616qi OdSTXgT85CmkFsv3sXEwVDJIv8pYeO5G2QmelvAbS3fHfojdlDOb4DRrhEdJ5BQGzJ6H j8OPopN6bT9+FDG33YjW3AVtUx/whGXf7UE7YF47nmDpZFI56STE/6ZnvFJSrbIjyokw gtlCgY1QQYsk7H/kIYNQcQYcmlMPBKuFSgPwdCEg6mWA5T0AhQKx+Ue6eAtCWJ/OHLTH Cu8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=q+BHlexP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si24616296plo.592.2018.05.09.00.25.35; Wed, 09 May 2018 00:25:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=q+BHlexP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756241AbeEIHY4 (ORCPT + 29 others); Wed, 9 May 2018 03:24:56 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:50745 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756211AbeEIHYu (ORCPT ); Wed, 9 May 2018 03:24:50 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w497O36D028852; Wed, 9 May 2018 16:24:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w497O36D028852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525850645; bh=LSg+NhNBxIuxf4HCWPbHsIcLNCNwXBF+p2zvctk59vQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+BHlexPUtLgFr53WXn+g5kbTKUiTXL6xIkSflpudYKU3j5FJimHuVDl0eu6R9WV5 3iyDRqxbhXldLcDJjML1g9l0V/A3tFNQDJFUPcSNFjk2lUNUrPuIJH0mgQ6bI92mZ5 1VV37j5rnc9rWW68pb1SM9a7ClhLnTOjVrW+/IxyK22bwHYqzbG/zTlAsX5ehr0rWO Q3tp6fNhASvA280zOxB0SrWW0irWwhU7VQ584/fENlBsvvpAHNbvuW8T3fBDXMietA +uAX18JXTlZCP1eXfj9q9xQbHyWh3tsZqi2tOYdlwxMfDfZ/1Chvi0nNoQfZqwQFjt bmZFayscrvy9Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Arnd Bergmann , Joe Perches , Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/8] modpost: remove symbol prefix support Date: Wed, 9 May 2018 16:23:45 +0900 Message-Id: <1525850632-10921-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525850632-10921-1-git-send-email-yamada.masahiro@socionext.com> References: <1525850632-10921-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX was selected by BLACKFIN, METAG. They were removed by commit 4ba66a976072 ("arch: remove blackfin port"), commit bb6fb6dfcc17 ("metag: Remove arch/metag/"), respectively. No more architecture enables CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX, hence VMLINUX_SYMBOL_STR(foo) can be simplify replaced with "foo". Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) -- 2.7.4 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 4ff08a0..bc71925 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -19,9 +19,7 @@ #include #include #include "modpost.h" -#include "../../include/generated/autoconf.h" #include "../../include/linux/license.h" -#include "../../include/linux/export.h" /* Are we using CONFIG_MODVERSIONS? */ static int modversions = 0; @@ -591,7 +589,7 @@ static void parse_elf_finish(struct elf_info *info) static int ignore_undef_symbol(struct elf_info *info, const char *symname) { /* ignore __this_module, it will be resolved shortly */ - if (strcmp(symname, VMLINUX_SYMBOL_STR(__this_module)) == 0) + if (strcmp(symname, "__this_module") == 0) return 1; /* ignore global offset table */ if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0) @@ -617,9 +615,6 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) return 0; } -#define CRC_PFX VMLINUX_SYMBOL_STR(__crc_) -#define KSYMTAB_PFX VMLINUX_SYMBOL_STR(__ksymtab_) - static void handle_modversions(struct module *mod, struct elf_info *info, Elf_Sym *sym, const char *symname) { @@ -634,7 +629,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, export = export_from_sec(info, get_secindex(info, sym)); /* CRC'd symbol */ - if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { + if (strncmp(symname, "__crc_", strlen("__crc_")) == 0) { is_crc = true; crc = (unsigned int) sym->st_value; if (sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS) { @@ -647,7 +642,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, info->sechdrs[sym->st_shndx].sh_addr : 0); crc = *crcp; } - sym_update_crc(symname + strlen(CRC_PFX), mod, crc, + sym_update_crc(symname + strlen("__crc_"), mod, crc, export); } @@ -685,15 +680,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info, } #endif -#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX - if (symname[0] != '_') - break; - else - symname++; -#endif if (is_crc) { const char *e = is_vmlinux(mod->name) ?"":".ko"; - warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", symname + strlen(CRC_PFX), mod->name, e); + warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", + symname + strlen("__crc_"), mod->name, e); } mod->unres = alloc_symbol(symname, ELF_ST_BIND(sym->st_info) == STB_WEAK, @@ -701,13 +691,13 @@ static void handle_modversions(struct module *mod, struct elf_info *info, break; default: /* All exported symbols */ - if (strncmp(symname, KSYMTAB_PFX, strlen(KSYMTAB_PFX)) == 0) { - sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, + if (strncmp(symname, "__ksymtab_", strlen("__ksymtab_")) == 0) { + sym_add_exported(symname + strlen("__ksymtab_"), mod, export); } - if (strcmp(symname, VMLINUX_SYMBOL_STR(init_module)) == 0) + if (strcmp(symname, "init_module") == 0) mod->has_init = 1; - if (strcmp(symname, VMLINUX_SYMBOL_STR(cleanup_module)) == 0) + if (strcmp(symname, "cleanup_module") == 0) mod->has_cleanup = 1; break; } @@ -2230,7 +2220,7 @@ static int add_versions(struct buffer *b, struct module *mod) err = 1; break; } - buf_printf(b, "\t{ %#8x, __VMLINUX_SYMBOL_STR(%s) },\n", + buf_printf(b, "\t{ %#8x, \"%s\" },\n", s->crc, s->name); }