This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Can LD give warnings about the non-static functions defined but never used explicitly?


Pan ruochen wrote:
Hi All,

Can LD give warnings about the non-static functions defined but never
used explicitly? I want to optimize the code size by removing those
unused functions.


Compile your code with -ffunction-sections -fdata-sections.


Then link with -Wl,--gc-sections

In theory, that should eliminated unreferenced functions and data objects from the final object.

David Daney


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