aboutsummaryrefslogtreecommitdiff
path: root/ltrace-elf.h
diff options
context:
space:
mode:
authorZachary T Welch <zwelch@codesourcery.com>2010-12-14 15:12:47 -0800
committerJoe Damato <ice799@gmail.com>2011-01-06 11:41:20 -0800
commit3ba522fed3d34f476090da9349be96e15e0652cb (patch)
tree9b9e1cb6ac53a0b173d6c8c621cad38994d5c090 /ltrace-elf.h
parent97baa65bd20cf9b24f078406fbb622f51e3d45b7 (diff)
downloadltrace-3ba522fed3d34f476090da9349be96e15e0652cb.tar.gz
Fix build for x86_64
Some ELF-related variables differ depending on the native host, so this patch uses conditional compilation tricks to ensure everything works out on both 32- and 64-bit hosts. Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Diffstat (limited to 'ltrace-elf.h')
-rw-r--r--ltrace-elf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ltrace-elf.h b/ltrace-elf.h
index 37f2a18..a29fe2c 100644
--- a/ltrace-elf.h
+++ b/ltrace-elf.h
@@ -51,4 +51,13 @@ extern GElf_Addr arch_plt_sym_val(struct ltelf *, size_t, GElf_Rela *);
#ifndef SHT_GNU_HASH
#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */
#endif
+
+#if __WORDSIZE == 32
+#define PRI_ELF_ADDR PRIx32
+#define GELF_ADDR_CAST(x) (void *)(uint32_t)(x)
+#else
+#define PRI_ELF_ADDR PRIx64
+#define GELF_ADDR_CAST(x) (void *)(x)
+#endif
+
#endif