delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/02/12:32:59

From: cnelson <cnelson AT sandia DOT gov>
Newsgroups: comp.os.msdos.djgpp
Subject: Files created by gcc/g77
Date: Thu, 02 Aug 2001 15:53:25 +0100
Organization: Sandia National Laboratories
Lines: 19
Message-ID: <3B6906F5.98FAB93A@sandia.gov>
NNTP-Posting-Host: saix9634.sandia.gov
Mime-Version: 1.0
X-Mailer: Mozilla 4.61 [en]C-CCK-MCD SNL4.x (Win95; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

If you compile a program with
	gcc hello.c
you get 2 files, "a.out" and "a.exe", that are not identical.  What are
these 2 files and how are they related?  My best guess is:
- a.out is a raw COFF file
- a.exe is the DOS executable (a.out with a 2048 byte DJGPP DOS stub)

Now if you compile using a command from a UNIX makefile
	gcc -o a hello.c
you get 2 files "a" and "a.exe".  What is "a"?  It is the same size as
"a.out" but they are not identical.

In fact, if you compile a program twice the "right" way
	gcc -o a.exe hello.c
even the "a.exe" files are not identical.  Why is this?  Is there
uninitialized space in the files that gets filled with random bits?

Thanks in advance for satisfying my curiosity.
Curt Nelson

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019