Fix null pointer deref that caused build failures on Solaris
[fw/sdcc] / src / ds390 / main.c
index 10bae81765cebedab90dfa0819552c48a7749b76..c7e55f4de2d91c3356f430050898aa365b36125c 100644 (file)
@@ -118,6 +118,10 @@ _ds390_parseOptions (int *pargc, char **argv, int *i)
 static void
 _ds390_finaliseOptions (void)
 {
+  if (options.noXinitOpt) {
+    port->genXINIT=0;
+  }
+
   /* Hack-o-matic: if we are using the flat24 model,
    * adjust pointer sizes.
    */
@@ -230,7 +234,7 @@ _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
       return FALSE;
     }
 
-  fprintf (of, "\tajmp\t__sdcc_gsinit_startup\n");
+  fprintf (of, "\tajmp\t__reset_vect\n");
 
   /* now for the other interrupts */
   for (i = 0; i < maxInterrupts; i++)
@@ -245,6 +249,8 @@ _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
        }
     }
 
+  fprintf (of, "__reset_vect:\n\tljmp\t__sdcc_gsinit_startup\n");
+
   return TRUE;
 }
 
@@ -506,7 +512,7 @@ static void _tininative_genAssemblerEnd (FILE * of)
     fputs("\tend\n",of);
 }
 /* tininative assembler , calls "macro", if it succeeds calls "a390" */
-static void _tininative_do_assemble (const char * const *asmOptions)
+static void _tininative_do_assemble (set *asmOptions)
 {
     static const char *macroCmd[] = {
        "macro","$1.a51",NULL