Fix 32-bit builds
diff --git a/ltrace-elf.c b/ltrace-elf.c
index a311c5f..b1af070 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -175,8 +175,8 @@
{
assert(data != NULL);
if (data->d_size < size || offset > data->d_size - size) {
- debug(1, "Not enough data to read %zd-byte value"
- " at offset %zd.", size, offset);
+ debug(1, "Not enough data to read %"PRId64"-byte value"
+ " at offset %"PRId64".", size, offset);
return -1;
}
return 0;
diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index 3b6a25f..9717738 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -230,7 +230,9 @@
error(0, errno, "dynamic .opd translation of %p", addr);
return -1;
}
- *ret = (target_address_t)value;
+ /* XXX The double cast should be removed when
+ * target_address_t becomes integral type. */
+ *ret = (target_address_t)(uintptr_t)value;
return 0;
}
@@ -243,14 +245,17 @@
target_address_t addr, target_address_t *ret)
{
if (lte->ehdr.e_machine == EM_PPC64) {
- GElf_Xword offset = (GElf_Addr)addr - lte->arch.opd_base;
+ /* XXX The double cast should be removed when
+ * target_address_t becomes integral type. */
+ GElf_Xword offset
+ = (GElf_Addr)(uintptr_t)addr - lte->arch.opd_base;
uint64_t value;
if (elf_read_u64(lte->arch.opd_data, offset, &value) < 0) {
error(0, 0, "static .opd translation of %p: %s", addr,
elf_errmsg(-1));
return -1;
}
- *ret = (target_address_t)(value + lte->bias);
+ *ret = (target_address_t)(uintptr_t)(value + lte->bias);
return 0;
}