1 #include "symbol/kallsyms.h"
5 u8 kallsyms2elf_type(char type)
8 return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT;
11 int kallsyms__parse(const char *filename, void *arg,
12 int (*process_symbol)(void *arg, const char *name,
13 char type, u64 start))
18 FILE *file = fopen(filename, "r");
31 line_len = getline(&line, &n, file);
32 if (line_len < 0 || !line)
35 line[--line_len] = '\0'; /* \n */
37 len = hex2u64(line, &start);
40 if (len + 2 >= line_len)
43 symbol_type = line[len];
45 symbol_name = line + len;
48 if (len >= KSYM_NAME_LEN) {
53 err = process_symbol(arg, symbol_name, symbol_type, start);