1 // SPDX-License-Identifier: GPL-2.0
9 /* On arm64, kernel text segment starts at high memory address,
10 * for example 0xffff 0000 8xxx xxxx. Modules start at a low memory
11 * address, like 0xffff 0000 00ax xxxx. When only small amount of
12 * memory is used by modules, gap between end of module's text segment
13 * and start of kernel text segment may reach 2G.
14 * Therefore do not fill this gap and do not assign it to the kernel dso map.
17 #define SYMBOL_LIMIT (1 << 12) /* 4K */
19 void arch__symbols__fixup_end(struct symbol *p, struct symbol *c)
21 if ((strchr(p->name, '[') && strchr(c->name, '[') == NULL) ||
22 (strchr(p->name, '[') == NULL && strchr(c->name, '[')))
23 /* Limit range of last symbol in module and kernel */
24 p->end += SYMBOL_LIMIT;
27 pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);