Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1402982ybn; Wed, 25 Sep 2019 17:51:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqycXqGaLYDBFUlNArWXTy20Ve110tQbsbiDU2Oqb2RTcm0hjl6JAcz2wS3ouG0tNAGMft3b X-Received: by 2002:a17:906:3294:: with SMTP id 20mr859502ejw.19.1569459065599; Wed, 25 Sep 2019 17:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569459065; cv=none; d=google.com; s=arc-20160816; b=TuUQYaEjV9OxIG4CdJ4BUBoern9omcL9D/+6bZj7X992ZgzOyJkgibsd6QPA9K7o6x HjFZ+k0K6flsFsz8+wxB4WwBomowzZkt/64K/DpXUNyoWE/Riq0hhlG8FqEqG6oLrQDc vcPlToOzbyZ0riWZPtBlp/I1ozkrX67mK1wmffJQeeu8AebxkVQ8Mz24QAZr697p6CVu 86aLlbCqteOH0pBgyWqRsH03DdLjnOYw3hkO7fvNZFJrNF7e1YHs8YXrW4B/Aq8gbSrC yrY9+qzJyhXGPreBaY6Wubpy6iu1iK1fifcqSCH6X2lvjyGZ7oR6pTpBHZ+vfVcIrFvh 1olw== 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:mime-version :user-agent:date:cc:to:from:subject:message-id; bh=HrU7auo28LjlrlVmqT2UJfDVdjohfTohSf+hzYmnyLA=; b=igPw2GvUIOIHuDJWqs8Y2dEBnq7+xSSJlrXcIeaV2YmpMHfdafrQSx7NK8wUViQBXg HY7r2/ctBPX+F3cWDOvnyjmYGVPXekGnl5oXqsGDZFhO+sBaMyNs3Sra3wlig+h/YBEV pKhpfT5A/qgu/UO//06q/Uw3ehimTa12Oz4MX85GKy35e1UkuHSFAHoUh3fmK7ZXI+k2 tnz3I6mp8hVEhfTtt1+jpEh4q3E/DaM5ZWGGw7/EmPN1lCcpan1DDadp28ivaUegE115 ongjZzYqUhMTMJvXZoqaYUTvNityeTK5usghVg9nGs8mJh53Z0GhOR1ulU+RsIOmR9go R7nA== 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 g21si397564edq.289.2019.09.25.17.50.42; Wed, 25 Sep 2019 17:51:05 -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 S2394835AbfIXIRs (ORCPT + 99 others); Tue, 24 Sep 2019 04:17:48 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:37660 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388712AbfIXIRs (ORCPT ); Tue, 24 Sep 2019 04:17:48 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iCg0z-00008t-OU; Tue, 24 Sep 2019 10:17:41 +0200 Message-ID: Subject: static EXPORT_SYMBOL checker causes false positives on ARCH=um From: Johannes Berg To: linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, Denis Efremov , Masahiro Yamada , Emil Velikov Cc: linux-kbuild@vger.kernel.org Date: Tue, 24 Sep 2019 10:17:40 +0200 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, With the new commit 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions") we get a lot of 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 [...] see https://p.sipsolutions.net/7232995f34907b9d.txt This hack fixes *most* of them: diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 820eed87fb43..3e443563ebea 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1931,12 +1931,18 @@ static void check_sec_ref(struct module *mod, const char *modname, static char *remove_dot(char *s) { size_t n = strcspn(s, "."); + char *at; if (n && s[n]) { size_t m = strspn(s + n + 1, "0123456789"); if (m && (s[n + m] == '.' || s[n + m] == 0)) s[n] = 0; } + + at = strchr(s, '@'); + if (at) + *at = 0; + return s; } (but obviously just serves to give you an idea of what's going on). With that, only two remain for me: WARNING: "__guard" [vmlinux] is a static EXPORT_SYMBOL WARNING: "__stack_smash_handler" [vmlinux] is a static EXPORT_SYMBOL and I think that's because they don't even exist at all, so arguably the code shouldn't export them, but I didn't find a way to detect at build time if -fstack-protector was enabled or not? Any thoughts? Thanks, johannes