Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp362968rwi; Wed, 2 Nov 2022 12:51:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ie/avEXnd1LFGkYWaAf0aXJ7hcdEQYEgINpYbqbdH7KthbEEpVlwqzpeuLyMuTcRSv8lW X-Received: by 2002:a63:4845:0:b0:460:1693:acff with SMTP id x5-20020a634845000000b004601693acffmr23320304pgk.538.1667418686695; Wed, 02 Nov 2022 12:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667418686; cv=none; d=google.com; s=arc-20160816; b=RrLZ6Y2FOnBvjyLoOSuHK3Vb4LDC2igLlIEgJN/svui9QWiA+nRUy9oJtwzalHSXmn JjyhipSZQJDZmXGVzqV90lZpIqseQo7CONca/FZrVqC981Yy9Seq7kk/VyVK6x25DSmn XTKAVyogoaxumN+aFoxCV5CxUbMBnpWCq8BLvl/K801nyKLkJZKTK+nSakFYBJouFgs+ 5Zr+Hcqhgz56QeJlxF4nI/snxTUgQIxvHEXD4ZstTn8dddjdgQf9S+9CT/+Pit5SfGUS x/NANNLeM/ujqVGXtg5aqpTKdyzb9pV1IWAHj6lK9jdDipYPKG2yFdQuRaSOHHS+pYE5 frqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vTS/O7bKOK20gn7KYPNrS7YWwra7O+DzmSO2vtg56/Y=; b=HwbrPXCOoNHU9KmK7VSjD9YMPEYm2P4AC7PqgcbbULi6ou7GBG+tPotLEDxQl6D5T7 eJkKrn/QJPHEzNsDuSYvfzS00tGcMSyfmZmaJLiIblGNToUFjyAfEfuUOjNON4tZVxx8 l/gWk4KyQ9eFOkmiLG7r1SNUOOR43EXzSTuJZcODdo8xEQn6WgUbVvellNPxwknClxPt 3gaUd7hnFrYN1crqgPpc7OUCUsj42OPmMN2o53IVAslXNLOi9cLo0vNaRokGcHytj8hV OMkY7nmCu0/ELhesGTxewxgz+EWSn5L1MNsxC0BRVvJLgb4W98z7OK65ZnWTdE2dzSPe 9PFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ue9CFnS8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a170902f68900b00186c41eced7si17392996plg.36.2022.11.02.12.51.06; Wed, 02 Nov 2022 12:51:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ue9CFnS8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbiKBT2L (ORCPT + 98 others); Wed, 2 Nov 2022 15:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231259AbiKBT2J (ORCPT ); Wed, 2 Nov 2022 15:28:09 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D808E9; Wed, 2 Nov 2022 12:28:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id E4DC7CE22F3; Wed, 2 Nov 2022 19:28:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EE96C433C1; Wed, 2 Nov 2022 19:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667417281; bh=V99NLxJ1CDCsDjWVw5q4vkveJIgk3tjkI5VceymN/co=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ue9CFnS8VoJ6tE2L4PugKig1jik6FLf1TPSy6ukmoIcd4SGDw/xJxpfndt8isuMLz 0SEYkArxfClPVmQr/5nrjAxBscJZG5jdke9prS736gnUDwCTm87EAV6Q1mKWbpWkHn xVBlONl1r1sBHrPHgy0BcuOKdm//X7MUHZy3or0ywjhzy3ul7Cbv8w6X+ET1z0Hjs/ dYU+h7K04Dx38NhV8RBStlzaZzInMw2NpbYzcEtZUPOMaFoabxlcI4/nKpttT37VTF /N1VnRXvE8gndLvs+4DTCsoh6R7avGfydive79lfFVHAb3EfCrNic3BvFllDKEiBya KqygYaMs2qMOw== Date: Wed, 2 Nov 2022 12:27:58 -0700 From: Nathan Chancellor To: Rongwei Zhang Cc: Thomas Bogendoerfer , Ralf Baechle , Maxim Uvarov , Nick Desaulniers , Tom Rix , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] MIPS: fix duplicate definitions for exported symbols Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 02, 2022 at 08:27:39PM +0800, Rongwei Zhang wrote: > Building with clang-14 fails with: > > AS arch/mips/kernel/relocate_kernel.o > :0: error: symbol 'kexec_args' is already defined > :0: error: symbol 'secondary_kexec_args' is already defined > :0: error: symbol 'kexec_start_address' is already defined > :0: error: symbol 'kexec_indirection_page' is already defined > :0: error: symbol 'relocate_new_kernel_size' is already defined > > It turns out EXPORT defined in asm/asm.h expands to a symbol definition, > so there is no need to define these symbols again. Remove duplicated > symbol definitions. > > Fixes: 7aa1c8f47e7e ("MIPS: kdump: Add support") > Signed-off-by: Rongwei Zhang Indeed. I had a similar diff when I looked into this late last year but I never got around to sending that diff. https://github.com/ClangBuiltLinux/linux/issues/1528#issuecomment-988235109 Reviewed-by: Nathan Chancellor Thanks for the patch! > --- > arch/mips/kernel/relocate_kernel.S | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) > > diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S > index cfde14b48fd8..f5b2ef979b43 100644 > --- a/arch/mips/kernel/relocate_kernel.S > +++ b/arch/mips/kernel/relocate_kernel.S > @@ -145,8 +145,7 @@ LEAF(kexec_smp_wait) > * kexec_args[0..3] are used to prepare register values. > */ > > -kexec_args: > - EXPORT(kexec_args) > +EXPORT(kexec_args) > arg0: PTR_WD 0x0 > arg1: PTR_WD 0x0 > arg2: PTR_WD 0x0 > @@ -159,8 +158,7 @@ arg3: PTR_WD 0x0 > * their registers a0-a3. secondary_kexec_args[0..3] are used > * to prepare register values. > */ > -secondary_kexec_args: > - EXPORT(secondary_kexec_args) > +EXPORT(secondary_kexec_args) > s_arg0: PTR_WD 0x0 > s_arg1: PTR_WD 0x0 > s_arg2: PTR_WD 0x0 > @@ -171,19 +169,16 @@ kexec_flag: > > #endif > > -kexec_start_address: > - EXPORT(kexec_start_address) > +EXPORT(kexec_start_address) > PTR_WD 0x0 > .size kexec_start_address, PTRSIZE > > -kexec_indirection_page: > - EXPORT(kexec_indirection_page) > +EXPORT(kexec_indirection_page) > PTR_WD 0 > .size kexec_indirection_page, PTRSIZE > > relocate_new_kernel_end: > > -relocate_new_kernel_size: > - EXPORT(relocate_new_kernel_size) > +EXPORT(relocate_new_kernel_size) > PTR_WD relocate_new_kernel_end - relocate_new_kernel > .size relocate_new_kernel_size, PTRSIZE > -- > 2.38.1 >