int i;
Elf64_Ehdr *hdr = Base;
Elf64_Phdr *phtab;
- Elf64_Dyn *dyntab;
+ Elf64_Dyn *dyntab = NULL;
Elf64_Addr compiledBase = -1, baseDiff;
Elf64_Sym *symtab = NULL;
char *strtab = NULL;
DEBUGS("Elf64Relocate: e_phnum = %i", hdr->e_phnum);
// Scan for the dynamic table (and find the compiled base)
- phtab = Base + hdr->e_phoff;
+ phtab = (void*)((uintptr_t)Base + (uintptr_t)hdr->e_phoff);
for( i = 0; i < hdr->e_phnum; i ++ )
{
if(phtab[i].p_type == PT_DYNAMIC)
break;
case R_X86_64_COPY: {
size_t size;
- void *sym = GetSymbol(symname, &size);
- memcpy(ptr, sym, size);
+ void *symptr = GetSymbol(symname, &size);
+ memcpy(ptr, symptr, size);
} break;
case R_X86_64_GLOB_DAT:
*(uint64_t*)ptr = (uintptr_t)GetSymbol(symname, NULL);
int j;
// Locate the tables
- phtab = (void*)( (intptr_t)Base + hdr->e_phoff );
+ phtab = (void*)( (intptr_t)Base + (uintptr_t)hdr->e_phoff );
for( i = 0; i < hdr->e_phnum; i ++ )
{
if(phtab[i].p_type == PT_LOAD && iBaseDiff > phtab[i].p_vaddr)