Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1126147rwi; Mon, 31 Oct 2022 11:41:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75SYEcnl5gzgu7vr1/Uazgpu6ZT/+FAwByi5wkF7LTIFw5c+ZRRDRF1SxDYG6LyRAubrVr X-Received: by 2002:a63:8943:0:b0:46f:3a91:3618 with SMTP id v64-20020a638943000000b0046f3a913618mr14044970pgd.16.1667241685009; Mon, 31 Oct 2022 11:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667241685; cv=none; d=google.com; s=arc-20160816; b=MYHP1lL+aNPXkA0Km07v+RBxORLlAgs8iy9eskgbDbtcYjazuL6Mqsv+z+G8i9rfWI Mdn/KzVlcB1wc0U6OMQNopj2cNQUeqpXRQxhTd0d/TydeCmeotj+oqdKgnbZLER3hcsa 5dq5lydsJ5mS5zjYXDe9aDcECtYV7cD+ieP/1bFiOg7WclKbg2kkm71xGniKH74gg5hL +xhRvpMoNGibSOoTGvivFYLRoZQ1q/utt8qtwM3rehPR160Qhy5tIK39w/ZKEQ9U0nST +sVmmyQXE+NiACGGsGr1DE+rVqikUaW2N+pUP6Ca/R0w18A9cLKnm+JD+gm2ynQjGrvD hGXg== 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=hZPchcnxk8AImi55OTVRC2I3SWU8gfJF/NR6qDTxehM=; b=YKfxfiz7Od2+KqEMRoNksWoKO807hKVyldTd7nQo1i7h/l3g08VyxECJsJ7Cg16EUh jtsWrBGWYaIb5g2ajT8f4BLmAFTtfOp/80VSS0Fjss8w8ajcZuOg0c8GNe/vdFfLj01j 81wgOuo0SXz8dGUVrrVl/bb7WqY8ITWZABQ0DS3+t48xPOg1x+HYo8xyMsvCJxaQfNVQ DX4K60c0yw384/IdnNGkjud84UpfAQ3XHucC7RSDYL2ll97Yn5SY9gfuidMVPtu4IpNv 9fITlUbyCSn0mPCvF61oVhlLxFwl4SDKME3AlmwY/A/VGVN/bPThU/OfBOkJi5U891tF rSWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fd+EMPKl; 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 a16-20020a62bd10000000b0054568a55597si8823225pff.96.2022.10.31.11.41.11; Mon, 31 Oct 2022 11:41:24 -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=fd+EMPKl; 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 S229824AbiJaSId (ORCPT + 99 others); Mon, 31 Oct 2022 14:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiJaSIa (ORCPT ); Mon, 31 Oct 2022 14:08:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF05636C for ; Mon, 31 Oct 2022 11:08:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4A1E6B819DB for ; Mon, 31 Oct 2022 18:08:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 512F0C433D6; Mon, 31 Oct 2022 18:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667239703; bh=61NkTIRtTQDjIwj34HexqV/1v6+kaRU2hwR4uoY6668=; h=From:To:Cc:Subject:Date:From; b=fd+EMPKlIf4RbN8/XgdKYejclCTsYhbFwapr17e367PPTRZu7Zl0/vYawiVi/ZiqI k11GcD3hURPp7Nf2llY3Chx1Vfu/fUsbTA2zM2v1Q3f7ejZBx4RNWQXiYvN0AqH44Q cu2/Q1vOQdh7ABsRGp4w4MX5xvLPV7V905wxqN48ampidHhRv7HP4a2sKeQ3CgyLwU cUPnqgQldXl8hyE6m9kLy/8m7ynMFDS9B8E6LS//sHrMWe/M+EnrV7ttMQ4W/R1kD1 LB0ePi+geOgbcUq6jNTQ3FDggCeXkXLpQ//4cyBFVGogjOfWBp7YDPwZlruarao2kt 4KjjU1d8S3nqA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Conor Dooley , kernel test robot Subject: [PATCH] riscv: vdso: fix section overlapping under some conditions Date: Tue, 1 Nov 2022 01:58:42 +0800 Message-Id: <20221031175842.1699-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 removing the hardcoding 0x800 and related comments. Link: https://lore.kernel.org/lkml/202210122123.Cc4FPShJ-lkp@intel.com/#r Reported-by: kernel test robot Signed-off-by: Jisheng Zhang --- arch/riscv/kernel/vdso/vdso.lds.S | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S index 01d94aae5bf5..344209d2e128 100644 --- a/arch/riscv/kernel/vdso/vdso.lds.S +++ b/arch/riscv/kernel/vdso/vdso.lds.S @@ -31,13 +31,7 @@ SECTIONS .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - /* - * This linker script is used both with -r and with -shared. - * For the layouts to match, we need to skip more than enough - * space for the dynamic symbol table, etc. If this amount is - * insufficient, ld -shared will error; simply increase it here. - */ - . = 0x800; + . = ALIGN(16); .text : { *(.text .text.*) } :text .data : { -- 2.37.2