Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4893512ybi; Tue, 30 Jul 2019 09:59:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNvngBfERjWib5CetXH+HDJ2/0nnh5zHIt7lovM6V0xyTCgXBYp8S4P0BnymlA5iXdjYSM X-Received: by 2002:a17:90a:9f0b:: with SMTP id n11mr78719084pjp.98.1564505944636; Tue, 30 Jul 2019 09:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564505944; cv=none; d=google.com; s=arc-20160816; b=OFQPFhyUE4ur+/KOC8QJQrpHVyupu3ShDLGwrAzNrFq6oFCdNGrjKIOjcVo9U1sjtD GnU7EjLT6TS/TAybyFXual66kQkaWn3bSIsp+0Sfocc4u75ssD8kdarowKFoP9zPNsEH ixfj3RLTnqzfMphRGGh9cF2UNISIhWiDj7dEtzzi55e3oul09euBdGg4iGqhi+OX37vf w5sq6iXlaoNpv+LlNvsnJob4F7ctXQr9PRFtUyy/9y4FbM0t1e3YsgtM3ba5RwWzqmTe y/0NShFKfDgc5QYfr6GymnswXVXMXDiLjKsnyHMv23xLjURURVCbur6Vr1LSR260Gp+U yY1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=IgLumb9MAqzHCb15Mc0pwpcDGFeDvUjDUIMAgIXJu/M=; b=PlK5RvrPyTLHU3/ZuYnkcR6KmCQfivJvzNMrK2d5EHqfTv6goXHXx5USYcfSbdNtJ8 5StYp7VD3nYiP5jzjVCIkVw3AY86C0JvmpgYPxwVQIxg4TifNOEKio6gZGfDVDV3rnpE 2CGMf8hJiykxkA6mO47l9MSmzDSSZJCzGEdtnbPGeA2rVPLGunMIewpGTBJTnKGSpdF5 FY+wOyLezjTp4qUk8u8GdEKttqYZWucGHKOCYWl2MudXIznxbs0dROR+aek6WLjo+gEc yAYaTz8sbCJ8C4PuaJywEmir3KekYyOesR6aB+XG/04E19Uf6eBRIRLZEf5b4e8IEjsC BmLw== ARC-Authentication-Results: i=1; mx.google.com; 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 c1si26866071plr.405.2019.07.30.09.58.49; Tue, 30 Jul 2019 09:59:04 -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; 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 S1729341AbfG3Qo7 (ORCPT + 99 others); Tue, 30 Jul 2019 12:44:59 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39067 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728271AbfG3Qo6 (ORCPT ); Tue, 30 Jul 2019 12:44:58 -0400 Received: by mail-pf1-f193.google.com with SMTP id f17so26144034pfn.6; Tue, 30 Jul 2019 09:44:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IgLumb9MAqzHCb15Mc0pwpcDGFeDvUjDUIMAgIXJu/M=; b=b4bmnj+VCaujyNoHm8oPIQT/L0SpoyWZGQZ0uC7eTz9TRVkRyvYvgYcoSJpAvMMPZz swgegMeg6IlkV/3ABbhbrnpHNq27gM7rSvm/4QdbDtxSz90gotrSs6JceEe8H30Jj4kc eqdBzPzNcVi/47wScP3v+ywlMM12SwiWFsTnZEpxU3eoyddgaBRSd1cWBF6cnwK7ZrsQ PP057Je2/E2sLPqfKiXYz2XBDhsE9uXT3wDYnue/8cVsqhsjQkeDaYo6nZqvGoMrIbLT D7tF14SA7r2yYnXlDpCGYuxBQBI4bl9zDbxpi9MvWvCJt4AKd7KmhsxayeW1Lg1GNIJA l6fw== X-Gm-Message-State: APjAAAV1ASwau7ojZ0HydDWAbxuB4wbLFPrqzcMQDiNjoAZvq8S5fjSo qvhFtw+bcmyyf/lmlqZklTer7Ea4 X-Received: by 2002:a17:90b:f0e:: with SMTP id br14mr117837277pjb.117.1564505097732; Tue, 30 Jul 2019 09:44:57 -0700 (PDT) Received: from [192.168.1.105] ([194.135.60.194]) by smtp.gmail.com with ESMTPSA id h70sm60845304pgc.36.2019.07.30.09.44.53 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 09:44:57 -0700 (PDT) Subject: Re: [PATCH v3] modpost: check for static EXPORT_SYMBOL* functions To: Masahiro Yamada Cc: Stephen Rothwell , Michal Marek , Emil Velikov , Linux Kbuild mailing list , Linux Kernel Mailing List References: <20190714152817.24693-1-efremov@linux.com> <20190729141801.31333-1-efremov@linux.com> <20190730082618.5bb5edf3@canb.auug.org.au> <1b6f749c-2a25-219a-3eb3-0f2c7a542426@linux.com> From: Denis Efremov Message-ID: Date: Tue, 30 Jul 2019 19:44:49 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.07.2019 19:29, Masahiro Yamada wrote: > I prefer this, but why do you need to check type? > > Doesn't this work? > > for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { > unsigned char bind = ELF_ST_BIND(sym->st_info); > > struct symbol *s = find_symbol(remove_dot(info.strtab + > sym->st_name)); > > if (s && (bind == STB_GLOBAL || bind == STB_WEAK)) > s->is_static = 0; > } This works. However, I thought it will be too costly to call find_symbol on each symbol. Hence, 'type == STT_OBJECT || type == STT_FUNC || type == STT_NOTYPE' is a small performance optimization because we need to check only variables and functions. Is it worth to remove it in v4? Denis