aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-05-15 11:47:08 +0200
committerMark Wielaard <mark@klomp.org>2018-05-15 11:47:08 +0200
commita392e674beb9585fa90d1080c941ecc06bb65b57 (patch)
tree4e836bab3a35c80d6913395bdb2aa6ece772ce03 /src
parentcdf865b890c2480c14245e2dbcae33dea0a03cf7 (diff)
downloadelfutils-a392e674beb9585fa90d1080c941ecc06bb65b57.tar.gz
readelf: Fix 32bit compile issues.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/readelf.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4e6887e1..419fa208 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-15 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Cast comparisons against offset_len to
+ ptrdiff_t.
+ (print_debug_line_section): Print uint64_t as PRIu64.
+
2018-05-11 Mark Wielaard <mark@klomp.org>
* readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
diff --git a/src/readelf.c b/src/readelf.c
index c1d89d39..854d31c1 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6906,7 +6906,7 @@ print_form_data (Dwarf *dbg, int form, const unsigned char *readp,
case DW_FORM_strp:
case DW_FORM_line_strp:
case DW_FORM_strp_sup:
- if (readendp - readp < offset_len)
+ if (readendp - readp < (ptrdiff_t) offset_len)
goto invalid_data;
if (offset_len == 8)
val = read_8ubyte_unaligned_inc (dbg, readp);
@@ -6930,7 +6930,7 @@ print_form_data (Dwarf *dbg, int form, const unsigned char *readp,
break;
case DW_FORM_sec_offset:
- if (readendp - readp < offset_len)
+ if (readendp - readp < (ptrdiff_t) offset_len)
goto invalid_data;
if (offset_len == 8)
val = read_8ubyte_unaligned_inc (dbg, readp);
@@ -6952,7 +6952,7 @@ print_form_data (Dwarf *dbg, int form, const unsigned char *readp,
{
readp = data->d_buf + str_offsets_base + val;
readendp = data->d_buf + data->d_size;
- if (readendp - readp < offset_len)
+ if (readendp - readp < (ptrdiff_t) offset_len)
str = "???";
else
{
@@ -7248,7 +7248,7 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
for (uint64_t i = 0; i < directories_count; i++)
{
- printf (" %-5lu ", i);
+ printf (" %-5" PRIu64 " ", i);
for (int j = 0; j < directory_entry_format_count; j++)
{
linep = print_form_data (dbg, enc[j].form,
@@ -7324,7 +7324,7 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
for (uint64_t i = 0; i < file_name_count; i++)
{
- printf (" %-5lu ", i);
+ printf (" %-5" PRIu64 " ", i);
for (int j = 0; j < file_name_format_count; j++)
{
linep = print_form_data (dbg, enc[j].form,