mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 06:46:35 +01:00
With CONFIG_MEM_ALLOC_PROFILING=n, vmlinux and all modules unnecessarily contain the symbols __start_alloc_tags and __stop_alloc_tags, which define an empty range. In the case of modules, the presence of these symbols also forces the linker to create an empty .codetag.alloc_tags section. Update codetag.lds.h to make the data conditional on CONFIG_MEM_ALLOC_PROFILING. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Petr Pavlu <[email protected]> Reviewed-by: Kent Overstreet <[email protected]> Reviewed-by: Suren Baghdasaryan <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Casey Chen <[email protected]> Cc: Petr Pavlu <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
34 lines
935 B
C
34 lines
935 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef __ASM_GENERIC_CODETAG_LDS_H
|
|
#define __ASM_GENERIC_CODETAG_LDS_H
|
|
|
|
#ifdef CONFIG_MEM_ALLOC_PROFILING
|
|
#define IF_MEM_ALLOC_PROFILING(...) __VA_ARGS__
|
|
#else
|
|
#define IF_MEM_ALLOC_PROFILING(...)
|
|
#endif
|
|
|
|
#define SECTION_WITH_BOUNDARIES(_name) \
|
|
. = ALIGN(8); \
|
|
__start_##_name = .; \
|
|
KEEP(*(_name)) \
|
|
__stop_##_name = .;
|
|
|
|
#define CODETAG_SECTIONS() \
|
|
IF_MEM_ALLOC_PROFILING(SECTION_WITH_BOUNDARIES(alloc_tags))
|
|
|
|
#define MOD_SEPARATE_CODETAG_SECTION(_name) \
|
|
.codetag.##_name : { \
|
|
SECTION_WITH_BOUNDARIES(_name) \
|
|
}
|
|
|
|
/*
|
|
* For codetags which might be used after module unload, therefore might stay
|
|
* longer in memory. Each such codetag type has its own section so that we can
|
|
* unload them individually once unused.
|
|
*/
|
|
#define MOD_SEPARATE_CODETAG_SECTIONS() \
|
|
IF_MEM_ALLOC_PROFILING(MOD_SEPARATE_CODETAG_SECTION(alloc_tags))
|
|
|
|
#endif /* __ASM_GENERIC_CODETAG_LDS_H */
|