From patchwork Wed Nov 2 17:02:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 14404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp35092wru; Wed, 2 Nov 2022 10:19:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hTPniCZWCmCnfl8G0vpJ87jkBSEl8lLOraL9a2txiBLI5/mLXhXMBlfyR5X422S7otl9M X-Received: by 2002:aa7:dc10:0:b0:440:b446:c0cc with SMTP id b16-20020aa7dc10000000b00440b446c0ccmr25320249edu.34.1667409548554; Wed, 02 Nov 2022 10:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667409548; cv=none; d=google.com; s=arc-20160816; b=afzyS6moMnMTmJjH9ugGLz1aggi7E4sn7xOpx42v0UcCE9gkz9j/bWkf+QZpZfmp5X 7zvN3oTHR6V2iY4tnPQvdn7Pq+mUFi4DMNvlh7dXz6aLbQ2KL0dtCEFjMLMUrH9Irueg BvO/i6tpS0mnuxAfeR0e8GSIi+MZ9pBqLTCIVmBD64mWhBDbHOFezeOsiJ+9zb50Rjcb RFl149V9szG4Dom6jZxrqLb8xaGbZOB9liT/jf+u9JDDjhOmmmvLIJQg95NKtmk57C+b PQ1eMMvBT5oXcOQyMvnYPLe2vgTmKAsk1KqWdQA4/GmY+5dhBVAzjQCSqp8FrfngrEWR NumA== 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 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.18.42; Wed, 02 Nov 2022 10:19:08 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748405634880464876?= X-GMAIL-MSGID: =?utf-8?q?1748405634880464876?= 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)