Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jia Wang via B4 Relay <devnull+wangjia.ultrarisc.com@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,  Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-riscv@lists.infradead.org,
	Jia Wang <wangjia@ultrarisc.com>
Subject: [PATCH 0/2] modpost: fix RISC-V randconfig section mismatch false positives
Date: Thu, 16 Jul 2026 13:31:48 +0800	[thread overview]
Message-ID: <20260716-modpost-v1-0-8eab36cc7310@ultrarisc.com> (raw)

This series fixes two modpost false-positive section mismatch cases seen
with RISC-V randconfig builds.

The first patch filters compiler-generated GCOV symbols and RISC-V local
branch/PC-relative relocations when they point at init or exit sections.
These references can come from instrumentation or local compiler/linker
details rather than from real kernel section lifetime dependencies.

The second patch handles RISC-V relative exception table entries as
R_RISCV_ADD32/R_RISCV_SUB32 relocation pairs. modpost already skipped the
SUB32 half, but still checked the ADD32 symbol directly. After a
relocatable link, that symbol can name an unrelated local debug symbol and
trigger false .debug* section mismatch diagnostics from these __ex_table
relocation pairs.

The issues are reproducible with both GCC 14 and GCC 15. They were
reproduced or validated with:

  - rv32 randconfig, KCONFIG_SEED=277518,
    CONFIG_GCOV_PROFILE_ALL=y, CONFIG_KCOV_INSTRUMENT_ALL=y,
    CONFIG_DEBUG_INFO_BTF=y

  - rv32 randconfig, KCONFIG_SEED=4721,
    CONFIG_MMU=y, CONFIG_DEBUG_INFO=y

With the fixes applied, the corresponding RISC-V randconfig builds complete
successfully. Other unrelated modpost warnings may still remain.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
Jia Wang (2):
      modpost: ignore generated GCOV and RISC-V local relocs
      modpost: handle RISC-V relative extable relocations

 scripts/mod/modpost.c | 157 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 150 insertions(+), 7 deletions(-)
---
base-commit: 58717b2a1365d06c8c64b72aa948541b53fe31eb
change-id: 20260716-modpost-30d5d28d9d64

Best regards,
--  
Jia Wang <wangjia@ultrarisc.com>



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2026-07-16  5:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  5:31 Jia Wang via B4 Relay [this message]
2026-07-16  5:31 ` [PATCH 1/2] modpost: ignore generated GCOV and RISC-V local relocs Jia Wang via B4 Relay
2026-07-16  5:31 ` [PATCH 2/2] modpost: handle RISC-V relative extable relocations Jia Wang via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260716-modpost-v1-0-8eab36cc7310@ultrarisc.com \
    --to=devnull+wangjia.ultrarisc.com@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=wangjia@ultrarisc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox