Pack shared libraries into the elf

2019-01-08 13:02发布

Is there a utility that can take ALL the SO's that an Elf needs turn them into static then converts the Elf to be SO's free?

5条回答
老娘就宠你
2楼-- · 2019-01-08 13:25

Here are some projects you might find useful:

  • Statifier (basically does what you want)
  • ERESI (might do what you want, also allows for analysis of ELF targets)

NOTE: I've not used either application myself.

查看更多
Explosion°爆炸
3楼-- · 2019-01-08 13:30

You can link with -static at compile time. Are you looking to do this post-compile?

查看更多
Luminary・发光体
4楼-- · 2019-01-08 13:32

Statifier is an option. Another option is Ermine. While Ermine is commercial it behaves better than statifier on systems with memory randomization.

查看更多
Deceive 欺骗
5楼-- · 2019-01-08 13:38

Probably not, though in theory, no doubt, it could be done.

One aspect to be aware of - the typical program will not be using all the code from a given SO, so blindly including all the material in each SO would give you a grotesquely bloated executable. A classic static link only includes that which is needed.

Another aspect to be aware of would be C++ template instantiation. I assume that these would mainly appear in the executable already (not as part of an SO).

查看更多
家丑人穷心不美
6楼-- · 2019-01-08 13:39

I've used Statifier as mentioned by codelogic.

It worked well for several Linux commands like ethtool.

查看更多
登录 后发表回答