This source file includes following definitions.
- arch__fix_module_text_start
- arch__symbols__fixup_end
1
2 #include <unistd.h>
3 #include <stdio.h>
4 #include <string.h>
5 #include <internal/lib.h>
6 #include "machine.h"
7 #include "api/fs/fs.h"
8 #include "debug.h"
9 #include "symbol.h"
10
11 int arch__fix_module_text_start(u64 *start, u64 *size, const char *name)
12 {
13 u64 m_start = *start;
14 char path[PATH_MAX];
15
16 snprintf(path, PATH_MAX, "module/%.*s/sections/.text",
17 (int)strlen(name) - 2, name + 1);
18 if (sysfs__read_ull(path, (unsigned long long *)start) < 0) {
19 pr_debug2("Using module %s start:%#lx\n", path, m_start);
20 *start = m_start;
21 } else {
22
23
24
25
26
27
28
29
30
31
32 *size -= (*start - m_start);
33 }
34
35 return 0;
36 }
37
38
39
40
41
42
43
44 void arch__symbols__fixup_end(struct symbol *p, struct symbol *c)
45 {
46 if (strchr(p->name, '[') == NULL && strchr(c->name, '['))
47
48 p->end = roundup(p->end, page_size);
49 else
50 p->end = c->start;
51 pr_debug4("%s sym:%s end:%#lx\n", __func__, p->name, p->end);
52 }