summaryrefslogtreecommitdiff
path: root/src/modelops/relocate.c
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2013-06-17 23:34:30 +0100
committernorly <ny-git@enpas.org>2013-06-17 23:39:12 +0100
commitf88e1ad7d9db8a41abecc795200f21138af65c74 (patch)
treedc17e6153ae6ee4678b39f365f8c9d9b28bdde43 /src/modelops/relocate.c
parent150d0c42d423fe49304d648e2c19ff08f6c2e0ad (diff)
C90 compliance, except variadic macros and TODOs
Also removed a lot of dead code from the early days.
Diffstat (limited to 'src/modelops/relocate.c')
-rw-r--r--src/modelops/relocate.c9
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");