Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp155353rwi; Wed, 2 Nov 2022 10:20:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4DWafVsCmoAICDbAyYfr1NaPvxTtO4oW0zkjWYTCGsNGuasADk0i43AtqYp2olUmfBeagK X-Received: by 2002:a17:906:eeca:b0:730:6880:c398 with SMTP id wu10-20020a170906eeca00b007306880c398mr25245278ejb.706.1667409652026; Wed, 02 Nov 2022 10:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667409652; cv=none; d=google.com; s=arc-20160816; b=FvsmAkcR4E0Dzo2f91gCKFIg2pvzHhZdgXl4OAtkXr+KJsVMY1IVfodZWGYRTvyYlH 7UzQ2AVotVlIAJsukzevOdvs3k9VVumxV9O7rdEbvIq6bwgC4+o8pcsVPuYNtAL8Cl+L xBTMGLIo9YIcLO2CzhuTwb8M15gA6PGk4TeVAGsG+yZtV7n4RLJ6V7ZrwjkF/oJelPUT ARgHc5KCOLaTFANn11O/ZVMIZYGukAB1RCZlrWxQSc1w82DqCMiJyNfIR5teSpkpakO0 3kyzFfJspJA2qBwcYIObsb7Y8BN9B/Z/TSg6f2R8Wt/kndkeT7ESiMeI1UXCvLV9p132 b71w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=U6Vcbl41w7vxf354PxeVa0+ZZPaRKjL1+gc+44SAfts=; b=UYuyFKNN1jC8faDZRw0QcNddugf7C/VyOdv92OQazfCdH6IjTL170Naus6qtZjMzNo SsKjy2b5XdX35+xf7ah+o3cozhU3TjpbG2eQFNPNmW+m8fLtnKQge8/ZiNzSoaXCAbzY hjtV3jZwBMWc5XatJ/sS0iwxqlY97LtPKJcx13dBLbUIc/NLI9k30KSiVtN5QzJhN8HD tQ/LWTQ+CgCuQp9sLrvOZ1S6VF/5ZFagiEi+nl3Uvp2Et28ISr/vUYxhxtT39QZbd4FQ +0O9ZGmBB4518G4omYcXkPwCf+p8o/P/tg0omT7dnZDhEoV2FQvCSdluM42+x5+2JaeF nmZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hEgCoycp; 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 gs38-20020a1709072d2600b00773dd14c80asi17360904ejc.860.2022.11.02.10.20.25; Wed, 02 Nov 2022 10:20:52 -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=hEgCoycp; 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 S230473AbiKBRND (ORCPT + 98 others); Wed, 2 Nov 2022 13:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbiKBRM6 (ORCPT ); Wed, 2 Nov 2022 13:12:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D722019F for ; Wed, 2 Nov 2022 10:12:36 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8B8CC61A95 for ; Wed, 2 Nov 2022 17:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 862F8C433C1; Wed, 2 Nov 2022 17:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667409156; bh=+kXg0AnyKL/yScM5ZpSouZN8e2TVAvvNgXX6EJiKW7E=; h=From:To:Cc:Subject:Date:From; b=hEgCoycpB6J1T5HC+Re6SnkeRnP0QfYP5e7wbcT445y0reEll/Ej5UdZqRVSgVeo3 WI/VAofvqGsFYIkEJLxUdf6M/ru616OjmF1WxnsgseWwz5+3oGTiw0kAZSHTuKNE1U 9oTPfVjciyp4R+LzZMBytiaU/0YUq3ThTkstBKvQRfjLZd1F3YfQ5AwfeytFUcafRS u3fV9MW17Fq0JxKAgPfkFOVC1kG8nz7FNSO9WYLozhIawafKn2VtljzKP4iWvo8s23 aoI2M8rh4f80884o6pEVI63dgdBBqEDvawTlbu5+OtYs2efuj1TX9BuxjwmDUaeZHb P4NpjrMfbBY6Q== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kernel test robot Subject: [PATCH v2] riscv: vdso: fix section overlapping under some conditions Date: Thu, 3 Nov 2022 01:02:54 +0800 Message-Id: <20221102170254.1925-1-jszhang@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 lkp reported a build error, I tried the config and can reproduce build error as below: VDSOLD arch/riscv/kernel/vdso/vdso.so.dbg ld.lld: error: section .note file range overlaps with .text >>> .note range is [0x7C8, 0x803] >>> .text range is [0x800, 0x1993] ld.lld: error: section .text file range overlaps with .dynamic >>> .text range is [0x800, 0x1993] >>> .dynamic range is [0x808, 0x937] ld.lld: error: section .note virtual address range overlaps with .text >>> .note range is [0x7C8, 0x803] >>> .text range is [0x800, 0x1993] Fix it by setting DISABLE_BRANCH_PROFILING which will disable branch tracing for vdso, thus avoid useless _ftrace_annotated_branch section and _ftrace_branch section. Although we can also fix it by removing the hardcoded .text begin address, but I think that's another story and should be put into another patch. Link: https://lore.kernel.org/lkml/202210122123.Cc4FPShJ-lkp@intel.com/#r Reported-by: kernel test robot Signed-off-by: Jisheng Zhang --- Since v1: - fix the issue by setting DISABLE_BRANCH_PROFILING arch/riscv/kernel/vdso/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile index f2e065671e4d..d6092ff678fd 100644 --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -17,6 +17,7 @@ vdso-syms += flush_icache obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o ccflags-y := -fno-stack-protector +ccflags-y += -DDISABLE_BRANCH_PROFILING ifneq ($(c-gettimeofday-y),) CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y) -- 2.37.2