From patchwork Mon Nov 13 16:51:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118817 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2014482qgn; Mon, 13 Nov 2017 08:52:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMaLOwHk+Aw3UuxLd/9ycQjDG/taV30F8rdLOqGwkWpFN+EsYRDehTmELxKD6GCZEx8X4Emw X-Received: by 10.159.229.203 with SMTP id t11mr9559053plq.190.1510591948777; Mon, 13 Nov 2017 08:52:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510591948; cv=none; d=google.com; s=arc-20160816; b=oJZLRHq0OWpu4uObGPJF1WeRfp0V7wJy+FvoF4bnTaCpNHpQv7vXbpq7nytgtwJAFN STPJ9MbzWXzeLifvof2l6EHrpeLVJBY9kU52cgNp5Gt8FC9Epi/C7FXGlujCUARHRcHC C148GLcwsFn91wULkC7q4k6OvCLex2YkItXMo/BEaOEf9VqCsLD3HlwaRc2y2si74moc C32Kl9ln4aIjs1qZmvR1s4u7xhSEH2UODKMwvaUCa+zLz9WGM66rDCpCJBgbBOLHL6A+ fajCeM766Aedht/bNMK7bl0oQHKTPm7ECTap5kYUAQav29XGhcVv1H7olJR4Gkhbvbtb SsQQ== 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:arc-authentication-results; bh=kfyw9eSpLdV+ABkWx827vaxIb/mFKRCIZr3LiKa4y8E=; b=GPuYHXtqJVbdB4IU/ePWYOliWtCAwZE6z+XlmBQ3k96WV7I8oQyh0VbN6hULtnqHiz o2poXLXKT45xxPDfVsNQ4xZn88F8NhFPJ3BZ53L8RtuFsul3eQX59mDMOb7ixSO3a+ur SMa1Qttr9VglK8GbnwkLcBnU1dva5kLRDCyarAeBqbrGuI9fcJbQRgm+6hYmQsBy49Pg GmJJ6YuuhG9NeCaN0X/hoVViphJXn5fJexKC+p+9v/PBh5bbiOnDA7BOb6srQZcuxW4f Z4IftGk3z+I8QD1zVqHOgaxBeBgQ+WEWtBIFBX9H0ZxAOajDidBEh/t+pMNqqb66s4D2 TRKQ== 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 60si14284529pla.417.2017.11.13.08.52.28; Mon, 13 Nov 2017 08:52:28 -0800 (PST) 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 S1753958AbdKMQw0 (ORCPT + 27 others); Mon, 13 Nov 2017 11:52:26 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:57869 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753752AbdKMQwZ (ORCPT ); Mon, 13 Nov 2017 11:52:25 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MJYJr-1eCMA50Fz9-0036vC; Mon, 13 Nov 2017 17:52:18 +0100 From: Arnd Bergmann To: Linus Torvalds Cc: Arnd Bergmann , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] /proc/module: fix building without kallsyms Date: Mon, 13 Nov 2017 17:51:00 +0100 Message-Id: <20171113165146.2287420-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171113165146.2287420-1-arnd@arndb.de> References: <20171113165146.2287420-1-arnd@arndb.de> X-Provags-ID: V03:K0:xgWOflf4vguySSloPJH6LKzYbLSs7EUr1piFKbqh8OhtXRlX6pY Coeyh+a3x8W+gmDCqV2PKGNkEZSwPo4vKIlrbbRwhFc8lS21zuCk42gtpCaUEyQLjuM3CuN Oii7H5/mhSuaEYkbtsKcdvz4sQfzdkOsiyKEFRF7SDzpAV/W3l3l6IA49knWrMMy9o9Rw0X Vvy6pRFYy8W7nYBrdKqXw== X-UI-Out-Filterresults: notjunk:1; V01:K0:m7//pRXGoTE=:6eOiRy8xP+qtWde/4SCPIo hspUQbVQWqmMSrMk560FZO0zR1jG3oBc1m50RxUCnJCbplQnmfwaLHpqUGPsjTj90w2D0hLe3 NWAKZpxttvRfswdCNOMINaQAwXU4AlpB0V8WR8S+dZTIpRPCFZ4+DhKaPUwdVh7OYPk/hZhJ7 CpFDNqtFV/wno95fkrygiYNmTFENSlpIH4aV8b7lsCm5D0lmtPQEAMIQ4KlyvI0XC37kCB6k+ MiEYRclonmjhhlCv/4lkZ9sW062+JPar02PGbzzZ23w/0imHUC6ctCEaiJQ3XiAyf0ZNepdNw qWJscGko7191N55Ppr5wnaTCDxFOaea2UcxuSQq57SlvEbqc77NqAwN2AGGS45caU8IBlKWyp /gTuIAgOvMGGLkO3/jf3g65KmfQbOx+nxaWaj3ENJYKe/Et527qiG7Fnn58WuIoJCYz6Htj7b UXMAOYh7KM1ubYZYU58vFBwkLVOh8b7OJ4GSEklYc2L5udb9ikIna19O1ovEP7eB4GcJdvDHm GV2HSubSa32/dtxzlQrThvIZUvbBq2In5HTYino3eO7GFtbTQ19Q55KVyobZR7o28Vgzpn0JA j4RB7t+H9t0nw5UlM/AevfCoRAtz8dydSXJvPR0Nuc/UvPfwpEPTX9YG8SAHIfH6tviulkuFL QxSjXeFrE9HmCwIDgJVasH/mfKmOOOQuin5wA9yxGSK9UDbl301ypkEvX93oTptucS0wI8D/6 Zcwl8frVeiWfaG/8FNmFMofXzX7kBbSODtxHJw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As reported by kernelci and other build bots, we now get a link failure without CONFIG_KALLSYMS: module.c:(.text+0xf2c): undefined reference to `kallsyms_show_value' This adds a dummy helper with the same name that can be used for compilation. It's not entirely clear to me what this should return for !CONFIG_KALLSYMS, I picked an unconditional 'false', which leads to the module address being unavailable to user space. Link: https://kernelci.org/build/mainline/branch/master/kernel/v4.14-5-g516fb7f2e73d/ Fixes: 516fb7f2e73d ("/proc/module: use the same logic as /proc/kallsyms for address exposure") Signed-off-by: Arnd Bergmann --- include/linux/kallsyms.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 0a777c5216b1..708f337d780b 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -14,8 +14,6 @@ #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \ 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1) -/* How and when do we show kallsyms values? */ -extern int kallsyms_show_value(void); #ifndef CONFIG_64BIT # define KALLSYM_FMT "%08lx" #else @@ -54,6 +52,9 @@ extern void __print_symbol(const char *fmt, unsigned long address); int lookup_symbol_name(unsigned long addr, char *symname); int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name); +/* How and when do we show kallsyms values? */ +extern int kallsyms_show_value(void); + #else /* !CONFIG_KALLSYMS */ static inline unsigned long kallsyms_lookup_name(const char *name) @@ -112,6 +113,11 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u return -ERANGE; } +static inline int kallsyms_show_value(void) +{ + return false; +} + /* Stupid that this does nothing, but I didn't create this mess. */ #define __print_symbol(fmt, addr) #endif /*CONFIG_KALLSYMS*/