Skip to content

Commit 80b8bf4

Browse files
chleroymcgrof
authored andcommitted
module: Always have struct mod_tree_root
In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP. Signed-off-by: Christophe Leroy <[email protected]> Reviewed-by: Aaron Tomlin <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 7337f92 commit 80b8bf4

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

kernel/module/internal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,17 @@ static inline void module_decompress_cleanup(struct load_info *info)
143143
}
144144
#endif
145145

146-
#ifdef CONFIG_MODULES_TREE_LOOKUP
147146
struct mod_tree_root {
147+
#ifdef CONFIG_MODULES_TREE_LOOKUP
148148
struct latch_tree_root root;
149+
#endif
149150
unsigned long addr_min;
150151
unsigned long addr_max;
151152
};
152153

153154
extern struct mod_tree_root mod_tree;
154155

156+
#ifdef CONFIG_MODULES_TREE_LOOKUP
155157
void mod_tree_insert(struct module *mod);
156158
void mod_tree_remove_init(struct module *mod);
157159
void mod_tree_remove(struct module *mod);

kernel/module/main.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,13 @@ static void do_free_init(struct work_struct *w);
7474
static DECLARE_WORK(init_free_wq, do_free_init);
7575
static LLIST_HEAD(init_free_list);
7676

77-
#ifdef CONFIG_MODULES_TREE_LOOKUP
7877
struct mod_tree_root mod_tree __cacheline_aligned = {
7978
.addr_min = -1UL,
8079
};
8180

8281
#define module_addr_min mod_tree.addr_min
8382
#define module_addr_max mod_tree.addr_max
8483

85-
#else /* !CONFIG_MODULES_TREE_LOOKUP */
86-
static unsigned long module_addr_min = -1UL, module_addr_max;
87-
#endif /* CONFIG_MODULES_TREE_LOOKUP */
88-
8984
struct symsearch {
9085
const struct kernel_symbol *start, *stop;
9186
const s32 *crcs;

0 commit comments

Comments
 (0)