Mail Archives: cygwin-developers/1998/02/23/10:00:06
From: cgf AT bbc DOT com (Christopher Faylor)
Date: Mon, 23 Feb 1998 03:52:13 GMT
It mentions that data can be shared between dlls if a dll puts data
that is intended to be shared in a section which has a "shared" attribute.
The book claims that sections can have the following attributes:
READ, WRITE, EXECUTE, SHARED.
Does anyone know if that is possible to do with ld? If it is, we
could probably get rid of some of the shared memory initialization and
store the process table here.
I looked through the sources but didn't see anything that was immediately
obvious.
No, the linker doesn't support this at present.
It looks through the .drectve section in process_embedded_commands in
bfd/cofflink.c. You can see it set had_shared, but it never does
anything with it.
I expect that the right thing to do is to eventually set the
IMAGE_SCN_MEM_SHARED flag on the output section. That flags, and
others like it, are set in the coff_swap_scnhdr_out function in
bfd/peicode.h. However, I haven't tried to test this.
I don't know whether using a SHARED section is any more efficient than
calling OpenFileMapping and MapViewOfFileEx, but it might be.
Ian
- Raw text -