1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __TOOLS_KALLSYMS_H_ 2 #ifndef __TOOLS_KALLSYMS_H_ 3 #define __TOOLS_KALLSYMS_H_ 1 3 #define __TOOLS_KALLSYMS_H_ 1 4 4 5 #include <elf.h> 5 #include <elf.h> 6 #include <linux/ctype.h> 6 #include <linux/ctype.h> 7 #include <linux/types.h> 7 #include <linux/types.h> 8 8 9 #ifndef KSYM_NAME_LEN 9 #ifndef KSYM_NAME_LEN 10 #define KSYM_NAME_LEN 512 !! 10 #define KSYM_NAME_LEN 256 11 #endif 11 #endif 12 12 13 static inline u8 kallsyms2elf_binding(char typ 13 static inline u8 kallsyms2elf_binding(char type) 14 { 14 { 15 if (type == 'W') 15 if (type == 'W') 16 return STB_WEAK; 16 return STB_WEAK; 17 17 18 return isupper(type) ? STB_GLOBAL : ST 18 return isupper(type) ? STB_GLOBAL : STB_LOCAL; 19 } 19 } 20 20 21 u8 kallsyms2elf_type(char type); 21 u8 kallsyms2elf_type(char type); 22 22 23 bool kallsyms__is_function(char symbol_type); 23 bool kallsyms__is_function(char symbol_type); 24 24 25 int kallsyms__parse(const char *filename, void 25 int kallsyms__parse(const char *filename, void *arg, 26 int (*process_symbol)(void 26 int (*process_symbol)(void *arg, const char *name, 27 char 27 char type, u64 start)); 28 28 29 #endif /* __TOOLS_KALLSYMS_H_ */ 29 #endif /* __TOOLS_KALLSYMS_H_ */ 30 30
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.