From 030352e9d4932325543779b0fdf9c68f3ed8ccd4 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Sat, 16 Aug 1980 22:00:07 -0800 Subject: [PATCH] -R SCCS-vsn: old/as.vax/as.h 4.5 SCCS-vsn: old/as.vax/assyms.c 4.3 --- usr/src/old/as.vax/as.h | 3 ++- usr/src/old/as.vax/assyms.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/usr/src/old/as.vax/as.h b/usr/src/old/as.vax/as.h index ef84371180..e3907f4f9e 100644 --- a/usr/src/old/as.vax/as.h +++ b/usr/src/old/as.vax/as.h @@ -1,5 +1,5 @@ /* Copyright (c) 1980 Regents of the University of California */ -/* "@(#)as.h 4.4 %G%" */ +/* "@(#)as.h 4.5 %G%" */ #ifdef VMS # define vax 1 # define VAX 1 @@ -389,6 +389,7 @@ struct Quad { extern int orgwarn; /* questionable origin ? */ extern int useVM; /*use virtual memory temp file*/ extern int jxxxJUMP; /*use jmp instead of brw for jxxx */ + extern int readonlydata; /*initialized data into text space*/ #ifdef DEBUG extern int debug; extern int toktrace; diff --git a/usr/src/old/as.vax/assyms.c b/usr/src/old/as.vax/assyms.c index a4cedb9259..1d9d9b7731 100644 --- a/usr/src/old/as.vax/assyms.c +++ b/usr/src/old/as.vax/assyms.c @@ -1,5 +1,5 @@ /* Copyright (c) 1980 Regents of the University of California */ -static char sccsid[] = "@(#)assyms.c 4.2 %G%"; +static char sccsid[] = "@(#)assyms.c 4.2 8/15/80"; #include #include #include "as.h" @@ -544,7 +544,7 @@ outrel(pval,reftype,reltype,xsym) if (reltype != XABS || reftype & PCREL) { reloc = (reftype & PCREL)? r_can_1PC : r_can_0PC; reloc.r_address = dotp->e_xvalue - - ( (dotp < &usedot[NLOC]) ? 0 : datbase ); + ( (dotp < &usedot[NLOC] || readonlydata) ? 0 : datbase ); reloc.r_length = lgreflen[reftype]; switch(reltype){ case XXTRN | XUNDEF: @@ -552,6 +552,8 @@ outrel(pval,reftype,reltype,xsym) reloc.r_extern = 1; break; default: + if (readonlydata && (reltype&~XXTRN) == XDATA) + reltype = XTEXT | (reltype&XXTRN); reloc.r_symbolnum = reltype; break; } @@ -676,6 +678,8 @@ int symwrite(symfile) } #endif sp->s_type = (sp->s_ptype != 0) ? sp->s_ptype : (sp->s_type & (~XFORW)); + if (readonlydata && (sp->s_type&~N_EXT) == N_DATA) + sp->s_type = N_TEXT | (sp->s_type & N_EXT); bwrite(&sp->s_nm, sizeof (struct nlist), symfile); #ifdef FLEXNAMES sp->s_name = name; /* restore pointer */ -- 2.20.1