Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools lib symbol: Introduce kallsyms2elf_type

Map 't', 'T' (text, local, global), 'w' and 'W' (weak text, local,
global) as STT_FUNC, and the rest as STT_OBJECT

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-sbwcixulpc5v1xuxn3xvm0nn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+8
+6
tools/lib/symbol/kallsyms.c
··· 2 2 #include <stdio.h> 3 3 #include <stdlib.h> 4 4 5 + u8 kallsyms2elf_type(char type) 6 + { 7 + type = tolower(type); 8 + return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT; 9 + } 10 + 5 11 int kallsyms__parse(const char *filename, void *arg, 6 12 int (*process_symbol)(void *arg, const char *name, 7 13 char type, u64 start))
+2
tools/lib/symbol/kallsyms.h
··· 17 17 return isupper(type) ? STB_GLOBAL : STB_LOCAL; 18 18 } 19 19 20 + u8 kallsyms2elf_type(char type); 21 + 20 22 int kallsyms__parse(const char *filename, void *arg, 21 23 int (*process_symbol)(void *arg, const char *name, 22 24 char type, u64 start));