This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [HEADSUP] Please try to build your packages for 64 bit


Hi Achim,

On Apr 19 20:00, Achim Gratz wrote:
> Corinna Vinschen writes:
> > the 64 bit Cygwin seems to be quite stable now.  We're still suffering
> > from a gcc problem which seems to affect C++ inline methods using
> > templates, so some C++ packages might not be buildable yet(*), but other
> > than that it looks pretty good.
> 
> I'll update my 64bit installation over the weekend and build my
> packages.  While upx builds and works fine with 64bit, it doesn't handle
> the PE+ executable format, so it is unfortunately useless for 64bit
> executables.  Is there any documentation how this format differs from
> the PE format so that I might look into adding support for 64bit when
> time permits?

Strange that nobody did it so far.  It should be rather trivial,
actually.  The only noticable difference between PE and PE+ are a few
different values in some of the header fields and the slightly different
layout of the IMAGE_OPTIONAL_HEADER structure.

For the different values in IMAGE_FILE_HEADER(*), note the fields

- Machine (IMAGE_FILE_MACHINE_AMD64 instead of IMAGE_FILE_MACHINE_I386)
- Characteristics (No IMAGE_FILE_32BIT_MACHINE flag)

in IMAGE_OPTIONAL_HEADER(**), see

- Magic (IMAGE_NT_OPTIONAL_HDR64_MAGIC vs. IMAGE_NT_OPTIONAL_HDR32_MAGIC)
- SizeOfHeaders (don't know the right values off the top of my head here)

As for the different IMAGE_OPTIONAL_HEADER structure layout:

- BaseOfData has been removed
- ImageBase, SizeOfStackReserve, SizeOfStackCommit, SizeOfHeapReserve,
  and SizeOfHeapCommit are 8 byte values now.

I don't know how upx works under the hood, but I assume you also need
the unpacker code in 64 bit.  If it's not written in assembler, the
32 bit code should more or less do the right thing already.


Corinna


(*) http://msdn.microsoft.com/en-us/library/windows/desktop/ms680313%28v=vs.85%29.aspx
(**) http://msdn.microsoft.com/en-us/library/windows/desktop/ms680339%28v=vs.85%29.aspx

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]