Fix powerpc64 cross build.

This commit is contained in:
Markus F.X.J. Oberhumer 2018-01-19 14:33:31 +01:00
parent 16bb7ab841
commit 05e44b9644
3 changed files with 9 additions and 3 deletions

View File

@ -140,6 +140,7 @@ int FileBase::read(void *buf, int len)
{
if (!isOpen() || len < 0)
throwIOException("bad read");
mem_size_assert(1, len); // sanity check
errno = 0;
long l = acc_safe_hread(_fd, buf, len);
if (errno)
@ -161,6 +162,7 @@ void FileBase::write(const void *buf, int len)
{
if (!isOpen() || len < 0)
throwIOException("bad write");
mem_size_assert(1, len); // sanity check
errno = 0;
long l = acc_safe_hwrite(_fd, buf, len);
if (l != len)

View File

@ -215,9 +215,14 @@
#ifdef WANT_REL_ENUM //{
static unsigned ELF32_R_TYPE(unsigned x) { return 0xff & x; }
static unsigned ELF64_R_TYPE(upx_uint64_t x) { return 0xffffffff & x; }
#undef WANT_REL_ENUM
static inline unsigned ELF32_R_TYPE(unsigned x) { return 0xff & x; }
static inline unsigned ELF64_R_TYPE(upx_uint64_t x) { return 0xffffffff & (unsigned)x; }
# undef R_PPC_RELATIVE
# undef R_PPC64_RELATIVE
# undef R_PPC_JMP_SLOT
# undef R_PPC64_JMP_SLOT
enum { // relocation types
R_386_RELATIVE = 8,
R_AARCH64_RELATIVE = 1027,

View File

@ -2507,7 +2507,6 @@ PackLinuxElf64::generateElfHdr(
#define WANT_REL_ENUM
#include "p_elf_enum.h"
#undef WANT_REL_ENUM
void PackLinuxElf32::pack1(OutputFile *fo, Filter & /*ft*/)
{