diff --git a/src/lib_rdi_make/rdi_make.c b/src/lib_rdi_make/rdi_make.c index fe187d22..8b634ea3 100644 --- a/src/lib_rdi_make/rdi_make.c +++ b/src/lib_rdi_make/rdi_make.c @@ -442,7 +442,8 @@ rdim_sort_key_array(RDIM_Arena *arena, RDIM_SortKey *keys, RDI_U64 count) RDI_U64 j2_opl = range2->opl; for(;;) { - if(src[j1].key <= src[j2].key) + if(src[j1].key < src[j2].key || + (src[j1].key == src[j2].key && src[j1].val == 0 && src[j2].val != 0)) { rdim_memcpy(dst + jd, src + j1, sizeof(*src)); j1 += 1; diff --git a/src/radbin/radbin.c b/src/radbin/radbin.c index 09beb13a..bd941178 100644 --- a/src/radbin/radbin.c +++ b/src/radbin/radbin.c @@ -1143,7 +1143,6 @@ rb_thread_entry_point(void *p) RDI_Scope *root_scope = rdi_element_from_name_idx(rdi, Scopes, proc->root_scope_idx); if(root_scope->voff_range_opl > root_scope->voff_range_first) { - // rjf: dump function record RDIM_Rng1U64 voff_range = { @@ -1152,7 +1151,8 @@ rb_thread_entry_point(void *p) }; { Temp scratch = scratch_begin(0, 0); - str8_list_pushf(arena, out, "FUNC %I64x %I64x %I64x %S\n", voff_range.min, voff_range.max-voff_range.min, 0ull, fully_qualified_str8_from_rdi_symbol(scratch.arena, rdi, proc)); + String8 name = fully_qualified_str8_from_rdi_symbol(scratch.arena, rdi, proc); + str8_list_pushf(arena, out, "FUNC %I64x %I64x %I64x %S\n", voff_range.min, voff_range.max-voff_range.min, 0ull, name); scratch_end(scratch); }