Patch "arm64: module: remove (NOLOAD) from linker script" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    arm64: module: remove (NOLOAD) from linker script

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-module-remove-noload-from-linker-script.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 93722a30c73ad1a1484f7371180417e6b973cb6e
Author: Fangrui Song <maskray@xxxxxxxxxx>
Date:   Fri Feb 18 00:12:09 2022 -0800

    arm64: module: remove (NOLOAD) from linker script
    
    [ Upstream commit 4013e26670c590944abdab56c4fa797527b74325 ]
    
    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.
    
    Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Reported-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Signed-off-by: Fangrui Song <maskray@xxxxxxxxxx>
    Acked-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220218081209.354383-1-maskray@xxxxxxxxxx
    Signed-off-by: Will Deacon <will@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux