From nobody Fri Apr 10 01:07:27 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43F1A335543 for ; Wed, 4 Mar 2026 16:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772640384; cv=none; b=d9wQzpsPPHEXIKxtmtFpEWy6rIB10FRsmJfcTBKAI3Awro4AA9TiuQthQFBViIk0IQgx4F/vLhTB2XeDVcs/ITHA5Ij7S/sZX2PhyyGXAaw71AUrkE6NCXbkQf1m18IKwEpHkaqlb75Jn7Sr6kdivD1O2+EBch3b5uUQ9kBFCFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772640384; c=relaxed/simple; bh=ScAej3X816b1xqy7EmTt/a3vXOs0JllbxOWpxbyi8c0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-type; b=Md6454SmVtETdx5NwOwqiAlJjtjTlBfc3pzy0XtpzLn/+9GKUQc5AiWaVGlIwKCwUfAwDb0Ls7/GPUYgpEcVoCCkI8UWQyJWN/e/D7k1hm0QAGv1U0e163eRqjStHmTKPCOKFilw+5K4yc3cES1gkd40SRXxR9KybQVb/m2zQ6c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EPck4rtF; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EPck4rtF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772640382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hxSpT0yifDXBnPJ/fGGcnzbJyaYNyHp2I1DkrsHdocY=; b=EPck4rtFk4qX4ZjDbnWQL592Bd9wdKFXb03HRexIUcflYphhMxXFQYUK360X9dRGqw5Ewo l3fRLE/ETUs91qBOQ9KZ2D1VX8J+iJr7ngiT8SVTxPa25TKCYnaoFIm2iRCNDt813fIIbX BYQ7BfuH2/q2rM0q00mMqQWR1Oh30hg= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-55-YcttVVH0P_mxfzOlhgBJcw-1; Wed, 04 Mar 2026 11:06:18 -0500 X-MC-Unique: YcttVVH0P_mxfzOlhgBJcw-1 X-Mimecast-MFC-AGG-ID: YcttVVH0P_mxfzOlhgBJcw_1772640376 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7631218002D7; Wed, 4 Mar 2026 16:06:16 +0000 (UTC) Received: from jolawren-thinkpadp1gen7.ibmlowe.csb (unknown [10.22.80.5]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 63BC519560B7; Wed, 4 Mar 2026 16:06:14 +0000 (UTC) From: Joe Lawrence To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Petr Mladek , Josh Poimboeuf Subject: [PATCH] module.lds: force 0 sh_addr for .text, .data, .bss, and .rodata sections Date: Wed, 4 Mar 2026 11:06:11 -0500 Message-ID: <20260304160611.143862-1-joe.lawrence@redhat.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 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" Commit 1ba9f8979426 ("vmlinux.lds: Unify TEXT_MAIN, DATA_MAIN, and related macros") added .text and made .data, .bss, and .rodata sections unconditional in the module linker script, but without an explicit address like the other sections in the same file. 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 .ko. Relocatable objects are expected to have sh_addr=3D0 for these sections and these non-zero addresses confuse elfutils and have been reported to cause segmentation faults in SystemTap [1]. Add the 0 address specifier to .text, .bss, .data, and .rodata, and also to __patchable_function_entries and __kcfi_traps which had the same issue. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=3D33958 Fixes: 1ba9f8979426 ("vmlinux.lds: Unify TEXT_MAIN, DATA_MAIN, and related = macros") Signed-off-by: Joe Lawrence --- scripts/module.lds.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/module.lds.S b/scripts/module.lds.S index 054ef99e8288..e1cab3cee3f7 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -32,30 +32,30 @@ SECTIONS { __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) } __ex_table 0 : ALIGN(4) { KEEP(*(__ex_table)) } =20 - __patchable_function_entries : { *(__patchable_function_entries) } + __patchable_function_entries 0 : { *(__patchable_function_entries) } =20 .init.klp_funcs 0 : ALIGN(8) { KEEP(*(.init.klp_funcs)) } .init.klp_objects 0 : ALIGN(8) { KEEP(*(.init.klp_objects)) } =20 #ifdef CONFIG_ARCH_USES_CFI_TRAPS - __kcfi_traps : { KEEP(*(.kcfi_traps)) } + __kcfi_traps 0 : { KEEP(*(.kcfi_traps)) } #endif =20 - .text : { + .text 0 : { *(.text .text.[0-9a-zA-Z_]*) } =20 - .bss : { + .bss 0 : { *(.bss .bss.[0-9a-zA-Z_]*) *(.bss..L*) } =20 - .data : { + .data 0 : { *(.data .data.[0-9a-zA-Z_]*) *(.data..L*) } =20 - .rodata : { + .rodata 0 : { *(.rodata .rodata.[0-9a-zA-Z_]*) *(.rodata..L*) } --=20 2.53.0