diff options
| author | Mark Wielaard <[email protected]> | 2016-01-08 16:45:12 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2016-01-08 16:45:15 +0100 |
| commit | 3a5fc51573ae88a06d2050ef8425336e23013852 (patch) | |
| tree | dca3c0a35cc31e1251dbfe664c21f2e73c92a3f7 /src | |
| parent | 7930054cf5628e779ceadac68cf59689ddc37cf7 (diff) | |
Fix build on 32bit systems.
size_t has a different size on 32 and 64 bit systems.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/elfcompress.c | 2 | ||||
| -rw-r--r-- | src/readelf.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ae2129d9..af98c4de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2016-01-08 Mark Wielaard <[email protected]> + + * 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 <[email protected]> * elfcompress.c: New file. diff --git a/src/elfcompress.c b/src/elfcompress.c index 5be2375d..23939db8 100644 --- a/src/elfcompress.c +++ b/src/elfcompress.c @@ -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); } } diff --git a/src/readelf.c b/src/readelf.c index 85fa92bc..0db192ee 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -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, |
