[comp.unix.i386] shared text on ESIX?

ade@clark.uucp (Adrian Miranda) (07/04/90)

I believe that shared text means that if a program is invoked more
than once, there will only be one copy of it in memory. 
Does ESIX (or any version of UNIX for the 386) support this?  If
so, are any special options to the compiler needed to get it?

Adrian Miranda
uunet!clark!ade

cpcahil@virtech.uucp (Conor P. Cahill) (07/04/90)

In article <1990Jul4.070251.7143@clark.uucp> ade@clark.uucp (Adrian Miranda) writes:
>I believe that shared text means that if a program is invoked more
>than once, there will only be one copy of it in memory. 
>Does ESIX (or any version of UNIX for the 386) support this?  If
>so, are any special options to the compiler needed to get it?

ALL current unix systems (BSD and System V) share text segments without
needing any special compiler options.  NOTE that only the text segments
are shared.  Data segments are not shared.

For example "size /bin/sh" reports: 46692 + 4076 + 1036 = 51804
This tells me that 46K is shared text, and the rest (5K) is not shared date.
Yet another note: size only reports base text and size requirements, it does
not include any other memory that will be used by the program like malloc
space, shared memory, etc.

There are some systems that turn "shared text" off if the executable has
been loaded with the -g flag (this is the mechanism that those systems
use to allow the text section to be written when setting breakpoints).  The
386 Unix packages are not in this group.

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170