Skip to content

Commit

Permalink
Kbuild: Handle longer symbols in kallsyms.c
Browse files Browse the repository at this point in the history
Also warn for too long symbols

v2: Add missing newline. Use 255 max (Joe Perches)
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
Andi Kleen authored and michal42 committed Nov 6, 2013
1 parent eea0e9c commit f3462aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#endif

#define KSYM_NAME_LEN 128
#define KSYM_NAME_LEN 255

struct sym_entry {
unsigned long long addr;
Expand Down Expand Up @@ -111,6 +111,12 @@ static int read_symbol(FILE *in, struct sym_entry *s)
fprintf(stderr, "Read error or end of file.\n");
return -1;
}
if (strlen(str) > KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%lu vs %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
str, strlen(str), KSYM_NAME_LEN);
return -1;
}

sym = str;
/* skip prefix char */
Expand Down

0 comments on commit f3462aa

Please sign in to comment.