Path: utzoo!attcan!uunet!unh!jeff From: jeff@unh.UUCP (Jeffrey E. F. Friedl) Newsgroups: comp.lang.c Subject: Re: putting stuff in the text segment Summary: "problems" with cc's "-R" Message-ID: <524@unh.UUCP> Date: 28 May 88 09:52:22 GMT References: <3813@lynx.UUCP> <523@unh.UUCP> <688@vsi.UUCP> Distribution: na Organization: University of New Hampshire, Durham, NH Lines: 30 In article <688@vsi.UUCP>, friedl@vsi.UUCP (Stevie J. Friedl) writes: > In article <523@unh.UUCP>, jeff@unh.UUCP (Jeffrey E. F. Friedl) writes: > > In article <3813@lynx.UUCP>, m5@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@unhh" ..!ucbvax!kentvax!jfriedl I hope I'm not around Jan 18, 2038 at 10:14:08PM (friedl@vsi is my brother, and he's proud of it).