Mail Archives: cygwin/1998/05/26/14:20:41
In article <19980525140222 DOT 28006 DOT cygnus DOT gnu-win32 AT murlibobo DOT cs DOT mu DOT OZ DOT AU>,
Fergus Henderson <fjh AT cs DOT mu DOT OZ DOT AU> wrote:
>On 23-May-1998, Steve Biskis <mlx AT san DOT rr DOT com> wrote:
>> I don't know if the Gnu/Cygnus development environment
>> supports this but the MS prescribed way to change the
>> default behavior of globals so that they may be shared
>> by all attached processes is to add a directive like the
>> following to your DLL's entry module:
>>
>> #pragma data_seg( ".GLOBALS" )
>> int nProcesses =0;
>> int nThreads =0;
>> #pragma data_seg()
>
>The gcc equivalent of this would be
>
> int nProcesses __attribute__((section(".GLOBALS")) = 0;
> int nThreads __attribute__((section(".GLOBALS")) = 0;
>
>However, I have no idea whether this works.
I don't believe that it does. Currently, the linker becomes confused
by sections that are "non-standard". Adding something like the above
would probably result in an invalid format for your .dll or .exe.
Incidentally, to make this sharable you'd also have to mark the segment
as sharable in some way. There is currently no way to do that using
cygwin tools.
--
cgf AT cygnus DOT com "Everything has a boolean value, if you stand
http://www.cygnus.com/ far enough away from it." -- Galena Alyson Canada
- Raw text -