www.digitalmars.com         C & C++   DMDScript  

c++ - Data segment sharing in 32 bits

reply "Rajiv Bhagwat" <dataflow vsnl.com> writes:
Dear Walter,

Here is a request to implement sharing of specifically marked data segments
(instead of marking the entire data sharable), similar to VC implementation.
i.e. Currently, there is no data_seg pramga in DMC. (Or is there?...)

#pragma data_seg(".shared")
int i;
char s[30];
Myclass mc;
#pragma data_seg()

Please comment.
Apr 04 2001
parent reply "Walter" <walter digitalmars.com> writes:
There is currently no mechanism for naming the data segment from the
compiler.

The program patchobj, however, can rename it with:

    patchobj test.obj -l_DATA _SHARED

which will rename the _DATA segment to _SHARED. You can verify this working
with obj2asm. You'll also need to segregate all the data going into _SHARED
into a separate source file.

-Walter

Rajiv Bhagwat wrote in message <9ah1n4$10kj$1 digitaldaemon.com>...
Dear Walter,

Here is a request to implement sharing of specifically marked data segments
(instead of marking the entire data sharable), similar to VC

i.e. Currently, there is no data_seg pramga in DMC. (Or is there?...)

#pragma data_seg(".shared")
int i;
char s[30];
Myclass mc;
#pragma data_seg()

Please comment.

Apr 04 2001
parent reply "Rajiv Bhagwat" <dataflow vsnl.com> writes:
I have 'patchobj' circa 1995, it does not support -I flag. The latest
distribution does not contain a newer version. How can I obtain the proper
version?

Other than that, this looks like a workable solution.
- Rajiv


Walter <walter digitalmars.com> wrote in message
news:9ah3t7$11hs$1 digitaldaemon.com...
 There is currently no mechanism for naming the data segment from the
 compiler.

 The program patchobj, however, can rename it with:

     patchobj test.obj -l_DATA _SHARED

 which will rename the _DATA segment to _SHARED. You can verify this

 with obj2asm. You'll also need to segregate all the data going into

 into a separate source file.

 -Walter

 Rajiv Bhagwat wrote in message <9ah1n4$10kj$1 digitaldaemon.com>...
Dear Walter,

Here is a request to implement sharing of specifically marked data


(instead of marking the entire data sharable), similar to VC

i.e. Currently, there is no data_seg pramga in DMC. (Or is there?...)

#pragma data_seg(".shared")
int i;
char s[30];
Myclass mc;
#pragma data_seg()

Please comment.


Apr 07 2001
parent reply "Walter" <walter digitalmars.com> writes:
Attached.

Rajiv Bhagwat wrote in message <9amgjp$2o2e$1 digitaldaemon.com>...
I have 'patchobj' circa 1995, it does not support -I flag. The latest
distribution does not contain a newer version. How can I obtain the proper
version?

Other than that, this looks like a workable solution.
- Rajiv


Walter <walter digitalmars.com> wrote in message
news:9ah3t7$11hs$1 digitaldaemon.com...
 There is currently no mechanism for naming the data segment from the
 compiler.

 The program patchobj, however, can rename it with:

     patchobj test.obj -l_DATA _SHARED

 which will rename the _DATA segment to _SHARED. You can verify this

 with obj2asm. You'll also need to segregate all the data going into

 into a separate source file.

 -Walter

 Rajiv Bhagwat wrote in message <9ah1n4$10kj$1 digitaldaemon.com>...
Dear Walter,

Here is a request to implement sharing of specifically marked data


(instead of marking the entire data sharable), similar to VC

i.e. Currently, there is no data_seg pramga in DMC. (Or is there?...)

#pragma data_seg(".shared")
int i;
char s[30];
Myclass mc;
#pragma data_seg()

Please comment.



Apr 07 2001
parent "Rajiv Bhagwat" <dataflow vsnl.com> writes:
Thanks!
I made a mistake in reading l_DATA as I_DATA... (The switch is ell not
eye! - The two look exactly identical in Arial.)

Even the old one supports that. I found out after the new one failed on
'eye' also. The results are identical and could be verified by dumpobj.

Thanks again.
- Rajiv

Walter <walter digitalmars.com> wrote in message
news:9amogd$2u9g$1 digitaldaemon.com...
 Attached.

 Rajiv Bhagwat wrote in message <9amgjp$2o2e$1 digitaldaemon.com>...
I have 'patchobj' circa 1995, it does not support -I flag. The latest
distribution does not contain a newer version. How can I obtain the


version?

Other than that, this looks like a workable solution.
- Rajiv


Walter <walter digitalmars.com> wrote in message
news:9ah3t7$11hs$1 digitaldaemon.com...
 There is currently no mechanism for naming the data segment from the
 compiler.

 The program patchobj, however, can rename it with:

     patchobj test.obj -l_DATA _SHARED

 which will rename the _DATA segment to _SHARED. You can verify this

 with obj2asm. You'll also need to segregate all the data going into

 into a separate source file.

 -Walter

 Rajiv Bhagwat wrote in message <9ah1n4$10kj$1 digitaldaemon.com>...
Dear Walter,

Here is a request to implement sharing of specifically marked data


(instead of marking the entire data sharable), similar to VC

i.e. Currently, there is no data_seg pramga in DMC. (Or is there?...)

#pragma data_seg(".shared")
int i;
char s[30];
Myclass mc;
#pragma data_seg()

Please comment.




Apr 07 2001