mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
rodata: optimize memory usage of rodata section [3/5]
PD#SWPL-31258
Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel
Solution:
1, remove CONFIG_KALLSYMS_ALL in module.c, which can help to save
about 200KB module memory during runtime compared from /proc/pagetrce:
3068, c020edd8, module_alloc -- before
2776, c020edd8, module_alloc -- after
Verify:
x301
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I15acee0df76f74a04c10d8f290d10fc35d51a283
This commit is contained in:
@@ -2570,15 +2570,21 @@ static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs,
|
||||
|| !src->st_name)
|
||||
return false;
|
||||
|
||||
#ifndef CONFIG_AMLOGIC_MODIFY
|
||||
#ifdef CONFIG_KALLSYMS_ALL
|
||||
if (src->st_shndx == pcpundx)
|
||||
return true;
|
||||
#endif
|
||||
#endif /* ignore all symbols of moulde been loaded */
|
||||
|
||||
sec = sechdrs + src->st_shndx;
|
||||
if (!(sec->sh_flags & SHF_ALLOC)
|
||||
#ifdef CONFIG_AMLOGIC_MODIFY
|
||||
|| !(sec->sh_flags & SHF_EXECINSTR)
|
||||
#else
|
||||
#ifndef CONFIG_KALLSYMS_ALL
|
||||
|| !(sec->sh_flags & SHF_EXECINSTR)
|
||||
#endif
|
||||
#endif
|
||||
|| (sec->sh_entsize & INIT_OFFSET_MASK))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user