summaryrefslogtreecommitdiff
path: root/utils/porting.h
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-12-13 23:52:24 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2015-12-17 20:35:20 +0100
commit3aabb58d126445092dca953223c1730d975491dc (patch)
treefecc04383b7ad6fbc5d1d7347ed0a3dac9954a19 /utils/porting.h
parent8340ffd2997feaca9074e0272e3c4663793baf77 (diff)
utlis/ldd: Fix host ldd in case of target wordsize differs from host one
improved solution from http://freetz.org/ticket/842 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Diffstat (limited to 'utils/porting.h')
-rw-r--r--utils/porting.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/porting.h b/utils/porting.h
index f1fdc70aa..f83074111 100644
--- a/utils/porting.h
+++ b/utils/porting.h
@@ -41,6 +41,16 @@
#include "dl-defs.h"
#endif
+/* __WORDSIZE ist used for __ELF_NATIVE_CLASS, which is used for ElfW().
+ We want to provide the wordsize of the target, not of the host, when
+ compiling readelf.host
+ */
+#include <link.h>
+#ifdef ARCH_NATIVE_BIT
+#undef __WORDSIZE
+#define __WORDSIZE ARCH_NATIVE_BIT
+#endif
+
#ifdef DMALLOC
#include <dmalloc.h>
#endif