Ticket #7628: 0001-Patch-for-7628-improve-error-message-when-mixing-32-.patch

File 0001-Patch-for-7628-improve-error-message-when-mixing-32-.patch, 1.4 KB (added by morabbin, 3 years ago)

Patch for #7628

  • rts/Linker.c

    From f17a897f91a18983772cd6383cb5529dd2ca1711 Mon Sep 17 00:00:00 2001
    From: Andy Adams-Moran <[email protected]>
    Date: Fri, 25 Jan 2013 11:11:01 -0800
    Subject: [PATCH] Patch for #7628: improve error message when mixing 32 and 64
     bit images (on Mac OS X)
    
    ---
     rts/Linker.c | 12 ++++++++----
     1 file changed, 8 insertions(+), 4 deletions(-)
    
    diff --git a/rts/Linker.c b/rts/Linker.c
    index b97a30c..39b7897 100644
    a b ocVerifyImage_MachO(ObjectCode * oc) 
    55235523
    55245524#if x86_64_HOST_ARCH || powerpc64_HOST_ARCH
    55255525    if(header->magic != MH_MAGIC_64) {
    5526         errorBelch("%s: Bad magic. Expected: %08x, got: %08x.\n",
    5527                    oc->fileName, MH_MAGIC_64, header->magic);
     5526        errorBelch("Could not load image %s: bad magic!\n"
     5527                   "  Expected %08x (64bit), got %08x%s\n",
     5528                   oc->fileName, MH_MAGIC_64, header->magic,
     5529                   header->magic == MH_MAGIC ? " (32bit)." : ".");
    55285530        return 0;
    55295531    }
    55305532#else
    55315533    if(header->magic != MH_MAGIC) {
    5532         errorBelch("%s: Bad magic. Expected: %08x, got: %08x.\n",
    5533                    oc->fileName, MH_MAGIC, header->magic);
     5534        errorBelch("Could not load image %s: bad magic!\n"
     5535                   "  Expected %08x (32bit), got %08x%s\n",
     5536                   oc->fileName, MH_MAGIC, header->magic,
     5537                   header->magic == MH_MAGIC_64 ? " (64bit)." : ".");
    55345538        return 0;
    55355539    }
    55365540#endif