summaryrefslogtreecommitdiff
path: root/ldso/util/readelf.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-08 14:28:47 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-08 14:28:47 +0000
commit4c69b9f793fc1eae9190d8ba26dba25db616272f (patch)
tree0029a765f3402cdbef9bb2f384c8a067e1ed17c0 /ldso/util/readelf.c
parente3787b675f1a369697d97ba8e65bf6ba80ace51d (diff)
Patch from Stefan Allius and Edie C. Dost to let ldd and
readelf compile under solaris.
Diffstat (limited to 'ldso/util/readelf.c')
-rw-r--r--ldso/util/readelf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ldso/util/readelf.c b/ldso/util/readelf.c
index 98df3ffda..bb8aa26fd 100644
--- a/ldso/util/readelf.c
+++ b/ldso/util/readelf.c
@@ -36,8 +36,8 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <endian.h>
-#include <byteswap.h>
+
+#include "bswap.h"
#include "elf.h"
@@ -84,7 +84,7 @@ void * elf_find_dynamic(int const key, Elf32_Dyn *dynp,
for (; DT_NULL!=byteswap32_to_host(dynp->d_tag); ++dynp) {
if (key == byteswap32_to_host(dynp->d_tag)) {
if (return_val == 1)
- return (void *)byteswap32_to_host(dynp->d_un.d_val);
+ return (void *)(intptr_t)byteswap32_to_host(dynp->d_un.d_val);
else
return (void *)(byteswap32_to_host(dynp->d_un.d_val) - tx_reloc + (char *)ehdr );
}
@@ -339,7 +339,7 @@ foo:
dynsec = elf_find_section_type(SHT_DYNAMIC, ehdr);
if (dynsec) {
- dynamic = (Elf32_Dyn*)(byteswap32_to_host(dynsec->sh_offset) + (int)ehdr);
+ dynamic = (Elf32_Dyn*)(byteswap32_to_host(dynsec->sh_offset) + (intptr_t)ehdr);
dynstr = (char *)elf_find_dynamic(DT_STRTAB, dynamic, ehdr, 0);
list_needed_libraries(dynamic, dynstr);
}