Memory Violation With Windres and Shared Data Segments

Mumit Khan khan@xraylith.wisc.EDU
Tue Aug 31 23:49:00 GMT 1999

Mumit Khan <khan@xraylith.wisc.EDU> writes:
> I did look at it a bit, and here's what's needs to be done:
>   - bfd (binutils): Need to be able to specify a shared flag for sections.
>     That part is somewhat easy.
>   - gas (binutils): Need to be able parse section flags containing shared
>     flag. Also easy.
>   - gcc: Somehow we need to be able to tell the compiler about this "shared"
>     link. MSVC does it with a linker comment, but GCC doesn't have such
>     a facility directly. It's going to take a bit of work. I might add
>     an __attribute__((shared)), but haven't thought of the other
>     possibilities yet.

Just to let you folks know, I just submitted patches to both binutils and
gcc to make this happen.

In the future, you'll be able to do this:
  int __attribute__((section ("shared"), shared)) foo = 0;
  main ()
    /* do stuff to foo. */
    return 0;

and all running copies of the executable will share ``foo''.

Anyone who wants to test it, let me know. I have updated copies of 
binutils-2.9.4 and gcc-2.95 binaries that you can put somewhere,
and use the -B<prefix>/ argument to test it.


Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list