]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix build on 32bit systems.
authorMark Wielaard <mjw@redhat.com>
Fri, 8 Jan 2016 15:45:12 +0000 (16:45 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 8 Jan 2016 15:45:15 +0000 (16:45 +0100)
size_t has a different size on 32 and 64 bit systems.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/elfcompress.c
src/readelf.c
tests/ChangeLog
tests/elfputzdata.c

index ae2129d96caf44ec0e2c2e748997e8e37c497122..af98c4ded50803287f33fbd4a4366d556a30167f 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 5be2375d5c046e071b154cf94f37f93b6470c453..23939db8bbdcb5c1b30349603f13d9133d90f687 100644 (file)
@@ -237,7 +237,7 @@ compress_section (Elf_Scn *scn, size_t orig_size, const char *name,
            }
          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);
        }
     }
index 85fa92bc5ef8fc6aec51089d760ebcc9fc181a2c..0db192ee42aee4d626b1ec304bb9f35ddd3eee15 100644 (file)
@@ -1217,7 +1217,7 @@ There are %d section headers, starting at offset %#" PRIx64 ":\n\
            {
              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,
index 453c41861612636599bacdc174c262b1be449cf4..3d9353c4338ffbbbd435a9a4b6529fd36d38b8a2 100644 (file)
@@ -1,3 +1,7 @@
+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
index 7e6f01145302c8d45b533cc4f09098d2dcf75657..67c6090876fec59b955269b54098c76d8abc2d06 100644 (file)
@@ -90,7 +90,7 @@ main (int argc, char *argv[])
          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)