putting stuff in the text segment

Jeffrey E. F. Friedl jeff at unh.UUCP
Sat May 28 19:52:22 AEST 1988


In article <688 at vsi.UUCP>, friedl at vsi.UUCP (Stevie J. Friedl) writes:
> In article <523 at unh.UUCP>, jeff at unh.UUCP (Jeffrey E. F. Friedl) writes:
> > In article <3813 at lynx.UUCP>, m5 at lynx.UUCP (Mike McNally) writes:
> > > [How to put data in the text segment?]
> > 
> > [...]
> 
> > If you're using BSD at least, you can just compile the code where the
> > initialized data is with the -R flag, which is passed to the assembler
> > and indicates that all ".data" directives should be ".text".
> 
> Be careful with this: as I recall, *all* initialized statics go
> into the .text and are readonly.  This means that:
> 
> [valid example deleted]

Exactly. That's why (if you continue reading my previous posting), I say
that when compiling normal code (as opposed to static initialized data)
you get lots of grief.  If those large tables are put into a separate
file (I usually have large static tables in separate files anyway), then
that file only could be compiled with the -R flag.  Other files, of course,
won't be affected.

-------------------------------------------------------------------------------
Jeffrey Eric Francis Friedl, Box 2146 Babcock House, Durham New Hampshire 03824
..!{uunet,decvax}!unh!jeff   BITNET%"j_friedl at unhh"  ..!ucbvax!kentvax!jfriedl

I hope I'm not around Jan 18, 2038 at 10:14:08PM

(friedl at vsi is my brother, and he's proud of it).



More information about the Comp.lang.c mailing list