public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joshua Nye" <josh@boxcarmedia.com>
To: "Michiel Buddingh'" <ajuin+mail@stack.nl>, <gcc-help@gcc.gnu.org>
Subject: Re: Giant executables.. what am I doing wrong?
Date: Mon, 14 Oct 2002 17:08:00 -0000	[thread overview]
Message-ID: <003d01c273de$f0768bb0$0100a8c0@windows9q3yn19> (raw)
In-Reply-To: <20021014234939.GA35014@stack.nl>

Are you sure you want to create a static executable? If you are trying to
save memory, shared executables are probably better. With shared executables
the C library will get loaded into memory once and can be used by multiple
programs at the same time. Static programs will eat up more memory by
loading effectively multiple copies of the C library, one for each program
running.

--josh

----- Original Message -----
From: "Michiel Buddingh'" <ajuin+mail@stack.nl>
To: <gcc-help@gcc.gnu.org>
Sent: Monday, October 14, 2002 7:49 PM
Subject: Giant executables.. what am I doing wrong?


> I'm currently trying to write a program for a linux system with limited
> memory, and as such I'd like gcc to generate small, statically linked
> executables.
>
> However, if I compile even a simple program like:
>
> int main() { write(2,"Hello world.\n", 13); return 0; }
>
> with the --static option, then strip it with "--strip-all" I get a
> program worth 332 kB(!).
>
> Needless to say, this is not exactly what I want.
>
> I have tried both gcc 2.95 and gcc 3.2, but the results differ only by
> a few bytes.
>
> Am I missing something really obvious here?
> --
> -- Michiel
>


  reply	other threads:[~2002-10-15  0:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14 16:49 Michiel Buddingh'
2002-10-14 17:08 ` Joshua Nye [this message]
2002-10-14 17:21   ` Michiel Buddingh'
2002-10-14 17:35     ` Joshua Nye
2002-10-14 18:50       ` Michiel Buddingh'
2002-10-15  2:38         ` Claudio Bley
2002-10-15  5:15           ` Michiel Buddingh'
2002-10-15  5:12         ` Joshua Nye
2002-10-15  5:19           ` Joshua Nye
2002-10-15  5:20           ` Michiel Buddingh'
2002-10-15  3:53 ` Steve Dondley
2002-10-15  4:15   ` Claudio Bley
2002-10-15  5:09   ` Michiel Buddingh'
2002-10-14 19:00 Dockeen
2002-10-15  5:31 Ruppert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003d01c273de$f0768bb0$0100a8c0@windows9q3yn19' \
    --to=josh@boxcarmedia.com \
    --cc=ajuin+mail@stack.nl \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).