summaryrefslogtreecommitdiff
path: root/libdwfl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-12-29 20:36:38 +0000
committerUlrich Drepper <drepper@redhat.com>2006-12-29 20:36:38 +0000
commita33c3013e80383342825c1af7fad2a6f3979ceee (patch)
tree6a0f62ed14a5db9286ad9971e20aa05b877a6e47 /libdwfl
parent8b2a7705531e3eb7fe3a50eca6d07484c097493c (diff)
downloadelfutils-a33c3013e80383342825c1af7fad2a6f3979ceee.tar.gz
Correct result for whole address range in compare_modules.
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog6
-rw-r--r--libdwfl/dwfl_module.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index f70c3397..50e9e1bb 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -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.
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index 5990b755..0cccb5c0 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -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;
}