pcc shared string question

dan at msdc.UUCP dan at msdc.UUCP
Thu Jul 26 06:28:08 AEST 1984


I have a family of libraries that have bunches of embedded
double-quoted strings (about 30KB or so).  What I want to do is arrange
to put all the strings in shared text space (we're running 4.Xbsd on
VAXen).  Since the "xstr" stuff is cumbersome with this much code, what
I think I want is something on the order of the "-R" assembler option
for just initialized strings.

After perusing the "pcc" code, and examining reams of assembly output,
it seems to me that double-quoted strings are output into data segments
1 and 2, while static data declarations go in segment 0.  Thus, it
looks like I can add an option to "ccom" (and "cc") that affects only
the STRNG and ISTRNG cases in "locctr()".  When set, it causes the
generation of ".text 1" and ".text 2" in place of ".data 1" and ".data
2" respectively.  (I could also do this with the old "asm.sed" trick,
but I don't think I want to rewrite all the Makefiles.)

My question is thus directed at all the "pcc" wizards out there:  None
of the libraries ever modify double-quoted literals, but they do modify
static data (which should still appear under data segment 0).  I'm not
all that concerned about portability, since on other machines all that
will happen is that the programs will get bigger again.  So, what kind
of trouble am I buying here?  What have I missed?

Dan Forsyth  (akgua!gatech!msdc!dan, duke!mcnc!msdc!dan)
Medical Systems Development Corporation, Atlanta, GA



More information about the Comp.unix.wizards mailing list