www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/28/13:16:40

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Can I split my EXE-file into a EXE-file and a OBJ-file?
Date: Sat, 28 Mar 1998 13:09:39 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 38
Message-ID: <351D3CE3.7226@cs.com>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19980328114547 DOT 007a76c0 AT vip DOT cybercity DOT dk>
NNTP-Posting-Host: ppp217.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Nils Emil P. Larsen wrote:
> 
> Can I split my EXE-file into a EXE-file and a OBJ-file?
> It may be possible to move data from the EXE-file to a OBJ-file. I don't
> care about the size of the OBJ, but I don't like that EXE-files are
> greather than 50 KB.

What you may be asking is if DJGPP supports shared libraries or DLLs. 
The general answer is no; however, there are several projects in the
works right now to provide the equivalent of DLLs.  As it stands, there
are no plans to allow DJGPP to support shared libraries, which are
fairly useless anyway in a single-tasking environment.

Your complaint seems to be more related to the final size of DJGPP
executables.  The DJGPP Frequently Asked Questions list discusses this
topic in detail in chapter 8.15; basically, what you get for all those
extra bytes is the code that loads DPMI, installs interrupt handlers,
globs the command line, reads the environment, and much more.  There's a
lot of overhead involved in running a protected mode app!

Even if you could break out the library code and put it in a separate
object file or DLL-equivalent, you'd still be stuck with all the startup
code which makes up 40-50K of that executable.  There are, however, ways
to reduce the size of the executable if you don't need some of the
startup code's functionality; they are discussed in detail in chapter
8.15 of the FAQ.  Using them, a basic "hello, world" program can be
reduced to as little as 20K or so.

If you want small programs, you should use Turbo C.  DJGPP is for
power.  :-)

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Animals can be driven crazy by pla- |
|       aka Fighteer I       | cing too many in too small a pen.    |
|   mailto:fighteer AT cs DOT com   | Homo sapiens is the only animal that |
| http://www.cs.com/fighteer | voluntarily does this to himself."   |
---------------------------------------------------------------------

- Raw text -


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