Commit 12e3d3f4 authored by morabbin's avatar morabbin Committed by ian@well-typed.com
Browse files

Patch for #7628: improve error message when mixing 32 and 64 bit images (on Mac OS X)

parent 0768ddbd
......@@ -5523,14 +5523,18 @@ ocVerifyImage_MachO(ObjectCode * oc)
#if x86_64_HOST_ARCH || powerpc64_HOST_ARCH
if(header->magic != MH_MAGIC_64) {
errorBelch("%s: Bad magic. Expected: %08x, got: %08x.\n",
oc->fileName, MH_MAGIC_64, header->magic);
errorBelch("Could not load image %s: bad magic!\n"
" Expected %08x (64bit), got %08x%s\n",
oc->fileName, MH_MAGIC_64, header->magic,
header->magic == MH_MAGIC ? " (32bit)." : ".");
return 0;
}
#else
if(header->magic != MH_MAGIC) {
errorBelch("%s: Bad magic. Expected: %08x, got: %08x.\n",
oc->fileName, MH_MAGIC, header->magic);
errorBelch("Could not load image %s: bad magic!\n"
" Expected %08x (32bit), got %08x%s\n",
oc->fileName, MH_MAGIC, header->magic,
header->magic == MH_MAGIC_64 ? " (64bit)." : ".");
return 0;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment