提交 e403e433 编写于 作者: S Stefan Weil 提交者: Blue Swirl

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: NStefan Weil <weil@mail.berlios.de>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 d7d9b528
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册