From nobody Thu Apr 2 18:47:36 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17570332ED3 for ; Fri, 27 Mar 2026 08:01:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774598465; cv=none; b=lsiNPksAJrW15UBGRCF9860gFhn9HuYr/yshthEno5QDXUA2Vsgm+GTOITvtFidNS3iDwsWbcsxPeLfk+YdvrRWfjmtkMABrqVvVGBOwIclQudUDRZD63Pa74N5auBBeQfODzW6k7H6cNcLK3fn5KIO4re9QBDOz+/1CnD2gWH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774598465; c=relaxed/simple; bh=b4EA7Cjd+Rmu3jUMpgHSoP8C+KLtgyFkpMfPCKIjeuM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RTLJqQhlMuvJYCEXCvjdceCWeFNgR3tPl5O6S5SCxYRNP0MI90jqcZd2AaOZUTUCw04Qwj8wfIk3+SJ6BmseG/ihmRWpRiSf9X1oC6gTiuzfzdH7QrovjGkKj8rCGS/ZfeOMcQajoQ0hz2QmMsJ+H7uqiJ1pnuEqfFh5s1SVuXI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ewH5Dvse; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ewH5Dvse" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4853e1ce427so21191175e9.3 for ; Fri, 27 Mar 2026 01:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774598459; x=1775203259; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QlVyZgwbk35jZ7E4LjSb7Hh9QtkNRjrn39+Y58oA5YM=; b=ewH5DvseIaoVSCMuGNSBL70uEaf+vTd9BfwRKhpU78uNzlqgMgq7ptq3qBBAykXwYS ehEuD1jyyTWevMn6c+idZk3Ky+Lni+gSeGzLu7st436n/Bjoy1QcPWRROinVHq0+GnWJ ZrKaXQIUcntWpu5UONhhyqNGNKFsNmB3TYdGLi7PqoVaANJ68Wdt2hfWgdhKgsEBNiYZ NrnpcQGTyW4qZ03xzZNIurigH8fbRP2Ir7NZwHyh8azGdyuft++Dt1L9qVnS3D6i0DrY X4hFW9+yhwMy3z+GdpTSc0ihXB/cSRQT/tsrdAxzUbRFkwdFuZZT4LRwiqj1qHZ06vUQ t0oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774598459; x=1775203259; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QlVyZgwbk35jZ7E4LjSb7Hh9QtkNRjrn39+Y58oA5YM=; b=AhdozBMAlIjQSxfThnqQmpO+cW+sVnBXaYNwNZO95VfvgmTN3onTs5N+Ol1e9OqGCi Bf2E+pKf4CYwCwWDGriskJ8oOqzqpBz4LDP8aShpIMSiVQxdw/GGDj+OPuMq/XRLQsGM jMJYTOThxt0zjWZyE+kzw6ZFws8cK4G0/vk6z92lJfhV3yug8l2Ey0HLYlD1CPapMu6W yC7ZxJMOaiTm3NLm6D1fIkwiHXsXMQ/LBFUHuAlIebHQMou/TxDP0lFuWx8WW9tVwgEG dMRwvBTvTEz4Hy1042/57nmJWjLuwkbJ2UivLCEu7OebiSVGgy1kVRxbKIeMFeLqmuT8 s30Q== X-Forwarded-Encrypted: i=1; AJvYcCVfDMqew+HhBay4teVk+qS1JSQaDo6CcMi8QiPd6PtS+glQJnwCsRfPeU5l+rhf8lqJ2229s7LcCVKm3lg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6mUrAPVWPNYuaq3hDXPpsUoWWMhodpsL/UxJNli8kmKaMN/AT MvNQDWrXDRO2dzh69bNNAn6OFprEl5AG9cQ2WkuvvBBktbIpzgmVh/G+rhiDxcag3r4= X-Gm-Gg: ATEYQzwfr9Nvs/3Z+r36EvMAwQzfEzQBS/oo0lW0c/IC+OEVkrtBl+ynlxXHJJH5xne UmeV/h/if+2qisqvX1+aKarv7YO+mfXW9J6SzXygxbKj0v8KhnfPat1aUHY5W0AMojtGoeJoobm wFkrTkIrG74n4hFh7g4G7Ur0BtqexsRNBGYj5gtW/Qnt/+EVCXisxtp+CiHiO2fStxp9qsYsQwJ NbyRA1rpHirTnVZho41F7BW669A74Ina7fzLRZtmGR4mOZLX95iU+AfExEhHgk6ZvYuBCUuDVRF XYeiFlp/k5C7Hj2Lv/AWfHs63KWTjQ5/FbJgM/Xjqw4pUtfl1PODOHg78VZ1Ioo+9ja8X9FrRPF rxERO1GAWeE+8zMuUf7OhM1VbTDzHxZxhjlTmJPnhMjeyfs5+kNs0xii3NgSd6hq5jhdnURzRwK 3TR8Yd7sqK4ALsqvwNDqxYv+m+wtb0ea5NzgLpJz6v X-Received: by 2002:a05:600c:5304:b0:485:f1d1:8f3d with SMTP id 5b1f17b1804b1-48727d67a43mr23844745e9.6.1774598458837; Fri, 27 Mar 2026 01:00:58 -0700 (PDT) Received: from zovi.suse.cz (nat2.prg.suse.com. [195.250.132.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48725fc4827sm12089735e9.11.2026.03.27.01.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 01:00:58 -0700 (PDT) From: Petr Pavlu To: Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sami Tolvanen Cc: Alexandre Ghiti , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Aaron Tomlin , Joe Lawrence , linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-riscv@lists.infradead.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] module, riscv: force sh_addr=0 for arch-specific sections Date: Fri, 27 Mar 2026 08:59:03 +0100 Message-ID: <20260327080023.861105-5-petr.pavlu@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327080023.861105-1-petr.pavlu@suse.com> References: <20260327080023.861105-1-petr.pavlu@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When linking modules with 'ld.bfd -r', sections defined without an address inherit the location counter, resulting in non-zero sh_addr values in the resulting .ko files. Relocatable objects are expected to have sh_addr=3D0 f= or all sections. Non-zero addresses are confusing in this context, typically worse compressible, and may cause tools to misbehave [1]. Force sh_addr=3D0 for all riscv-specific module sections. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=3D33958 [1] Signed-off-by: Petr Pavlu --- arch/riscv/include/asm/module.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/include/asm/module.lds.h b/arch/riscv/include/asm/m= odule.lds.h index 1075beae1ac6..9ced27c8ccb6 100644 --- a/arch/riscv/include/asm/module.lds.h +++ b/arch/riscv/include/asm/module.lds.h @@ -2,8 +2,8 @@ /* Copyright (C) 2017 Andes Technology Corporation */ #ifdef CONFIG_MODULE_SECTIONS SECTIONS { - .plt : { BYTE(0) } - .got : { BYTE(0) } - .got.plt : { BYTE(0) } + .plt 0 : { BYTE(0) } + .got 0 : { BYTE(0) } + .got.plt 0 : { BYTE(0) } } #endif --=20 2.53.0