]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Correct result for whole address range in compare_modules.
authorUlrich Drepper <drepper@redhat.com>
Fri, 29 Dec 2006 20:36:38 +0000 (20:36 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 29 Dec 2006 20:36:38 +0000 (20:36 +0000)
libdwfl/ChangeLog
libdwfl/dwfl_module.c

index f70c3397f8aa30c2f988ef0a0768e91ca50e511c..50e9e1bb9c97133e2dde0c4543d06cc68b63bfbb 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-29  Ulrich Drepper  <drepper@redhat.com>
+
+       * dwfl_module.c (compare_modules): Do not try to be smart and use
+       subtraction which can lead to wrong results.
+       Patch by Frank Eigler <fche@redhat.com>.
+
 2006-10-30  Roland McGrath  <roland@redhat.com>
 
        * dwfl_module.c (dwfl_report_module): Comment typo fix.
index 5990b7550c4f602a39e88307729b12543d82b968..0cccb5c09f090a49b65e99459934888ab9ecc59f 100644 (file)
@@ -172,10 +172,9 @@ compare_modules (const void *a, const void *b)
   if (m2 == NULL)
     return 1;
 
-  GElf_Sxword diff = m1->low_addr - m2->low_addr;
-  if (diff < 0)
+  if (m1->low_addr < m2->low_addr
     return -1;
-  if (diff > 0)
+  if (m1->low_addr > m2->low_addr)
     return 1;
   return 0;
 }