+#if defined(hp300)
+ switch ((int)exdata.ex_exec.a_mid) {
+
+ /*
+ * An ancient hp200 or hp300 binary, shouldn't happen anymore.
+ * Mark as invalid.
+ */
+ case MID_ZERO:
+ exdata.ex_exec.a_magic = 0;
+ break;
+
+ /*
+ * HP200 series has a smaller page size so we cannot
+ * demand-load or even write protect text, so we just
+ * treat as OMAGIC.
+ */
+ case MID_HP200:
+ exdata.ex_exec.a_magic = OMAGIC;
+ break;
+
+ case MID_HP300:
+ break;
+
+#ifdef HPUXCOMPAT
+ case MID_HPUX:
+ /*
+ * Save a.out header. This is eventually saved in the pcb,
+ * but we cannot do that yet in case the exec fails before
+ * the image is overlayed.
+ */
+ bcopy((caddr_t)&exdata.ex_hexec,
+ (caddr_t)&hhead, sizeof hhead);
+ /*
+ * If version number is 0x2bad this is a native BSD
+ * binary created via the HPUX SGS. Should not be
+ * treated as an HPUX binary.
+ */
+ if (exdata.ex_hexec.ha_version != BSDVNUM)
+ flags |= SHPUX;
+ /*
+ * Shuffle important fields to their BSD locations.
+ * Note that the order in which this is done is important.
+ */
+ exdata.ex_exec.a_text = exdata.ex_hexec.ha_text;
+ exdata.ex_exec.a_data = exdata.ex_hexec.ha_data;
+ exdata.ex_exec.a_bss = exdata.ex_hexec.ha_bss;
+ exdata.ex_exec.a_entry = exdata.ex_hexec.ha_entry;
+ /*
+ * For ZMAGIC files, make sizes consistant with those
+ * generated by BSD ld.
+ */
+ if (exdata.ex_exec.a_magic == ZMAGIC) {
+ exdata.ex_exec.a_text =
+ ctob(btoc(exdata.ex_exec.a_text));
+ nc = exdata.ex_exec.a_data + exdata.ex_exec.a_bss;
+ exdata.ex_exec.a_data =
+ ctob(btoc(exdata.ex_exec.a_data));
+ nc -= (int)exdata.ex_exec.a_data;
+ exdata.ex_exec.a_bss = (nc < 0) ? 0 : nc;
+ }
+ break;
+#endif
+ }
+#endif
+ switch ((int)exdata.ex_exec.a_magic) {