$NetBSD: patch-af,v 1.2 1998/08/07 10:40:21 agc Exp $ --- ld/writebin.c.orig Sat Feb 19 16:37:23 1994 +++ ld/writebin.c Thu Jul 16 16:57:56 1998 @@ -12,6 +12,7 @@ #else # ifdef BSD_A_OUT # ifdef STANDARD_GNU_A_OUT +# include # include # define RELOC_INFO_SIZE 8 /* unportable bitfields - bcc doesn't pack */ # else @@ -174,7 +175,7 @@ linkrefs(symptr->modptr); needlink = FALSE; { - struct redlist *prlptr; + struct redlist *prlptr = NULL; struct redlist *rlptr; for (rlptr = redfirst; rlptr != NULL; @@ -478,11 +479,11 @@ extsym.n_was_sclass = C_EXT; else extsym.n_was_sclass = C_STAT; - if (!(flags & I_MASK) || + if (!(flags & I_MASK) || ( #ifdef BSD_A_OUT !reloc_output && #endif - flags & C_MASK) + flags & C_MASK)) switch (flags & (A_MASK | SEGM_MASK)) { case 0: @@ -918,7 +919,11 @@ #ifdef N_SET_MAGIC N_SET_MAGIC(header, OMAGIC); #else +#ifdef N_SETMAGIC + N_SETMAGIC(header,OMAGIC,MID_I386,0); +#else *(unsigned short *) &header.a_magic = OMAGIC; /* XXX - works for 386BSD */ +#endif #endif #else header.a_magic[0] = A_MAGIC0;