Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. diff --git a/contrib/elftoolchain/nm/nm.c b/contrib/elftoolchain/nm/nm.c
  2. index 637cdd9..c5657b5 100644
  3. --- a/contrib/elftoolchain/nm/nm.c
  4. +++ b/contrib/elftoolchain/nm/nm.c
  5. @@ -375,21 +375,21 @@ cmp_value(const void *lp, const void *rp)
  6. assert(l_is_undef + r_is_undef <= 2);
  7.  
  8. switch (l_is_undef + r_is_undef) {
  9. - case 0:
  10. - /* Both defined */
  11. - if (l->sym->st_value == r->sym->st_value)
  12. - return (strcmp(l->name, r->name));
  13. - return (l->sym->st_value - r->sym->st_value);
  14. case 1:
  15. /* One undefined */
  16. return (l_is_undef == 0 ? 1 : -1);
  17. case 2:
  18. /* Both undefined */
  19. return (strcmp(l->name, r->name));
  20. + default:
  21. + break;
  22. }
  23. - /* NOTREACHED */
  24.  
  25. - return (l->sym->st_value - r->sym->st_value);
  26. + assert(l_is_undef + r_is_undef == 0);
  27. + /* Both defined */
  28. + if (l->sym->st_value == r->sym->st_value)
  29. + return (strcmp(l->name, r->name));
  30. + return ((l->sym->st_value > r->sym->st_value) ? 1 : -1);
  31. }
  32.  
  33. static void
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement