pkgsrc/devel/bcc/patches/patch-af

48 lines
1.3 KiB
Text

$NetBSD: patch-af,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- ld/writebin.c.orig 1994-02-19 23:37:23.000000000 +0100
+++ ld/writebin.c
@@ -12,6 +12,7 @@ static long bdataoffset;
#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 @@ bool_pt argreloc_output;
linkrefs(symptr->modptr);
needlink = FALSE;
{
- struct redlist *prlptr;
+ struct redlist *prlptr = NULL;
struct redlist *rlptr;
for (rlptr = redfirst; rlptr != NULL;
@@ -478,11 +479,11 @@ bool_pt arguzp;
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,8 +919,12 @@ PRIVATE void writeheader()
#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;
header.a_magic[1] = A_MAGIC1;