+2019-10-14 Alan Modra <amodra@gmail.com>
+
+ * syms.c (struct indexentry): Add idx field.
+ (cmpindexentry): Final sort on idx.
+ (_bfd_stab_section_find_nearest_line): Set idx.
+
2019-10-14 Alan Modra <amodra@gmail.com>
* dwarf2.c (struct lookup_funcinfo): Add idx field.
char *directory_name;
char *file_name;
char *function_name;
+ int idx;
};
/* Compare two indexentry structures. This is called via qsort. */
if (contestantA->val < contestantB->val)
return -1;
- else if (contestantA->val > contestantB->val)
+ if (contestantA->val > contestantB->val)
return 1;
- else
- return 0;
+ return contestantA->idx - contestantB->idx;
}
/* A pointer to this structure is stored in *pinfo. */
info->indextable[i].directory_name = directory_name;
info->indextable[i].file_name = file_name;
info->indextable[i].function_name = NULL;
+ info->indextable[i].idx = i;
++i;
}
info->indextable[i].directory_name = directory_name;
info->indextable[i].file_name = file_name;
info->indextable[i].function_name = function_name;
+ info->indextable[i].idx = i;
++i;
break;
}
info->indextable[i].directory_name = directory_name;
info->indextable[i].file_name = file_name;
info->indextable[i].function_name = NULL;
+ info->indextable[i].idx = i;
++i;
}
info->indextable[i].directory_name = NULL;
info->indextable[i].file_name = NULL;
info->indextable[i].function_name = NULL;
+ info->indextable[i].idx = i;
++i;
info->indextablesize = i;