This is the mail archive of the
mailing list for the binutils project.
Re: objcopy --set-section-flags .data=alloc,load,data,share
> I was suspecting this. Can you briefly explain what the "share"
> section flag does in formats that support it?
It is only supported by PE, where it corresponds to the
IMAGE_SCN_MEM_SHARED flag. Microsoft's documentation says it means
"section can be shared in memory." That is all I know about it.
> What I am trying to
> achieve is a shared copy-on-write section, which I know I pretty
> much impossible on standard UNIX but nevertheless... The idea is to
> have the .data of one process be accessible from another process,
> with copied-on-write pages notwithstanding. To do that, the kernel's
> loader needs to distinguish these "copy-on-write shared" sections
> from normal ones, hence my question.
It's presumably not what you are after, but you can construct
something along these lines using mmap() with MAP_SHARED and