public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Binesh <bbinesh@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Qn regarding building an application of smallest size for ARM-11 using gcc
Date: Tue, 27 Jun 2006 04:22:00 -0000	[thread overview]
Message-ID: <e7c749a60606262122t422f1ad7y438ec07952fcd640@mail.gmail.com> (raw)

Hi,

We are trying to build an application for ARM-11 using gcc and the
related auto make suite) that would occupy minimal size.

After adding the -Os and -mthumb we noticed that the size of the
stripped executable with a dependency on libc.so and libz.so was about
87K.
However, when we statically linked it the stripped size grew to 510 K.
We removed all code that uses any of string library or stdio and
instead use only system calls such as ioctl, read, write, mmap and
munmap. (verified using the symbol dumped out by readelf)
Despite this the size remains at 510K.
Trying to link with -nostdlib fails as it refers to undefined
reference to ioctl, read, write, mmap and munmap.
Trying to link with -nostartfiles brought down the size to only 502K.

Do the sys call routines need std libs to be linked in?
Is there an alternative to reduce the size of the statically linked
exe? (Assuming that it might be difficult to migrate all code to asm)

Would appreciate some help / guidance on this. In case there is
another forum/ list which would better annswer these question, please
fwd me to the same.

Thanks!
-Binesh

             reply	other threads:[~2006-06-27  4:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27  4:22 Binesh [this message]
2006-06-27  6:18 ` Ingo Krabbe
2006-06-27  8:48   ` Andrew Haley

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=e7c749a60606262122t422f1ad7y438ec07952fcd640@mail.gmail.com \
    --to=bbinesh@gmail.com \
    --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).