From mboxrd@z Thu Jan 1 00:00:00 1970 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 7168E199FBA for ; Wed, 4 Mar 2026 16:06:22 +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=1772640383; cv=none; b=QsPwiZgwde0HplokxWFQtLpbbQEmow1nZ892kduaft425NEWgCikPMK3mSs4Afh/J9PzJDfCvP2ujuEATrhCSdsemZdlp/3VYqev1haslcRjhiSnbHgHdVT9OCfSF0MAD5KQHA8OeN6AxcQxNAcbMuIeTX1dlJ2l8UpJoBFL/lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772640383; c=relaxed/simple; bh=ScAej3X816b1xqy7EmTt/a3vXOs0JllbxOWpxbyi8c0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-type; b=I6nU2fGrji7WB+AuhpSpE5LESVdnPa4PtZz+f5b4WDiFu6PchPjJ9MqBxuph5TY1gJUoFSf3OgCbvSYApmyKJ9ehs8kZHiQPnbtcOtpgYL9EXoLAhIla2F3VmsUrikhKGnu5B58+mx4wZuSrIxryLsZM4w3px4YxFHTijaARSQw= 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=ajckvXDP; 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="ajckvXDP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772640381; 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=ajckvXDPntIMYEejZRIY5kOYx8lIzetIRKJ71i1sjHVnB2tIK5rmKtVCiGuN6NSNRj4X77 Uw/2oW+3PpvSCMP6kfvTx+GxJKIihWHckHexD6el+kAAAfrg6iEhLzHlTvwOvPorJWHiMF 7T2a7MUVEg/fi79NeQABxdajYukbUTo= 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-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=0 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=33958 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)) } - __patchable_function_entries : { *(__patchable_function_entries) } + __patchable_function_entries 0 : { *(__patchable_function_entries) } .init.klp_funcs 0 : ALIGN(8) { KEEP(*(.init.klp_funcs)) } .init.klp_objects 0 : ALIGN(8) { KEEP(*(.init.klp_objects)) } #ifdef CONFIG_ARCH_USES_CFI_TRAPS - __kcfi_traps : { KEEP(*(.kcfi_traps)) } + __kcfi_traps 0 : { KEEP(*(.kcfi_traps)) } #endif - .text : { + .text 0 : { *(.text .text.[0-9a-zA-Z_]*) } - .bss : { + .bss 0 : { *(.bss .bss.[0-9a-zA-Z_]*) *(.bss..L*) } - .data : { + .data 0 : { *(.data .data.[0-9a-zA-Z_]*) *(.data..L*) } - .rodata : { + .rodata 0 : { *(.rodata .rodata.[0-9a-zA-Z_]*) *(.rodata..L*) } -- 2.53.0