summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2013-11-05 13:37:33 +0100
committerMark Wielaard <mjw@redhat.com>2013-11-05 13:37:33 +0100
commitbe86084bd77f5729138577291baad6b29fb44984 (patch)
treedc1d7ed20f75162dd435a411f4fc994127fd247a
parentd8c75df969fff193d143789cba03038db8da5a2c (diff)
downloadelfutils-be86084bd77f5729138577291baad6b29fb44984.tar.gz
readelf: Solve comparison between signed and unsigned compiler warning.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r--src/ChangeLog6
-rw-r--r--src/readelf.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 72f99245..3012bf43 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-05 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (print_debug_ranges_section): Cast address to size_t
+ before comparison.
+ (print_debug_loc_section): Likewise.
+
2013-10-18 Mark Wielaard <mjw@redhat.com>
* ar.c (main): Correct operation check when instance_specifed is set.
diff --git a/src/readelf.c b/src/readelf.c
index d1a5b682..ac2f2b0a 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4638,7 +4638,7 @@ print_debug_ranges_section (Dwfl_Module *dwflmod,
offset, &readp, endp))
continue;
- if (unlikely (data->d_size - offset < address_size * 2))
+ if (unlikely (data->d_size - offset < (size_t) address_size * 2))
{
printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
break;
@@ -6554,7 +6554,7 @@ print_debug_loc_section (Dwfl_Module *dwflmod,
&cu, offset, &readp, endp))
continue;
- if (unlikely (data->d_size - offset < address_size * 2))
+ if (unlikely (data->d_size - offset < (size_t) address_size * 2))
{
printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
break;