size_t has a different size on 32 and 64 bit systems.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2016-01-08 Mark Wielaard <mjw@redhat.com>
+
+ * elfcompress.c (compress_section): Use %zu to print size_t.
+ * readelf.c (print_shdr): Use %zx to print size_t.
+
2015-12-16 Mark Wielaard <mjw@redhat.com>
* elfcompress.c: New file.
}
float new = shdr->sh_size;
float orig = orig_size ?: 1;
- printf (" (%" PRIu64 " => %" PRIu64 " %.2f%%)\n",
+ printf (" (%zu => %" PRIu64 " %.2f%%)\n",
orig_size, shdr->sh_size, (new / orig) * 100);
}
}
{
ssize_t size;
if ((size = dwelf_scn_gnu_compressed_size (scn)) >= 0)
- printf (" [GNU ZLIB %0*" PRIx64 " ]\n",
+ printf (" [GNU ZLIB %0*zx ]\n",
ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? 6 : 8, size);
else
error (0, 0,
+2016-01-08 Mark Wielaard <mjw@redhat.com>
+
+ * elfputzdata.c (main): Use PRId64 to print 64 bit value.
+
2016-01-08 Mark Wielaard <mjw@redhat.com>
* Makefile.am (TESTS): Always unconditionally add
else
{
size_t orig_size = shdr->sh_size;
- printf ("Lets compress %zd %s, size: %zd\n",
+ printf ("Lets compress %zd %s, size: %" PRId64 "\n",
idx, name, shdr->sh_size);
Elf_Data *d = elf_getdata (scn, NULL);
if (d == NULL)