2b238f181d97c3dc40b28800468177d558c999fa
[linux-2.6-microblaze.git] / tools / lib / symbol / kallsyms.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __TOOLS_KALLSYMS_H_
3 #define __TOOLS_KALLSYMS_H_ 1
4
5 #include <elf.h>
6 #include <linux/types.h>
7
8 #ifndef KSYM_NAME_LEN
9 #define KSYM_NAME_LEN 256
10 #endif
11
12 static inline u8 kallsyms2elf_binding(char type)
13 {
14         if (type == 'W')
15                 return STB_WEAK;
16
17         return isupper(type) ? STB_GLOBAL : STB_LOCAL;
18 }
19
20 int hex2u64(const char *ptr, u64 *long_val);
21
22 u8 kallsyms2elf_type(char type);
23
24 bool kallsyms__is_function(char symbol_type);
25
26 int kallsyms__parse(const char *filename, void *arg,
27                     int (*process_symbol)(void *arg, const char *name,
28                                           char type, u64 start));
29
30 #endif /* __TOOLS_KALLSYMS_H_ */