This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: binmode idea
- To: cgf at cygnus dot com
- Subject: Re: binmode idea
- From: Mumit Khan <khan at NanoTech dot Wisc dot EDU>
- Date: Sat, 22 Jan 2000 10:56:36 -0600
- Cc: cygwin-developers at sourceware dot cygnus dot com
Chris Faylor <cgf@cygnus.com> 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