objcopy --set-section-flags .data=alloc,load,data,share

peter.kourzanov@xs4all.nl peter.kourzanov@xs4all.nl
Thu Nov 11 16:00:00 GMT 2004


  Ian,

  I was suspecting this. Can you briefly explain what the "share"
section flag does in formats that support 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.

  Pjotr.


On Thu, Nov 11, 2004 at 10:21:48AM -0500, Ian Lance Taylor wrote:
> <peter.kourzanov@xs4all.nl> writes:
> 
> >   I've got a question about semantics of the "share" section flag
> > in objcopy. It seems not be documented anywhere and all links I
> > could google up refer to COFF binaries, with unexplained semantics
> > as well. Is there a possibility to mark a "shared" section in ELF,
> > so that OS's that need it can map the section as shared?
> 
> The "share" section flag can not be represented in ELF.
> 
> I'm not sure exactly what you mean by "map the section as shared," but
> the answer is probably no: there is no way to do that in ELF.  Note
> that typical ELF systems will automatically share read-only text
> segments.
> 
> Ian
> 



More information about the Binutils mailing list