Linux Modules
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Egg12138 <egg12138@foxmail.com>
Cc: linux-modules@vger.kernel.org
Subject: Re: [PATCH v2] ARM: module.lds: fix unwind metadata for merged .text sections
Date: Fri, 29 May 2026 17:12:43 +0000	[thread overview]
Message-ID: <20260529171244.101861F00893@smtp.kernel.org> (raw)
In-Reply-To: <tencent_D9CDCA221D0AF5EDF260559734464D39B708@qq.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The linker script fix is wrapped in an inverted configuration conditional (`#ifndef CONFIG_ARM_UNWIND`), applying the fix only when unwinding is disabled.
- [High] The wildcard patterns are enclosed in double quotes, which disables wildcard matching in GNU ld.
- [Low] Non-standard linker script syntax with a space between the wildcard asterisk and the section name list.
--

commit 165574ad9cf92e77eac788d811caa72c990e0b3d
Author: Xiao Junzhe <egg12138@foxmail.com>
Subject: ARM: module.lds: fix unwind metadata for merged .text sections

This commit attempts to fix a module stack unwinding failure on ARM by
coalescing .ARM.exidx and .ARM.extab input sections that belong to merged
.text.* sections. This is intended to keep the output names in sync with
what the ARM module unwind code expects.

> diff --git a/arch/arm/include/asm/module.lds.h b/arch/arm/include/asm/module.lds.h
> --- a/arch/arm/include/asm/module.lds.h
> +++ b/arch/arm/include/asm/module.lds.h
> @@ -1,4 +1,20 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef CONFIG_ARM_UNWIND

[Severity: High]
Does this exclude the fix in the exact configuration it is intended for?

The patch aims to fix module stack unwinding, which is controlled by
CONFIG_ARM_UNWIND. Because this block is wrapped in an #ifndef, the section
coalescing will be skipped when unwinding is enabled, leaving the unwind
tables unmerged and the issue unresolved.

> +SECTIONS {
> +	.ARM.extab		0 : {
> +		*(.ARM.extab)
> +		* (".ARM.extab.text")
> +		* (".ARM.extab.text.[0-9a-zA-Z_]*")

[Severity: Low]
This isn't a bug, but there is a space between the asterisk wildcard and
the section name list. While GNU ld ignores this whitespace, standard kernel
linker script conventions typically omit it.

[Severity: High]
Will GNU ld expand the wildcard patterns when they are enclosed in double
quotes?

Enclosing a section name in double quotes causes wildcard characters like
the asterisk and brackets to lose their special meaning and be treated as
literal characters. The linker will try to match a section literally named
".ARM.extab.text.[0-9a-zA-Z_]*" instead of expanding the glob to match
sections like ".ARM.extab.text.unlikely".

> +	}
> +	.ARM.exidx		0 : {
> +		*(.ARM.exidx)
> +		* (".ARM.exidx.text")
> +		* (".ARM.exidx.text.[0-9a-zA-Z_]*")
> +	}
> +}
> +#endif

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_D9CDCA221D0AF5EDF260559734464D39B708@qq.com?part=1

      reply	other threads:[~2026-05-29 17:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 15:57 [PATCH] ARM: module.lds: fix unwind metadata for merged .text sections Egg12138
2026-05-28 12:44 ` Petr Pavlu
2026-05-29 16:46 ` [PATCH v2] " Egg12138
2026-05-29 17:12   ` sashiko-bot [this message]

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=20260529171244.101861F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=egg12138@foxmail.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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