diff options
Diffstat (limited to 'src/modelops/relocate.c')
-rw-r--r-- | src/modelops/relocate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modelops/relocate.c b/src/modelops/relocate.c index 90a319b..eefed02 100644 --- a/src/modelops/relocate.c +++ b/src/modelops/relocate.c @@ -13,9 +13,9 @@ void elfu_mRelocate(ElfuElf *metarget, ElfuScn *mstarget, ElfuScn *msrt) assert(mstarget); assert(msrt); - ELFU_DEBUG("Relocating in section of type %d size %jx\n", + ELFU_DEBUG("Relocating in section of type %u size %x\n", mstarget->shdr.sh_type, - mstarget->shdr.sh_size); + (unsigned)mstarget->shdr.sh_size); CIRCLEQ_FOREACH(rel, &msrt->reltab.rels, elem) { Elf32_Word *dest32 = (Elf32_Word*)(((char*)(mstarget->data.d_buf)) + rel->offset); @@ -41,12 +41,13 @@ void elfu_mRelocate(ElfuElf *metarget, ElfuScn *mstarget, ElfuScn *msrt) ELFU_DEBUG("Skipping relocation: Unknown type %d\n", rel->type); } } else if (metarget->elfclass == ELFCLASS64) { - /* x86-64 only uses RELA with explicit addend. */ - assert(rel->addendUsed); Elf64_Word a64 = rel->addend; Elf64_Addr p64 = mstarget->shdr.sh_addr + rel->offset; Elf64_Addr s64 = elfu_mSymtabLookupVal(metarget, msrt->linkptr, rel->sym); + /* x86-64 only uses RELA with explicit addend. */ + assert(rel->addendUsed); + switch(rel->type) { case R_X86_64_NONE: ELFU_DEBUG("Skipping relocation: R_386_NONE\n"); |