From: Nathan Chancellor <nathan@kernel.org>
To: Fangrui Song <maskray@google.com>
Cc: Ard Biesheuvel <ardb@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
llvm@lists.linux.dev
Subject: Re: [PATCH] arm64 module: remove (NOLOAD)
Date: Fri, 18 Feb 2022 09:34:22 -0700 [thread overview]
Message-ID: <Yg/KjpHOZ7HwZq9f@dev-arch.archlinux-ax161> (raw)
In-Reply-To: <20220218085016.jv4qcfaxav5fxhrs@google.com>
On Fri, Feb 18, 2022 at 12:50:16AM -0800, Fangrui Song wrote:
> On 2022-02-18, Ard Biesheuvel wrote:
> > On Fri, 18 Feb 2022 at 09:12, Fangrui Song <maskray@google.com> wrote:
> > >
> > > On ELF, (NOLOAD) sets the section type to SHT_NOBITS[1]. It is conceptually
> > > inappropriate for .plt and .text.* sections which are always
> > > SHT_PROGBITS.
> > >
> > > In GNU ld, if PLT entries are needed, .plt will be SHT_PROGBITS anyway
> > > and (NOLOAD) will be essentially ignored. In ld.lld, since
> > > https://reviews.llvm.org/D118840 ("[ELF] Support (TYPE=<value>) to
> > > customize the output section type"), ld.lld will report a `section type
> > > mismatch` error. Just remove (NOLOAD) to fix the error.
> > >
> > > [1] https://lld.llvm.org/ELF/linker_script.html As of today, "The
> > > section should be marked as not loadable" on
> > > https://sourceware.org/binutils/docs/ld/Output-Section-Type.html is
> > > outdated for ELF.
> >
> > This patch lacks a SOB line.
> >
> > With one added,
> >
> > Acked-by: Ard Biesheuvel <ardb@kernel.org>
>
> Ah, yes. Sorry, I haven't sent a kernel patch for a while...
>
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Fangrui Song <maskray@google.com>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
I am assuming this patch is the solution we want, as opposed to Ard's
suggestion of renaming these sections at
https://reviews.llvm.org/D118840 (unless that was a tangential
suggestion).
I have verified that modules still load. Additionally, this needs to go
to stable so that groups who upgrade their toolchain to a revision that
include the LLD patch don't get broken as well.
Cc: stable@vger.kernel.org
Tested-by: Nathan Chancellor <nathan@kernel.org>
> > > ---
> > > arch/arm64/include/asm/module.lds.h | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h
> > > index a11ccadd47d2..094701ec5500 100644
> > > --- a/arch/arm64/include/asm/module.lds.h
> > > +++ b/arch/arm64/include/asm/module.lds.h
> > > @@ -1,8 +1,8 @@
> > > SECTIONS {
> > > #ifdef CONFIG_ARM64_MODULE_PLTS
> > > - .plt 0 (NOLOAD) : { BYTE(0) }
> > > - .init.plt 0 (NOLOAD) : { BYTE(0) }
> > > - .text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) }
> > > + .plt 0 : { BYTE(0) }
> > > + .init.plt 0 : { BYTE(0) }
> > > + .text.ftrace_trampoline 0 : { BYTE(0) }
> > > #endif
> > >
> > > #ifdef CONFIG_KASAN_SW_TAGS
> > > --
> > > 2.35.1.265.g69c8d7142f-goog
> > >
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-02-18 16:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 8:12 [PATCH] arm64 module: remove (NOLOAD) Fangrui Song
2022-02-18 8:17 ` Ard Biesheuvel
2022-02-18 8:50 ` Fangrui Song
2022-02-18 16:34 ` Nathan Chancellor [this message]
2022-02-18 19:08 ` Ard Biesheuvel
2022-02-25 15:50 ` Will Deacon
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=Yg/KjpHOZ7HwZq9f@dev-arch.archlinux-ax161 \
--to=nathan@kernel.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=maskray@google.com \
--cc=will@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