2 #include "symbol/kallsyms.h"
6 u8 kallsyms2elf_type(char type)
9 return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT;
12 int kallsyms__parse(const char *filename, void *arg,
13 int (*process_symbol)(void *arg, const char *name,
14 char type, u64 start))
19 FILE *file = fopen(filename, "r");
32 line_len = getline(&line, &n, file);
33 if (line_len < 0 || !line)
36 line[--line_len] = '\0'; /* \n */
38 len = hex2u64(line, &start);
41 if (len + 2 >= line_len)
44 symbol_type = line[len];
46 symbol_name = line + len;
49 if (len >= KSYM_NAME_LEN) {
54 err = process_symbol(arg, symbol_name, symbol_type, start);