FreeCalypso > hg > freecalypso-reveng
diff ticoff/symtab.c @ 116:5f4141ee175b
tiobjd: retain the original symtab order for symbols at the same position
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 03 Apr 2014 07:00:08 +0000 |
parents | 192da19c7506 |
children | 193926ccd1ec |
line wrap: on
line diff
--- a/ticoff/symtab.c Thu Apr 03 06:50:07 2014 +0000 +++ b/ticoff/symtab.c Thu Apr 03 07:00:08 2014 +0000 @@ -164,10 +164,16 @@ compare_for_sort(p1, p2) struct internal_syment **p1, **p2; { + /* sort by value first */ if ((*p1)->value < (*p2)->value) return(-1); if ((*p1)->value > (*p2)->value) return(1); + /* if same value, retain the original symtab order */ + if ((*p1)->number < (*p2)->number) + return(-1); + if ((*p1)->number > (*p2)->number) + return(1); else return(0); }