Pack shared libraries into the elf

╄→гoц情女王★ 提交于 2019-12-17 08:53:52

问题


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?


回答1:


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.




回答2:


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




回答3:


I've used Statifier as mentioned by codelogic.

It worked well for several Linux commands like ethtool.




回答4:


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).




回答5:


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



来源:https://stackoverflow.com/questions/386579/pack-shared-libraries-into-the-elf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!