mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Egg12138 <egg12138@foxmail.com>
Cc: Russell King <linux@armlinux.org.uk>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: module.lds: fix unwind metadata for merged .text sections
Date: Thu, 28 May 2026 14:44:04 +0200	[thread overview]
Message-ID: <a1bd5c1f-bf45-4eb1-a790-936fa13bc8b8@suse.com> (raw)
In-Reply-To: <tencent_69DC6E2A5B77E4D567CA4F552DD3A835590A@qq.com>

On 5/21/26 5:57 PM, Egg12138 wrote:
> Commit 1ba9f8979426 ("vmlinux.lds: Unify TEXT_MAIN, DATA_MAIN,
> and related macros") made scripts/module.lds.S merge module input
> .text.* sections into the output .text section.
> 
> On ARM, the paired unwind input sections keep their original names.  A
> module can therefore contain .ARM.exidx.text.unlikely with sh_link
> pointing at .text, while .text.unlikely no longer exists.
> 
> This is a valid ELF relationship, but ARM module_finalize() does not use
> sh_link when registering module unwind tables.  It derives the target
> text section from the exidx section name instead:
> 
>   .ARM.exidx.text.unlikely -> .text.unlikely
> 
> The lookup fails and the unwind table is not registered for the actual
> .text range.  This can make module stack unwinding fail with:
> 
>   unwind: Index not found
> 
> Keep the ARM module unwind output names in sync with the text sections
> that scripts/module.lds.S now produces.  Coalesce the .ARM.exidx/.ARM.extab
> sections associated with .text.*, into the
> stable output names expected by the existing ARM module unwind code.
> 
> Fixes: 1ba9f8979426 ("vmlinux.lds: Unify TEXT_MAIN, DATA_MAIN, and related macros")
> Signed-off-by: Egg12138 <egg12138@foxmail.com>

A Signed-off-by tag should use a known identity, see
Documentation/process/submitting-patches.rst, Developer's Certificate of
Origin 1.1 [1].

> ---
>  arch/arm/include/asm/module.lds.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/include/asm/module.lds.h b/arch/arm/include/asm/module.lds.h
> index 0e7cb4e314b4..dc9adf8fa50e 100644
> --- a/arch/arm/include/asm/module.lds.h
> +++ b/arch/arm/include/asm/module.lds.h
> @@ -1,4 +1,12 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef CONFIG_ARCH_WANTS_MODULES_TEXT_SECTIONS

The Arm architecture support doesn't select
CONFIG_ARCH_WANTS_MODULES_TEXT_SECTIONS, so this #ifndef is not really
necessary. I suggest leaving these linker definitions unconditional, or
alternatively use '#ifdef CONFIG_ARM_UNWIND'.

> +SECTIONS {
> +	.ARM.extab		0 : { *(.ARM.extab .ARM.extab.text .ARM.extab.text.[0-9a-zA-Z_]*) }
> +	.ARM.exidx		0 : { *(.ARM.exidx .ARM.exidx.text .ARM.exidx.text.[0-9a-zA-Z_]*) }
> +}
> +#endif
> +
>  #ifdef CONFIG_ARM_MODULE_PLTS
>  SECTIONS {
>  	.plt : { BYTE(0) }

Besides the above nits, the patch looks ok to me. Please don't forget to
put it in Russell's patch tracker [2].

[1] https://github.com/torvalds/linux/blob/v7.1-rc5/Documentation/process/submitting-patches.rst#developers-certificate-of-origin-11
[2] https://www.arm.linux.org.uk/developer/patches/

-- 
Thanks,
Petr

  reply	other threads:[~2026-05-28 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 15:57 Egg12138
2026-05-28 12:44 ` Petr Pavlu [this message]
2026-05-29 16:46 ` [PATCH v2] " Egg12138

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=a1bd5c1f-bf45-4eb1-a790-936fa13bc8b8@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=egg12138@foxmail.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=pmladek@suse.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

all inboxes | Powered by JetHome®