mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
Contemporary kernels and modules can be relatively large, especially when common debug options are enabled. Using GCC 12.1.0, a v6.3-rc7 defconfig kernel is ~38M, and with PROVE_LOCKING + KASAN_INLINE enabled this expands to ~117M. Shanker reports [1] that the NVIDIA GPU driver alone can consume 110M of module space in some configurations. Both KASLR and ARM64_ERRATUM_843419 select MODULE_PLTS, so anyone wanting a kernel to have KASLR or run on Cortex-A53 will have MODULE_PLTS selected. This is the case in defconfig and distribution kernels (e.g. Debian, Android, etc). Practically speaking, this means we're very likely to need MODULE_PLTS and while it's almost guaranteed that MODULE_PLTS will be selected, it is possible to disable support, and we have to maintain some awkward special cases for such unusual configurations. This patch removes the MODULE_PLTS config option, with the support code always enabled if MODULES is selected. This results in a slight simplification, and will allow for further improvement in subsequent patches. For any config which currently selects MODULE_PLTS, there will be no functional change as a result of this patch. [1] https://lore.kernel.org/linux-arm-kernel/[email protected]/ Signed-off-by: Mark Rutland <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Cc: Shanker Donthineni <[email protected]> Cc: Will Deacon <[email protected]> Tested-by: Shanker Donthineni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
27 lines
795 B
C
27 lines
795 B
C
SECTIONS {
|
|
.plt 0 : { BYTE(0) }
|
|
.init.plt 0 : { BYTE(0) }
|
|
.text.ftrace_trampoline 0 : { BYTE(0) }
|
|
|
|
#ifdef CONFIG_KASAN_SW_TAGS
|
|
/*
|
|
* Outlined checks go into comdat-deduplicated sections named .text.hot.
|
|
* Because they are in comdats they are not combined by the linker and
|
|
* we otherwise end up with multiple sections with the same .text.hot
|
|
* name in the .ko file. The kernel module loader warns if it sees
|
|
* multiple sections with the same name so we use this sections
|
|
* directive to force them into a single section and silence the
|
|
* warning.
|
|
*/
|
|
.text.hot : { *(.text.hot) }
|
|
#endif
|
|
|
|
#ifdef CONFIG_UNWIND_TABLES
|
|
/*
|
|
* Currently, we only use unwind info at module load time, so we can
|
|
* put it into the .init allocation.
|
|
*/
|
|
.init.eh_frame : { *(.eh_frame) }
|
|
#endif
|
|
}
|