Can LD give warnings about the non-static functions defined but never used explicitly?

Pan ruochen panruochen@gmail.com
Wed Nov 26 02:04:00 GMT 2008


> 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



More information about the Binutils mailing list