Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted
Updated 6-May-18 8:39am
Comments
Richard MacCutchan 6-May-18 11:39am    
mingw emulates linux, but only at the command level. The underlying programs still need to be PE types so they can run in Windows.
codeprojectddx 6-May-18 23:31pm    
I am writing an os .so the underlying progras does not exist. How to emulates linux at the command level
Richard MacCutchan 7-May-18 3:23am    
Install linux and use it native.
codeprojectddx 7-May-18 4:27am    
I have install linux and use it native .but for some reasons , I still want to use windows and bochs to debug . Bochs is useful and convenient to debug in windows .
Richard MacCutchan 7-May-18 5:07am    
Well that is your choice.

1 solution

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
 
Share this answer
 
Comments
codeprojectddx 6-May-18 23:33pm    
I am wandering elf enulator's work .Is it helpful to link and get an elf execute file ?
I am going to try the second approach

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900