+ -
当前位置:首页 → 问答吧 → Cygwin中的ld命令

Cygwin中的ld命令

时间:2011-02-06

来源:互联网

我在Windows上装了一个Cygwin程序。我先用NASM生成了elf32格式的目标文件a.o,但是使用ld命令链接后,用16进制查看器查看发现还是PE格式的,ld命令加上--oformat elf32-little参数还是不行,程序提示:cannot perform PE operations on non PE output file 'a.out'.
不知道这是不是Cygwin的原因,他把GCC移植到Windows后连自己的格式都不支持了吗?希望大家给出解决办法。

作者: deependeeper   发布时间: 2011-02-06

nasm -f obj test.asm ;
需要使用nasm生成obj文件,在源文件里start(程序入口地址)是不能忽略的!

作者: masmaster   发布时间: 2011-02-06