Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com List-Unsubscribe: List-Archive: List-Help: , Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199908061455.JAA05593@mercury.xraylith.wisc.edu> To: cygwin AT sourceware DOT cygnus DOT com cc: Harold Weissfield Subject: Re: Memory Violation With Windres and Shared Data Segments In-Reply-To: Your message of "Fri, 06 Aug 1999 11:53:22 EDT." <19990806115322 DOT B6826 AT cygnus DOT com> Date: Fri, 06 Aug 1999 09:55:30 -0500 From: Mumit Khan Chris Faylor writes: > On Fri, Aug 06, 1999 at 02:57:23PM +0000, Harold Weissfield wrote: > >On a different note, I have been searching through the documentation for GCC > > >for information on how to created a shared data segment in a DLL, but so far > > >have been unable to come up with anything. Under Visual C++, this was done > >with a #pragma comment(linker, "-section:Shared,rws") and then a #pragma > >data_seg("Shared"). Is there any equivalent construct in GCC? > I don't think that there is a way to do this currently with gcc/binutils tool > s, > unfortunately. I used to use Visual C tools to make a section sharable when > I needed to do this. You can create these named sections, but there is a bug the linker that causes these sections to be readonly. I fixed this in the development sources a while back, so the next release will work as expected. However, I don't what the exact semantics of this "shared" segment is, but if it's just a named section like .tls (thread local storage), then it should work fine. The construct is like this: int foo __attribute__((section("shared"))) = 0; now the *initialized* variable `foo' goes into a special section `shared'; the `shared' section should be marked r/w, but currently GNU binutils will mark it readonly due to a tiny bug. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com