All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] elf: Calculate symbol size if needed
@ 2010-08-09 14:43 Stefan Weil
  2010-08-11 16:21 ` Blue Swirl
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Weil @ 2010-08-09 14:43 UTC (permalink / raw)
  To: QEMU Developers

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-09-09 21:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 14:43 [Qemu-devel] [PATCH] elf: Calculate symbol size if needed Stefan Weil
2010-08-11 16:21 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.