From patchwork Wed Oct 23 13:07:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 3088351 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4850ABF924 for ; Wed, 23 Oct 2013 13:08:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD9962039C for ; Wed, 23 Oct 2013 13:07:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5070203AD for ; Wed, 23 Oct 2013 13:07:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753691Ab3JWNHz (ORCPT ); Wed, 23 Oct 2013 09:07:55 -0400 Received: from one.firstfloor.org ([193.170.194.197]:44324 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753599Ab3JWNHy (ORCPT ); Wed, 23 Oct 2013 09:07:54 -0400 Received: by one.firstfloor.org (Postfix, from userid 503) id DB97C86769; Wed, 23 Oct 2013 15:07:53 +0200 (CEST) Date: Wed, 23 Oct 2013 15:07:53 +0200 From: Andi Kleen To: Joe Perches Cc: Andi Kleen , mmarek@suse.cz, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 2/3] Kbuild: Handle longer symbols in kallsyms.c v2 Message-ID: <20131023130753.GO29695@two.firstfloor.org> References: <1382456783-22826-1-git-send-email-andi@firstfloor.org> <1382456783-22826-3-git-send-email-andi@firstfloor.org> <1382459794.2041.91.camel@joe-AO722> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1382459794.2041.91.camel@joe-AO722> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Also warn for too long symbols v2: Add missing newline. Use 255 max (Joe Perches) Signed-off-by: Andi Kleen --- scripts/kallsyms.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 */