|Subject:||Re: Re: Ask for helping about LD linker|
|Date:||Mon, 2 Jun 2008 16:44:11 +0800|
I see, thank you so much.
发件人： Nick Clifton
发送时间： 2008-06-02 16:32:40
主题： Re: Ask for helping about LD linker
> But how to remove the unused functions in system library(maybe compile
> the system library without --funciton-sections) when linking program.
Short Answer: It cannot be done.
If you are linking against a *shared* library then you will not be able
to remove any functions in the shared library. (Nor would you want to -
other programs may need those functions).
If you are linking against a *static* system library (which has not been
compiled with --ffunction-sections), then unused functions should not
normally be copied into the executable. The exception is when an unused
function is in the same object file inside the library as a used
function (or used global symbol). Ie the linker only discards code at
the object file level. If some part of an object file inside a static
library is needed by the executable then the entire contents of that
object file will be copies into the executable.
|[Prev in Thread]||Current Thread||[Next in Thread]|