From: Melvin Blades <melvin.blades@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: removing unused functions during final link
Date: Wed, 27 Aug 2014 21:02:00 -0000 [thread overview]
Message-ID: <CAG=1SRt3jGm2invypb+qa_viFefd7_v9oq8bFs2ji72hvbcU1Q@mail.gmail.com> (raw)
I've inherited a pile of code and need to cross compile it for an
embedded MIPs processor
I'm creating a single app that will be run under Linux.
My app code links to another larger pile of third-party software (utilities)
My app uses only a part of the these utilities, but the final
executable is very large and includes utilities functions that are
never called.
My app also will dynamically link with uclibc
My compilation/linking results in an app so large that I can't load it
on my eval board.
What command line options can I use to get the linker to strip unused
functions from the final executable?
I've googled and came up with some proposed solutions
This one
https://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html
results in an error message .. -f may not be used without -shared
Other places say that the dead-strip option is architecture dependent.
http://embeddedfreak.wordpress.com/2009/02/10/removing-unused-functionsdead-codes-with-gccgnu-ld/
Where can I find out if the MIPS compiler supports this?
Or whether I just haven't used the correct command line options for
compiling and linking
next reply other threads:[~2014-08-27 21:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 21:02 Melvin Blades [this message]
2014-08-27 21:22 ` Ian Lance Taylor
2014-09-03 3:20 ` Melvin Blades
2014-09-03 10:21 ` Andrew Haley
2014-09-03 15:09 ` Melvin Blades
2014-09-03 15:13 ` Andrew Haley
2014-09-05 15:24 ` Melvin Blades
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='CAG=1SRt3jGm2invypb+qa_viFefd7_v9oq8bFs2ji72hvbcU1Q@mail.gmail.com' \
--to=melvin.blades@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).