summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-08-09 16:43:53 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-09-09 19:37:16 +0000
commit4ddcadfba8cd2965a2f908c156ea017542612cd8 (patch)
treeddaf531291af5b12dada6a0025fb785b5b45ba6c /hw
parentf96fdafcaeadc42798b293ea303d89394fa27e54 (diff)
downloadqemu-4ddcadfba8cd2965a2f908c156ea017542612cd8.tar.gz
qemu-4ddcadfba8cd2965a2f908c156ea017542612cd8.tar.bz2
qemu-4ddcadfba8cd2965a2f908c156ea017542612cd8.zip
elf: Calculate symbol size if needed
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/elf_ops.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/elf_ops.h b/hw/elf_ops.h
index 27d1ab9bc2..0bd72350b4 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;