Skip to content

Commit 3dc05ee

Browse files
committed
WIP: Include symbol name in relocation error
Need some kind of check on the length of ptr->name (cf. cannot_resolve_msg)
1 parent 20599e3 commit 3dc05ee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

flexdll.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,17 +371,17 @@ static void relocate(resolver f, void *data, reloctbl *tbl, void **jmptbl, err_t
371371
retry:
372372
if (s != (INT32) s) {
373373
if (!jmptbl) {
374-
sprintf(err->message, "flexdll error: cannot relocate RELOC_%s, target is too far: %p %p",
375-
reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s));
374+
sprintf(err->message, "flexdll error: cannot relocate %s RELOC_%s, target is too far: %p %p",
375+
ptr->name, reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s));
376376
err->code = 3;
377377
return;
378378
}
379379
if (!sym->trampoline) {
380380
void* trampoline;
381381
/* trampolines cannot be created for data */
382382
if (VirtualQuery(sym->addr, &info, sizeof(info)) && !(info.Protect & 0xf0)) {
383-
sprintf(err->message, "flexdll error: cannot relocate RELOC_%s, target is too far, and not executable: %p %p",
384-
reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s));
383+
sprintf(err->message, "flexdll error: cannot relocate %s RELOC_%s, target is too far, and not executable: %p %p",
384+
ptr->name, reloc_type, (void *)((UINT_PTR) s), (void *) ((UINT_PTR)(INT32) s));
385385
err->code = 3;
386386
return;
387387
}

0 commit comments

Comments
 (0)