From: ian AT cygnus DOT com (Ian Lance Taylor) Subject: Re: "SHARED" attribute on section in .DLL? 23 Feb 1998 10:00:06 -0800 Message-ID: <199802231757.MAA09496.cygnus.cygwin32.developers@subrogation.cygnus.com> References: To: cgf AT bbc DOT com Cc: cygwin32-developers AT cygnus DOT com 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