Linux的用户空间ELF装载机 [英] Linux user-space ELF loader

查看:263
本文介绍了Linux的用户空间ELF装载机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做的是相当不寻常的事情:手动执行ELF可执行文件。即加载所有节到正确的地方,查询main()和调用它(和清理的话)。可执行文件将静态链接的,所以也就没有必要链接库。我也控制基址,所以没有对可能发生的冲突的担忧。

I need to do a rather unusual thing: manually execute an elf executable. I.e. load all sections into right places, query main() and call it (and cleanup then). Executable will be statically linked, so there will be no need to link libraries. I also control base address, so no worries about possible conflicts.

那么,有没有用于任何库?

So, is there are any libraries for that?

我发现的OSKit及其liboskit_exec,但项目好像是死了自2002年以来。

I found OSKit and its liboskit_exec, but project seems to be dead since 2002.

我和采取部分项目(尊重许可证,当然),并剪裁到我的需要确定,但我在Linux世界相当小白,我不知道在哪里可以找到这些部件! :)

I'm OK with taking parts of projects (respecting licenses, of course) and tailoring them to my need, but as I'm quite a noob in the linux world, I dont even know where to find those parts! :)

PS。我需要的,对于ARM平台。

PS. I need that for ARM platform.

UPD 好了,装的精灵之事似乎需要一些关于它的良好的知识(叹气),所以我出去看了一些规范和手册。我想我会坚持仿生/连接器和libelfsh。多谢你们!

UPD Well, the matter of loading elfs seems to require some good knowledge about it (sigh), so I'm out to read some specs and manuals. And I think I will stick to bionic/linker and libelfsh. Thanks guys!

总结发现:

  • libelf: http://directory.fsf.org/project/libelf/
  • elfsh and libelfsh (are now part of eresi): http://www.eresi-project.org/
  • elfio (another elf library): http://sourceforge.net/projects/elfio/
  • OSKit and liboskit_exec (outdated): http://www.cs.utah.edu/flux/oskit/
  • bionic/linker: http://android.git.kernel.org/?p=platform/bionic.git

推荐答案

快速的apt-缓存搜索提示 libelf1 libelfg0 和/或 libelfsh0 。我觉得 elfsh 程序(在同名包)可能是如何利用一个有趣的实例 libelfsh0

A quick apt-cache search suggests libelf1, libelfg0 and/or libelfsh0. I think the elfsh program (in the namesake package) might be an interesting practical example of how to use libelfsh0.

我还没有尝试过自己,但我希望他们可能会有所帮助。祝你好运: - )

I haven't tried any myself, but I hope they might be helpful. Good luck :-)

这篇关于Linux的用户空间ELF装载机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆