From: Masahiro Yamada <masahiroy@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: richard@nod.at, anton.ivanov@cambridgegreys.com,
johannes@sipsolutions.net, nicolas@fjasle.eu,
ndesaulniers@google.com, morbo@google.com,
justinstitt@google.com, linux-um@lists.infradead.org,
linux-kbuild@vger.kernel.org, llvm@lists.linux.dev,
patches@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS
Date: Sun, 28 Jan 2024 00:49:25 +0900 [thread overview]
Message-ID: <CAK7LNASWAXwcHtzsW1vex6kuL7Jf+M2HiBhTGhHYfKnAoMqvPA@mail.gmail.com> (raw)
In-Reply-To: <20240123-fix-uml-clang-18-v1-2-efc095519cf9@kernel.org>
On Wed, Jan 24, 2024 at 8:00 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> After the linked LLVM change, building ARCH=um defconfig results in a
> segmentation fault in modpost.
Yeah, this is a mistake in my commits.
The NULL pointer access should be fixed, but that is a separate issue.
Anyway, I applied this patch.
> Prior to commit a23e7584ecf3 ("modpost:
> unify 'sym' and 'to' in default_mismatch_handler()"), there was a
> warning:
>
> WARNING: modpost: vmlinux.o(__ex_table+0x88): Section mismatch in reference to the .ltext:(unknown)
> WARNING: modpost: The relocation at __ex_table+0x88 references
> section ".ltext" which is not in the list of
> authorized sections. If you're adding a new section
> and/or if this reference is valid, add ".ltext" to the
> list of authorized sections to jump to on fault.
> This can be achieved by adding ".ltext" to
> OTHER_TEXT_SECTIONS in scripts/mod/modpost.c.
>
> The linked LLVM change moves global objects to the '.ltext' (and
> '.ltext.*' with '-ffunction-sections') sections with '-mcmodel=large',
> which ARCH=um uses. These sections should be handled just as '.text'
> and '.text.*' are, so add them to TEXT_SECTIONS.
>
> Cc: stable@vger.kernel.org
> Closes: https://github.com/ClangBuiltLinux/linux/issues/1981
> Link: https://github.com/llvm/llvm-project/commit/4bf8a688956a759b7b6b8d94f42d25c13c7af130
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> scripts/mod/modpost.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index cb6406f485a9..f7c4d3fe4381 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -807,7 +807,8 @@ static void check_section(const char *modname, struct elf_info *elf,
>
> #define DATA_SECTIONS ".data", ".data.rel"
> #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
> - ".kprobes.text", ".cpuidle.text", ".noinstr.text"
> + ".kprobes.text", ".cpuidle.text", ".noinstr.text", \
> + ".ltext", ".ltext.*"
> #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
> ".fixup", ".entry.text", ".exception.text", \
> ".coldtext", ".softirqentry.text"
>
> --
> 2.43.0
>
--
Best Regards
Masahiro Yamada
next prev parent reply other threads:[~2024-01-27 15:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 22:59 [PATCH 0/2] Fix UML build with clang-18 and newer Nathan Chancellor
2024-01-23 22:59 ` [PATCH 1/2] um: Fix adding '-no-pie' for clang Nathan Chancellor
2024-01-27 15:46 ` Masahiro Yamada
2024-01-23 22:59 ` [PATCH 2/2] modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS Nathan Chancellor
2024-01-27 15:49 ` Masahiro Yamada [this message]
2024-01-27 15:43 ` [PATCH 0/2] Fix UML build with clang-18 and newer Masahiro Yamada
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=CAK7LNASWAXwcHtzsW1vex6kuL7Jf+M2HiBhTGhHYfKnAoMqvPA@mail.gmail.com \
--to=masahiroy@kernel.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=johannes@sipsolutions.net \
--cc=justinstitt@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
--cc=patches@lists.linux.dev \
--cc=richard@nod.at \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).