Why is the startup of an App on linux slower when using shared libs?

后端 未结 6 1926
执笔经年
执笔经年 2021-01-23 05:11

On the embedded device I\'m working on, the startup time is an important issue. The whole application consists of several executables that use a set of libraries. Because space

6条回答
  •  花落未央
    2021-01-23 06:07

    One option which seems obvious to me, is to statically link the several programs all into a single binary. That way you continue to share as much code as possible (probably more than before), but you will also avoid the overhead of the dynamic linker AND save the space of having the dynamic linker on the system at all.

    It's pretty easy to combine several executables into the same one, you normally just examine argv and decide which routine to call based on that.

提交回复
热议问题