+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.
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);
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);
{
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
{
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,
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,