From 3dc05ee387fcdc190191f9fe00cca2560b1dfab9 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sun, 25 Feb 2018 10:41:09 +0000 Subject: [PATCH] WIP: Include symbol name in relocation error Need some kind of check on the length of ptr->name (cf. cannot_resolve_msg) --- flexdll.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flexdll.c b/flexdll.c index e34af5d..ac5d24c 100644 --- a/flexdll.c +++ b/flexdll.c @@ -371,8 +371,8 @@ static void relocate(resolver f, void *data, reloctbl *tbl, void **jmptbl, err_t retry: if (s != (INT32) s) { if (!jmptbl) { - sprintf(err->message, "flexdll error: cannot relocate RELOC_%s, target is too far: %p %p", - reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s)); + sprintf(err->message, "flexdll error: cannot relocate %s RELOC_%s, target is too far: %p %p", + ptr->name, reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s)); err->code = 3; return; } @@ -380,8 +380,8 @@ static void relocate(resolver f, void *data, reloctbl *tbl, void **jmptbl, err_t void* trampoline; /* trampolines cannot be created for data */ if (VirtualQuery(sym->addr, &info, sizeof(info)) && !(info.Protect & 0xf0)) { - sprintf(err->message, "flexdll error: cannot relocate RELOC_%s, target is too far, and not executable: %p %p", - reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s)); + sprintf(err->message, "flexdll error: cannot relocate %s RELOC_%s, target is too far, and not executable: %p %p", + ptr->name, reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s)); err->code = 3; return; }