This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: removing unused functions during final link


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]