Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-Id: <200001221656.KAA20887@ares.xraylith.wisc.edu> To: cgf AT cygnus DOT com Cc: cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: binmode idea In-Reply-To: Your message of "Sat, 22 Jan 2000 11:35:36 EST." <20000122113536 DOT A18995 AT cygnus DOT com> Date: Sat, 22 Jan 2000 10:56:36 -0600 From: Mumit Khan Chris Faylor writes: > Is there anywhere in an executable header where we could commandeer a 32 > bit word for cygwin's use? I was thinking that we could write a utility > that could set bits in this word which would indicate whether the > default mode was "binmode" for file opens and maybe even other "CYGWIN" > defaults. > > This is not a replacement for DJ's capability idea but it would allow us > to create executables that could be copied from system to system with > no extra setup. > > Mumit, do you know if there is something in an executable that could be > used like this? > > Alternatively, we could add a linker section for this, but that would > require relinking an exeutable to gain the benefit. I looked into this issue for a different purpose a while ago, and came to the conclusion (now I can't remember why of course ;-) that it's better and safer to use a separate section that use one of the unused flags. Of course, I was looking at completely different application, so the conclusion probably doesn't apply here. One option is to add a new data directory item, and use that. See the reference cited below for optional header items in the image files. The other is of course the section idea, which is a very simple one to implement. The third option is to add symbol (ala .gcc_compiled) that is not to be stripped away. The PE-COFF specs are online if you have MSDN (or from MS web site). Search for "Microsoft Portable Executable and Common Object File Format Specification". On the net: http://msdn.microsoft.com/library/specs/msdn_pecoff.htm Disclaimer -- I looked into this issue a long time ago, and for a very different purpose, so there is always the possibility that my conclusion doesn't apply in this case. I seem to have missed DJ's capability idea. References? Regards, Mumit