X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flinux%2Fhost_dasm.c;h=d2d6d0a9bf4b6252fdc085ea59b5686d9b041d59;hb=18b9412743dafb4de7a889b4fba7e34f8a1e8b70;hp=99476891eb877fbbf51de1d216b19639de96ec16;hpb=65c75cb07df9d27905dd166b876d5b6461cb656d;p=picodrive.git diff --git a/platform/linux/host_dasm.c b/platform/linux/host_dasm.c index 9947689..d2d6d0a 100644 --- a/platform/linux/host_dasm.c +++ b/platform/linux/host_dasm.c @@ -21,10 +21,6 @@ static struct disassemble_info di; #define BFD_MACH bfd_mach_i386_i386_intel_syntax #endif -/* hacks for ARM */ -int floatformat_to_double; -int floatformat_ieee_single_little; - /* symbols */ static asymbol **symbols; static long symcount; @@ -41,7 +37,7 @@ remove_useless_symbols (asymbol **symbols, long count) { asymbol *sym = *in_ptr++; - if (sym->name == NULL || sym->name[0] == '\0') + if (sym->name == NULL || sym->name[0] == '\0' || sym->name[0] == '$') continue; if (sym->flags & (BSF_DEBUGGING | BSF_SECTION_SYM)) continue; @@ -57,6 +53,7 @@ remove_useless_symbols (asymbol **symbols, long count) */ *out_ptr++ = sym; } + return out_ptr - symbols; } @@ -147,6 +144,7 @@ static int insn_printf(void *f, const char *format, ...) static void host_dasm_init(void) { + bfd_init(); slurp_symtab(g_argv[0]); init_disassemble_info(&di, NULL, insn_printf); @@ -173,7 +171,7 @@ void host_dasm(void *addr, int len) vma_end = vma + len; while (vma < vma_end) { - printf(" %p ", (void *)(long)vma); + printf(" %p ", (void *)(long)vma); vma += print_insn_func(vma, &di); printf("\n"); }