It's due to linker option "--as-needed".
The flag tells the linker to link in the produced binary only the libraries containing symbols actually used by the binary itself.
We can benifit from the option for several reasons:
1) avoid linking extra libraries and improve startup time
2) avoid linking dependencies and etc.
But their is one disadvantage:
it may discard libraries when none of the symbols are used from it, thus mistakenly changing the initialization and deconstruction code paths.

本文探讨了使用链接器选项--as-needed的好处及潜在问题。该选项能避免链接额外的库,从而提高启动速度并减少依赖。然而,这也可能导致误删未直接使用的库,进而影响初始化和析构代码路径。

858

被折叠的 条评论
为什么被折叠?



