From patchwork Tue Nov 5 02:20:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 3139011 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 588A99F3C4 for ; Tue, 5 Nov 2013 03:27:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52A74205EC for ; Tue, 5 Nov 2013 03:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 669AE205AD for ; Tue, 5 Nov 2013 03:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919Ab3KED12 (ORCPT ); Mon, 4 Nov 2013 22:27:28 -0500 Received: from ozlabs.org ([203.10.76.45]:60762 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819Ab3KED12 (ORCPT ); Mon, 4 Nov 2013 22:27:28 -0500 Received: by ozlabs.org (Postfix, from userid 1011) id 6F8102C019C; Tue, 5 Nov 2013 14:27:27 +1100 (EST) From: Rusty Russell To: Stephen Rothwell Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Kleen , Subject: Re: linux-next: build warnings after merge of the modules tree In-Reply-To: <20131104134134.48665968dd006e3310333993@canb.auug.org.au> References: <20131104134134.48665968dd006e3310333993@canb.auug.org.au> User-Agent: Notmuch/0.15.2 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Tue, 05 Nov 2013 12:50:33 +1030 Message-ID: <87fvrba8su.fsf@rustcorp.com.au> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Stephen Rothwell writes: > Hi Rusty, > > After merging the modules tree, today's linux-next build (x86_64 > allmodconfig) produced these warning: > > WARNING: vmlinux: 'pci_restore_msi_state' exported twice. Previous export was in vmlinux > WARNING: vmlinux: '__mod_zone_page_state' exported twice. Previous export was in vmlinux > WARNING: vmlinux: 'scsi_prep_return' exported twice. Previous export was in vmlinux > WARNING: vmlinux: 'hvc_poll' exported twice. Previous export was in vmlinux > WARNING: vmlinux: 'nfs_clear_inode' exported twice. Previous export was in vmlinux > > (just some samples ... it scrolled off my scrollback :-() > > Presumably caused by commit e0f244c63fc9 ("asmlinkage, module: Make > ksymtab and kcrctab symbols and __this_module __visible"). (reverting > that commit makes the warnings go away.) This works for me.... feedback please! Cheers, Rusty. modpost: fix bogus 'exported twice' warnings. Andi's change in e0f244c63fc9 ("asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible") make the crc appear first in the symbol table. modpost creates an entry when it sees the CRC, then when it sees the actual symbol, it complains that it's seen it before. The preloaded flag already exists for the equivalent case where we loaded from Module.symvers, so use that. Signed-off-by: Rusty Russell --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9b873ac6ed7b..5c677a3e7487 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -164,7 +164,7 @@ struct symbol { unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */ unsigned int kernel:1; /* 1 if symbol is from kernel * (only for external modules) **/ - unsigned int preloaded:1; /* 1 if symbol from Module.symvers */ + unsigned int preloaded:1; /* 1 if symbol from Module.symvers, or crc */ enum export export; /* Type of export */ char name[0]; }; @@ -332,8 +332,11 @@ static void sym_update_crc(const char *name, struct module *mod, { struct symbol *s = find_symbol(name); - if (!s) + if (!s) { s = new_symbol(name, mod, export); + /* Don't complain when we find it later. */ + s->preloaded = 1; + } s->crc = crc; s->crc_valid = 1; }