qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] elf: Calculate symbol size if needed
Date: Mon,  9 Aug 2010 16:43:53 +0200	[thread overview]
Message-ID: <1281365033-6893-1-git-send-email-weil@mail.berlios.de> (raw)

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 <weil@mail.berlios.de>
---
 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;
-- 
1.7.1

             reply	other threads:[~2010-08-09 14:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 14:43 Stefan Weil [this message]
2010-08-11 16:21 ` [Qemu-devel] [PATCH] elf: Calculate symbol size if needed Blue Swirl
2010-08-11 18:03   ` Stefan Weil
2010-09-09 17:42   ` Stefan Weil
2010-09-09 18:44     ` Blue Swirl
2010-09-09 19:11       ` Stefan Weil
2010-09-09 19:29         ` Blue Swirl
2010-09-09 19:34           ` Stefan Weil
2010-09-09 19:36             ` Blue Swirl
2010-09-09 21:07               ` Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281365033-6893-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).