diff --git a/ChangeLog b/ChangeLog index 87519db9a..5d076e44d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-03-06 Paulo Andrade + + * check/float.tst: Comment out the int to negative infinity + test in mips for the moment because not all Loongson agrees + on the result. + + * lib/jit_disasm.c: Add a test instead of an assertion + when loading symbols for disassembly due to a failure with + a simple binutils build in Debian mipsel64. + 2013-03-06 Paulo Andrade * include/lightning/jit_private.h, lib/jit_arm-cpu.c, diff --git a/check/float.tst b/check/float.tst index cc447ca1f..9c8d039ad 100644 --- a/check/float.tst +++ b/check/float.tst @@ -325,7 +325,10 @@ W##f##r0##f0##l: f2w(__LINE__, 0, 0) f2w(__LINE__, 1, 1) + /* not all loongson agree on it */ +#if !__mips__ f2w(__LINE__, wninf, $nInf) +#endif f2w(__LINE__, wpinf, $pInf) f2w(__LINE__, wnan, $NaN) diff --git a/lib/jit_disasm.c b/lib/jit_disasm.c index 52c071d07..5f21a1940 100644 --- a/lib/jit_disasm.c +++ b/lib/jit_disasm.c @@ -96,59 +96,60 @@ jit_init_debug(void) long sym_storage; long dyn_storage; - sym_storage = bfd_get_symtab_upper_bound(disasm_bfd); - assert(sym_storage >= 0); + if ((sym_storage = bfd_get_symtab_upper_bound(disasm_bfd)) >= 0) { - if (bfd_get_file_flags(disasm_bfd) & DYNAMIC) { - dyn_storage = bfd_get_dynamic_symtab_upper_bound(disasm_bfd); - assert(dyn_storage >= 0); - } - else - dyn_storage = 0; + if (bfd_get_file_flags(disasm_bfd) & DYNAMIC) { + dyn_storage = bfd_get_dynamic_symtab_upper_bound(disasm_bfd); + assert(dyn_storage >= 0); + } + else + dyn_storage = 0; - disasm_symbols = malloc(sym_storage + dyn_storage); - sym_count = bfd_canonicalize_symtab(disasm_bfd, disasm_symbols); - assert(sym_count >= 0); - if (dyn_storage) { - dyn_count = bfd_canonicalize_dynamic_symtab(disasm_bfd, - disasm_symbols + - sym_count); - assert(dyn_count >= 0); - } - else - dyn_count = 0; - disasm_num_symbols = sym_count + dyn_count; + disasm_symbols = malloc(sym_storage + dyn_storage); + sym_count = bfd_canonicalize_symtab(disasm_bfd, disasm_symbols); + assert(sym_count >= 0); + if (dyn_storage) { + dyn_count = bfd_canonicalize_dynamic_symtab(disasm_bfd, + disasm_symbols + + sym_count); + assert(dyn_count >= 0); + } + else + dyn_count = 0; + disasm_num_symbols = sym_count + dyn_count; - disasm_num_synthetic = bfd_get_synthetic_symtab(disasm_bfd, - sym_count, - disasm_symbols, - dyn_count, - disasm_symbols + - sym_count, - &disasm_synthetic); - if (disasm_num_synthetic > 0) { - disasm_symbols = realloc(disasm_symbols, - sym_storage + dyn_storage + - disasm_num_synthetic * sizeof(asymbol *)); - for (offset = 0; offset < disasm_num_synthetic; offset++) - disasm_symbols[disasm_num_symbols++] = - disasm_synthetic + offset; - } + disasm_num_synthetic = bfd_get_synthetic_symtab(disasm_bfd, + sym_count, + disasm_symbols, + dyn_count, + disasm_symbols + + sym_count, + &disasm_synthetic); + if (disasm_num_synthetic > 0) { + disasm_symbols = realloc(disasm_symbols, + sym_storage + dyn_storage + + disasm_num_synthetic * + sizeof(asymbol *)); + for (offset = 0; offset < disasm_num_synthetic; offset++) + disasm_symbols[disasm_num_symbols++] = + disasm_synthetic + offset; + } - /* remove symbols not useful for disassemble */ - in = out = disasm_symbols; - for (offset = 0; offset < disasm_num_symbols; offset++) { - symbol = *in++; - if (symbol->name && - symbol->name[0] != '\0' && - !(symbol->flags & (BSF_DEBUGGING | BSF_SECTION_SYM)) && - !bfd_is_und_section(symbol->section) && - !bfd_is_com_section(symbol->section)) - *out++ = symbol; + /* remove symbols not useful for disassemble */ + in = out = disasm_symbols; + for (offset = 0; offset < disasm_num_symbols; offset++) { + symbol = *in++; + if (symbol->name && + symbol->name[0] != '\0' && + !(symbol->flags & (BSF_DEBUGGING | BSF_SECTION_SYM)) && + !bfd_is_und_section(symbol->section) && + !bfd_is_com_section(symbol->section)) + *out++ = symbol; + } + disasm_num_symbols = out - disasm_symbols; + qsort(disasm_symbols, disasm_num_symbols, + sizeof(asymbol *), disasm_compare_symbols); } - disasm_num_symbols = out - disasm_symbols; - qsort(disasm_symbols, disasm_num_symbols, - sizeof(asymbol *), disasm_compare_symbols); } #endif }