From: Steve Simon <steve.simon@sn...> - 2011-05-04 14:48:55
Here is my problem:
I want to compile a large swathe of existing code into a DLL
and I don't want to add __attribute__((section(".shr"), shared)) to,
(and initialise) every static variable so they get put into the
shared segment in the executable.
This code has its own locking (via tas) so it should be thread safe.
I want to switch the default data segment to .shr rather than .data, is
I can see no command line option for gcc. Under Visual C (yes I know) I could
use #pragma comment(linker, "/section:.shared,rws") in my header file and
everything following (not just one variable) is shared.
I also understand that I am walking on thin ice WRT the DLL being relocated
and my varibles all changing address in one of the attached instances. I can live
with this and will abort if this happens.
My guess the correct way to do this is in the linker directive file but that
appears to be a maze of twisty passages I cannot fathom.
Thanks for any help people.
This email and any attachments are confidential, may be legally privileged and are intended for the use of the addressee only. If you are not the intended recipient, please note that any use, disclosure, printing or copying of this email is strictly prohibited and may be unlawful. If received in error, please delete this email and any attachments and confirm this to the sender.
Snell Limited, registered number 1160119
Registered in England, registered office at Hartman House, Danehill, Lower Earley, Reading, Berkshire RG6 4PB