diff mbox

[2/3] Kbuild: Handle longer symbols in kallsyms.c v2

Message ID 20131023130753.GO29695@two.firstfloor.org (mailing list archive)
State New, archived
Headers show

Commit Message

Andi Kleen Oct. 23, 2013, 1:07 p.m. UTC
Also warn for too long symbols

v2: Add missing newline. Use 255 max (Joe Perches)
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 scripts/kallsyms.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Michal Marek Nov. 6, 2013, 9:27 p.m. UTC | #1
On Wed, Oct 23, 2013 at 03:07:53PM +0200, Andi Kleen wrote:
> 
> Also warn for too long symbols
> 
> v2: Add missing newline. Use 255 max (Joe Perches)
> Signed-off-by: Andi Kleen <ak@linux.intel.com>

Applied to kbuild.git#kbuild.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 6940f00..c4230a4 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -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;
@@ -118,6 +118,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 */