X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2Felf_load.c;h=d661622e37075e927351f0ce4db56f6a36f0037e;hb=590ae24e57553f79a92d6ef52c0468c07aa5de22;hp=590da3774dcbfb1cdd68dcab73a39c094d3f4077;hpb=d497ef38c1c1e0aa5467722e115be0dc4baa47ab;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/elf_load.c b/AcessNative/ld-acess_src/elf_load.c index 590da377..d661622e 100644 --- a/AcessNative/ld-acess_src/elf_load.c +++ b/AcessNative/ld-acess_src/elf_load.c @@ -3,11 +3,12 @@ * * ELF Executable Loader Code */ -#define DEBUG 1 +#define DEBUG 0 #include #include #include #include +#include // PRIx64 #include "common.h" #include "elf32.h" #include "elf64.h" @@ -190,9 +191,9 @@ void *Elf64Load(int FD, Elf64_Ehdr *hdr) ENTER("iFD", FD); - #if BITS <= 32 - Warning("ELF64 being loaded in 32-bit env, this may not work"); - #endif + if( sizeof(void*) == 4) { + Warning("ELF64 being loaded in 32-bit env, this may not work"); + } // Check for a program header if(hdr->e_phoff == 0) { @@ -288,8 +289,8 @@ void *Elf64Load(int FD, Elf64_Ehdr *hdr) addr = phtab[i].p_vaddr + baseDiff; if( AllocateMemory( addr, phtab[i].p_memsz ) ) { - fprintf(stderr, "Elf_Load: Unable to map memory at %llx (0x%llx bytes)\n", - (long long)addr, (long long)phtab[i].p_memsz); + fprintf(stderr, "Elf_Load: Unable to map memory at %"PRIx64" (0x%"PRIx64" bytes)\n", + (uint64_t)addr, (uint64_t)phtab[i].p_memsz); free( phtab ); return NULL; }