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

Pan ruochen panruochen@gmail.com
Thu Nov 27 02:37:00 GMT 2008


> If you are using your own linker script, which is likely given that you have
> this special section, then you can use the KEEP linker script directive to
> ensure that this section is not removed when the linker performs its garbage
> collection.
>
> Cheers
>  Nick
>

Still one more question. I rebuilt all my projects with
-ffunction-sections and got a lot of `multiple definition' errors. The
reason for these errors is that some common variables are defined in
header files in the project. Though linking with `-z muldefs' is one
solution, I don't think it is a good choice since this option may
ignore real `multiple definition' errors. So is there some other
solution by which least source code must to be fixed.

BTW, I use '-Map` to print the linking map to a map file. But I don't
find any information about data or functions removed by LD.

Best Regards,
PRC
Nov 27, 2008



More information about the Binutils mailing list