This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: removing unused functions during final link
- From: Ian Lance Taylor <iant at google dot com>
- To: Melvin Blades <melvin dot blades at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 27 Aug 2014 14:22:03 -0700
- Subject: Re: removing unused functions during final link
- Authentication-results: sourceware.org; auth=none
- References: <CAG=1SRt3jGm2invypb+qa_viFefd7_v9oq8bFs2ji72hvbcU1Q at mail dot gmail dot com>
On Wed, Aug 27, 2014 at 2:02 PM, Melvin Blades <melvin.blades@gmail.com> wrote:
>
> What command line options can I use to get the linker to strip unused
> functions from the final executable?
Compile with -ffunction-sections -fdata-sections.
Link with -Wl,--gc-sections.
Ian