mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
596b0474d3
There was a request to preprocess the module linker script like we do for the vmlinux one. (https://lkml.org/lkml/2020/8/21/512) The difference between vmlinux.lds and module.lds is that the latter is needed for external module builds, thus must be cleaned up by 'make mrproper' instead of 'make clean'. Also, it must be created by 'make modules_prepare'. You cannot put it in arch/$(SRCARCH)/kernel/, which is cleaned up by 'make clean'. I moved arch/$(SRCARCH)/kernel/module.lds to arch/$(SRCARCH)/include/asm/module.lds.h, which is included from scripts/module.lds.S. scripts/module.lds is fine because 'make clean' keeps all the build artifacts under scripts/. You can add arch-specific sections in <asm/module.lds.h>. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Jessica Yu <jeyu@kernel.org> Acked-by: Will Deacon <will@kernel.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Jessica Yu <jeyu@kernel.org>
30 lines
968 B
ArmAsm
30 lines
968 B
ArmAsm
/*
|
|
* Common module linker script, always used when linking a module.
|
|
* Archs are free to supply their own linker scripts. ld will
|
|
* combine them automatically.
|
|
*/
|
|
SECTIONS {
|
|
/DISCARD/ : {
|
|
*(.discard)
|
|
*(.discard.*)
|
|
}
|
|
|
|
__ksymtab 0 : { *(SORT(___ksymtab+*)) }
|
|
__ksymtab_gpl 0 : { *(SORT(___ksymtab_gpl+*)) }
|
|
__ksymtab_unused 0 : { *(SORT(___ksymtab_unused+*)) }
|
|
__ksymtab_unused_gpl 0 : { *(SORT(___ksymtab_unused_gpl+*)) }
|
|
__ksymtab_gpl_future 0 : { *(SORT(___ksymtab_gpl_future+*)) }
|
|
__kcrctab 0 : { *(SORT(___kcrctab+*)) }
|
|
__kcrctab_gpl 0 : { *(SORT(___kcrctab_gpl+*)) }
|
|
__kcrctab_unused 0 : { *(SORT(___kcrctab_unused+*)) }
|
|
__kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) }
|
|
__kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) }
|
|
|
|
.init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
|
|
|
|
__jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
|
|
}
|
|
|
|
/* bring in arch-specific sections */
|
|
#include <asm/module.lds.h>
|