public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Fangrui Song <maskray@google.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Nathan Chancellor <nathan@kernel.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 00:50:16 -0800	[thread overview]
Message-ID: <20220218085016.jv4qcfaxav5fxhrs@google.com> (raw)
In-Reply-To: <CAMj1kXGZuOWOPEHv0YSM4GseG2PnTgS8mSLXQ+imo-TN7MmvaQ@mail.gmail.com>

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>

>> ---
>>  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

  reply	other threads:[~2022-02-18  8:51 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 [this message]
2022-02-18 16:34     ` Nathan Chancellor
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=20220218085016.jv4qcfaxav5fxhrs@google.com \
    --to=maskray@google.com \
    --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=nathan@kernel.org \
    --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