ANDROID: kallsyms: strip hashes from function names with ThinLTO

With CONFIG_THINLTO and CFI both enabled, LLVM appends a hash to the
names of all static functions. This breaks userspace tools, so strip
out the hash from output.

Bug: 147422318
Change-Id: Ibea6be089d530e92dcd191481cb02549041203f6
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
tirimbino
Sami Tolvanen 5 years ago
parent 98c326e94f
commit 75f80b3632
  1. 6
      kernel/kallsyms.c

@ -314,6 +314,12 @@ static inline void cleanup_symbol_name(char *s)
{
char *res;
#ifdef CONFIG_THINLTO
/* Filter out hashes from static functions */
res = strrchr(s, '$');
if (res)
*res = '\0';
#endif
res = strrchr(s, '.');
if (res && !strcmp(res, ".cfi"))
*res = '\0';

Loading…
Cancel
Save