Re: Finding orphaned functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yan Seiner wrote:
I've got a huge app that's got a bunch of functions that are not used. I've found a few by hand but it's slow and tedious.

Is there some way to get gcc or helper app to tell me what and where they are?

You could try compiling all your source with -ffunction-sections, and then link with -Wl,--gc-sections.

This should omit all unused functions from the final executable.

You could then compare the symbols in the final executable (using nm) with the symbols in all the constituent object to see which were omitted.

David Daney

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux