Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1831746ybn; Thu, 26 Sep 2019 02:55:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAINwQoxXF9S3Deo7i6p1kFyNRvfPQGyr9/FaQJxeUhKxPwjsimCqBGJOHnxLaGYrVbMl8 X-Received: by 2002:a05:6402:346:: with SMTP id r6mr2532077edw.124.1569491728874; Thu, 26 Sep 2019 02:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569491728; cv=none; d=google.com; s=arc-20160816; b=idDU5i2EhHZZP2XiA1ASpSO9KFcLy0J6LCBqPeRfBuc+PMaUH117vGHSjkR0phBsxq +/mcVUxBRYoHUNRZjoRx6DqTs/3QR1bKQkNmV6Sx6l8LM/RPJk6bf1f+IcWkbU0l84Hn gYGE3jUOnO49Zzo89Q1/RpaIq3bVcHo4nbbuToaIXRPUwtxCCRn5CM3hKxBQASvsB7FT PI8wRIEzpGnZpH7y2ICk9c90ZMt6NI82QM77xrba6yt/7A8eOSPL1nbN4VvPiqatOw0J 6p8qQYkOimxMPaGJpHA+MDdrMdS4VUVokAfSFrbW3Gk4nfFsPCk7irVL8DGB+htbh2+K JgtQ== 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:subject:autocrypt:references:cc:to:from; bh=nKfUpHLkz9svGgGA7KdFTvOeu1Y3C/BE10QM4lr5FTY=; b=I0qOh9q99/VG+Yx+4zlSrhG7zgkaj3fEUd2hTGzSq+24rZvwQXDhr9QKXLrb+JEqSX rgBcKIjvlKZukIw9FksjWol5ZuPIOooPowz6HbzPRqGmv2i90mG0usfS9DLckbZ+DGDW Ri400hWtWoNX4hfoq69+2j+JlhDtGBOMk5AnGx0HXyCtE8sQMEzmZiVrEv0/FPIns81Y PG4VkFXbXdl0UT9E6GJX8J7E+XQh9v3ywLf/tgUrmGfj5SUWamI3zEzb7z2vNJOSYJpt AzyDI93t+3sh5TboAHfiV6Te1Nx6YmfGgsepFXuprv9LLPh0PYYGU2s+vpX+W+iaEFEZ iNVA== 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 l21si1001306edc.112.2019.09.26.02.55.06; Thu, 26 Sep 2019 02:55:28 -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 S2437582AbfIYSsb (ORCPT + 99 others); Wed, 25 Sep 2019 14:48:31 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35337 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbfIYSsa (ORCPT ); Wed, 25 Sep 2019 14:48:30 -0400 Received: by mail-lj1-f194.google.com with SMTP id m7so6799362lji.2; Wed, 25 Sep 2019 11:48:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:autocrypt:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nKfUpHLkz9svGgGA7KdFTvOeu1Y3C/BE10QM4lr5FTY=; b=b1MDU6ya7eeJRozE9ILR0irVHcH0mex21bfq44VBM5u9rcp8I84A/0PVp7T0TXmMEB BkUvfiFkJXFWZYa6wjc+5PeQ6H05zfHAlqBMEox5dfquVzOjAERHiGD67+Kk+/ETl78Z 6Thhc6JnQDLm7PGt2e/N9MjCmZmvwYmJWbzeZeYT/MOkPFE2DX6Wdxxxy6647dl4a5qF m6qpwpjFljK55k9wCV6yofyr9fuFOcwJArqvbIO/hczAVF6K7cAQ8DXt0/DbxveAu2Cb dT8JJJ1cyTUPOhl8dIdTeJRl5RzxgyPkcYkPGE//pjaC9CvMpvsJvULJmyc7qRc03GH9 NqCg== X-Gm-Message-State: APjAAAVnLttsTFIp6BNw5l4nRhnH1nK1nKnAXvE5goYqds7RSYn4HXDn VblR3nBxzKQsQ1IijjbQPY/ZCHLD X-Received: by 2002:a2e:5d17:: with SMTP id r23mr7551323ljb.229.1569437307705; Wed, 25 Sep 2019 11:48:27 -0700 (PDT) Received: from [10.10.124.58] (99-48-196-88.sta.estpak.ee. [88.196.48.99]) by smtp.gmail.com with ESMTPSA id m21sm1323092lfh.39.2019.09.25.11.48.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Sep 2019 11:48:27 -0700 (PDT) From: Denis Efremov To: Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: Johannes Berg , Michal Marek , linux-kernel@vger.kernel.org References: <20190924120740.12425-1-yamada.masahiro@socionext.com> Autocrypt: addr=efremov@linux.com; keydata= mQINBFsJUXwBEADDnzbOGE/X5ZdHqpK/kNmR7AY39b/rR+2Wm/VbQHV+jpGk8ZL07iOWnVe1 ZInSp3Ze+scB4ZK+y48z0YDvKUU3L85Nb31UASB2bgWIV+8tmW4kV8a2PosqIc4wp4/Qa2A/ Ip6q+bWurxOOjyJkfzt51p6Th4FTUsuoxINKRMjHrs/0y5oEc7Wt/1qk2ljmnSocg3fMxo8+ y6IxmXt5tYvt+FfBqx/1XwXuOSd0WOku+/jscYmBPwyrLdk/pMSnnld6a2Fp1zxWIKz+4VJm QEIlCTe5SO3h5sozpXeWS916VwwCuf8oov6706yC4MlmAqsQpBdoihQEA7zgh+pk10sCvviX FYM4gIcoMkKRex/NSqmeh3V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aRrs6+qMHSd/s3N3j0hR2Uxsski8q6x+LxU1aHS0FFkSl0m8SiazA Gd1zy4pXC2HhCHstF24Nu5iVLPRwlxFS/+o3nB1ZWTwu8I6s2ZF5TAgBfEONV5MIYH3fOb5+ r/HYPye7puSmQ2LCXy7X5IIsnAoxSrcFYq9nGfHNcXhm5x6WjYC0Kz8l4lfwWo8PIpZ8x57v gTH1PI5R4WdRQijLxLCW/AaiuoEYuOLAoW481XtZb0GRRe+Tm9z/fCbkEveyPiDK7oZahBM7 QdWEEV8mqJoOZ3xxqMlJrxKM9SDF+auB4zWGz5jGzCDAx/0qMUrVn2+v8i4oEKW6IUdV7axW Nk9a+EF5JSTbfv0JBYeSHK3WRklSYLdsMRhaCKhSbwo8Xgn/m6a92fKd3NnObvRe76iIEMSw 60iagNE6AFFzuF/GvoIHb2oDUIX4z+/D0TBWH9ADNptmuE+LZnlPUAAEzRgUFtlN5LtJP8ph Subject: Re: [PATCH] modpost: fix static EXPORT_SYMBOL warnings for UML build Message-ID: Date: Wed, 25 Sep 2019 21:48:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20190924120740.12425-1-yamada.masahiro@socionext.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 24.09.2019 15:07, Masahiro Yamada wrote: > Johannes Berg reports lots of modpost warnings on ARCH=um builds: > > WARNING: "rename" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "lseek" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "ftruncate64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "getuid" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "lseek64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "unlink" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "pwrite64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "close" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "opendir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "pread64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "syscall" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "readdir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "readdir64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "futimes" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__lxstat" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "write" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "closedir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__xstat" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "fsync" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__lxstat64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__fxstat64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "telldir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "printf" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "readlink" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__sprintf_chk" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "link" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "rmdir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "fdatasync" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "truncate" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "statfs" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__errno_location" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__xmknod" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "open64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "truncate64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "open" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "read" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "chown" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "chmod" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "utime" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "fchmod" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "seekdir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "ioctl" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "dup2" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "statfs64" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "utimes" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "mkdir" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "fchown" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__guard" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "symlink" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "access" [vmlinux] is a static EXPORT_SYMBOL > WARNING: "__stack_smash_handler" [vmlinux] is a static EXPORT_SYMBOL > > When you run "make", the modpost is run twice; before linking vmlinux, > and before building modules. All the warnings above are from the second > modpost. > > The offending symbols are defined not in vmlinux, but in the C library. > The first modpost is run against the relocatable vmlinux.o, and those > warnings are nicely suppressed because the SH_UNDEF entries from the > symbol table clear the ->is_static flag. > > The second modpost is run against the executable vmlinux (+ modules), > where those symbols have been resolved, but the definitions do not > exist. > > This commit fixes it in a straight forward way. Suppress the static > EXPORT_SYMBOL warnings from "vmlinux". > > We see the same warnings twice anyway. For example, ARCH=arm64 defconfig > shows the following warning twice: > > WARNING: "HYPERVISOR_platform_op" [vmlinux] is a static EXPORT_SYMBOL_GPL > > So, it is reasonable to suppress the second one. Thanks, for fixing it. You can add my if you need Tested-by: Denis Efremov Tested on x86_64 and um arches. I've reverted the commit b08918fb3f2 "lz4: do not export static symbol" and checked for the warning. On um arch I've tested that this fixes the false-positives. > > Fixes: 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions") > Reported-by: Johannes Berg > Signed-off-by: Masahiro Yamada > --- > > scripts/mod/modpost.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index 3961941e8e7a..442d5e2ad688 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -2652,15 +2652,20 @@ int main(int argc, char **argv) > fatal("modpost: Section mismatches detected.\n" > "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); > for (n = 0; n < SYMBOL_HASH_SIZE; n++) { > - struct symbol *s = symbolhash[n]; > + struct symbol *s; > + > + for (s = symbolhash[n]; s; s = s->next) { > + /* > + * Do not check "vmlinux". This avoids the same warnings > + * shown twice, and false-positives for ARCH=um. > + */ > + if (is_vmlinux(s->module->name) && !s->module->is_dot_o) > + continue; > > - while (s) { > if (s->is_static) > warn("\"%s\" [%s] is a static %s\n", > s->name, s->module->name, > export_str(s->export)); > - > - s = s->next; > } > } > >