From patchwork Mon Aug 9 14:43:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 61282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 14994B6EFE for ; Tue, 10 Aug 2010 00:44:46 +1000 (EST) Received: from localhost ([127.0.0.1]:51121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiTaj-0004Wg-Th for incoming@patchwork.ozlabs.org; Mon, 09 Aug 2010 10:44:41 -0400 Received: from [140.186.70.92] (port=42079 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiTa9-0004VM-M3 for qemu-devel@nongnu.org; Mon, 09 Aug 2010 10:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiTa8-0003iM-D7 for qemu-devel@nongnu.org; Mon, 09 Aug 2010 10:44:05 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:64067) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiTa7-0003h5-WE for qemu-devel@nongnu.org; Mon, 09 Aug 2010 10:44:04 -0400 Received: from flocke.weilnetz.de (p54ADB942.dip.t-dialin.net [84.173.185.66]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M5tFN-1P79Iw2h57-00xkHz; Mon, 09 Aug 2010 16:43:55 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.72) (envelope-from ) id 1OiTZy-0001ng-Ml; Mon, 09 Aug 2010 16:43:54 +0200 From: Stefan Weil To: QEMU Developers Date: Mon, 9 Aug 2010 16:43:53 +0200 Message-Id: <1281365033-6893-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.1 X-Provags-ID: V02:K0:0Qc09rGD/OWkoGrSHyb+ycqYN8l9FbSkRE/Ruj6HBzp +7XDLHLB2tzSI1dKXRyWT9PcNeDAkwZnsoPGk3bfAUQAbQjt2y 4WzwsKEq5C9WOdzvnjx27oASSVgpFksJZUnU8FD2xNd0/LIzi1 wEytFDyWvfdsFjBxNkPOyXmLZS+ZBQ2OkZapaYRMWuo5n7uals bpBq9qgjgT++XoJf40pTD/6oqkjCiw+0PGfbEkFVHgitHvdnXt hmdyruavQIf6W X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] elf: Calculate symbol size if needed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Symbols with a size of 0 are unusable for the disassembler. Example: While running an arm linux kernel, no symbolic names are used in qemu.log when the cpu is executing an assembler function. Assume that the size of such symbols is the difference to the next symbol value. Signed-off-by: Stefan Weil --- hw/elf_ops.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/elf_ops.h b/hw/elf_ops.h index 27d1ab9..0bd7235 100644 --- a/hw/elf_ops.h +++ b/hw/elf_ops.h @@ -153,6 +153,11 @@ static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab, syms = qemu_realloc(syms, nsyms * sizeof(*syms)); qsort(syms, nsyms, sizeof(*syms), glue(symcmp, SZ)); + for (i = 0; i < nsyms - 1; i++) { + if (syms[i].st_size == 0) { + syms[i].st_size = syms[i + 1].st_value - syms[i].st_value; + } + } } else { qemu_free(syms); syms = NULL;