1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <inttypes.h>
4 #include <stdio.h>
5 #include <string.h>
6 #include <internal/lib.h> // page_size
7 #include "debug.h"
8 #include "symbol.h"
9 
10 /* On powerpc kernel text segment start at memory addresses, 0xc000000000000000
11  * whereas the modules are located at very high memory addresses,
12  * for example 0xc00800000xxxxxxx. The gap between end of kernel text segment
13  * and beginning of first module's text segment is very high.
14  * Therefore do not fill this gap and do not assign it to the kernel dso map.
15  */
16 
arch__symbols__fixup_end(struct symbol * p,struct symbol * c)17 void arch__symbols__fixup_end(struct symbol *p, struct symbol *c)
18 {
19 	if (strchr(p->name, '[') == NULL && strchr(c->name, '['))
20 		/* Limit the range of last kernel symbol */
21 		p->end += page_size;
22 	else
23 		p->end = c->start;
24 	pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
25 }
26