如何链接elf对象文件并在Windows中获取elf执行文件? [英] How can I link elf object file and get elf execute file in windows?

查看:134
本文介绍了如何链接elf对象文件并在Windows中获取elf执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在Windows中获得一个elf exccute文件,就像在Linux中使用ld命令一样。



我尝试过:



我安装了mingw工具。现在我可以补充并获取elf obj文件,但是当我使用ld链接obj文件时,我得到的PE文件不是我期望的elf文件。我可以使用ld来生成elf执行文件吗?

解决方案

我可以通过两种方式看到:

1.使用用于Windows的ELF模拟器,如下所示: Elf Emulator [ ^ ]

2.安装CYGWIN并使用它在Windows上从源代码重建可执行文件

I want to get a elf exccute file in windows just like in linux to use ld command .

What I have tried:

I have installed mingw tools . Now I can comple and get elf obj file ,but when I use ld to link the obj file ,I get a PE file not elf file that I expect. Which paras can i use ld to generate the elf execute file?

解决方案

There are two ways I can see:
1. Using an ELF emulator for Windows, like this: Elf Emulator[^]
2. Installing CYGWIN and rebuild the executable from source on Windows using it


这篇关于如何链接elf对象文件并在Windows中获取elf执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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