xref: /linux/include/asm-generic/codetag.lds.h (revision 1a80ff0f8896750156f22dbf2d4591d79bb2a155)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef __ASM_GENERIC_CODETAG_LDS_H
3 #define __ASM_GENERIC_CODETAG_LDS_H
4 
5 #define SECTION_WITH_BOUNDARIES(_name)	\
6 	. = ALIGN(8);			\
7 	__start_##_name = .;		\
8 	KEEP(*(_name))			\
9 	__stop_##_name = .;
10 
11 #define CODETAG_SECTIONS()		\
12 	SECTION_WITH_BOUNDARIES(alloc_tags)
13 
14 #define MOD_SEPARATE_CODETAG_SECTION(_name)	\
15 	.codetag.##_name : {			\
16 		SECTION_WITH_BOUNDARIES(_name)	\
17 	}
18 
19 /*
20  * For codetags which might be used after module unload, therefore might stay
21  * longer in memory. Each such codetag type has its own section so that we can
22  * unload them individually once unused.
23  */
24 #define MOD_SEPARATE_CODETAG_SECTIONS()		\
25 	MOD_SEPARATE_CODETAG_SECTION(alloc_tags)
26 
27 #endif /* __ASM_GENERIC_CODETAG_LDS_H */
28