Revert "linker/mach-o: Catch the case where there is no symCmd"
authorBen Gamari <ben@smart-cactus.org>
Tue, 18 Apr 2017 01:02:07 +0000 (21:02 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 18 Apr 2017 22:57:37 +0000 (18:57 -0400)
This causes validation failures on Windows.

This reverts commit 6c05b27e5bafe9f232e7014f4760335f5e3ba591.

rts/Linker.c
rts/linker/MachO.c

index b214e9c..7366904 100644 (file)
@@ -1215,8 +1215,6 @@ mkOc( pathchar *path, char *image, int imageSize,
    IF_DEBUG(linker, debugBelch("mkOc: start\n"));
    oc = stgMallocBytes(sizeof(ObjectCode), "mkOc(oc)");
 
-   oc->info = NULL;
-
 #  if defined(OBJFORMAT_ELF)
    oc->formatName = "ELF";
 #  elif defined(OBJFORMAT_PEi386)
index e09d151..16b712a 100644 (file)
@@ -130,9 +130,7 @@ ocInit_MachO(ObjectCode * oc)
     oc->info->nlist = oc->info->symCmd == NULL
               ? NULL
               : (MachONList *)(oc->image + oc->info->symCmd->symoff);
-    oc->info->names = oc->info->symCmd == NULL
-              ? NULL
-              : (oc->image + oc->info->symCmd->stroff);
+    oc->info->names = oc->image + oc->info->symCmd->stroff;
 
     /* If we have symbols, allocate and fill the macho_symbols
      * This will make relocation easier.