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?


> 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
>

One more question. I have some data stored in a special section. These
data are not referenced within the program but these data are useful
to an external loader. In this case, how to let LD know the data are
`used' and keep them on linking.

Best Regards
PRC
Nov 26, 2008


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