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

后端 未结 6 1870
执笔经年
执笔经年 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 05:57

    This may help others with similar problems:

    The reason why startup took so long in my case was, that the default setting of the GCC is to export all symbols inside of a library. A big improvement is to set a compiler setting "-fvisibility=hidden".

    All symbols that the lib has to export have to be augmented with the statement

    __attribute__ ((visibility("default")))

    see gcc wiki
    and the very fine article how to write shared libraries

提交回复
热议问题