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: a.out.h for 64-bit Cygwin?

On Mar  9 22:43, Ken Brown wrote:
> It may be too soon to expect this to work, but I'm trying to build
> emacs for 64-bit Cygwin.  Part of the build process involves direct
> manipulation of a .exe file, based on the structures defined in
> /usr/include/a.out.h.  I'm wondering whether this file needs to be
> updated before it will work with 64-bit .exe files.

Yes, absolutely!

It's not very tricky.  AFAIK only a single header part is different, the
one called IMAGE_OPTIONAL_HEADER in MSDN.  Given the age of a.out.h,
there are also a couple of defines missing, all of them are documented
in MSDN and available in the Mingw headers.  Patches most welcome.  

> I'm appending below some excerpts from the code that produce lots of
> assertion failures when I try to build emacs.  Suggestions for
> fixing this would be appreciated.
> I can give more details, but I thought I'd start by just making sure
> I have a reasonable a.out.h to work with.  Also, I suspect that some
> of the magic numbers in the code below need to be changed.

Yep. The file_header.f_magic is 0x8664 (aka IMAGE_FILE_MACHINE_AMD64) on
64 bit, rather than 0x014c (aka IMAGE_FILE_MACHINE_I386).
file_optional_header.magic is 0x20b (IMAGE_NT_OPTIONAL_HDR64_MAGIC)
rather than 0x10b (IMAGE_NT_OPTIONAL_HDR32_MAGIC).  Didn't check for the
other values, but they are all documented and should be straightforward
if they have to be changed at all, see


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]