summaryrefslogtreecommitdiff
path: root/devel/bcc/patches/patch-af
blob: 614e4d245abde350d2c3ac1fceadbe98cfa0cce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$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 <sys/types.h>
 #   include <a.out.h>
 #   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;