【问题标题】:nasm array1.o: file not recognized: File format not recognized on Linux 32nasm array1.o:文件无法识别:Linux 32 上无法识别文件格式
【发布时间】:2014-12-04 04:04:10
【问题描述】:

我现在使用的 BACKTRACK 5 几乎就像 ubuntu,一个 debian 和它的 32 位,我安装了 nasm,我去找了博士。 paulcarter 的汇编语言教程并下载了他的示例程序 (Linux)。我去了示例程序所在的目录并执行了以下指令

~/Desktop/linux-ex# nasm -f coff array1.asm

~/Desktop/linux-ex# gcc -o array1 array1.o array1c.c

array1.o:文件无法识别:文件格式无法识别 collect2: ld 返回 1 个退出状态

以上执行指令已在源文件cmets中提供 我怎样才能使这些以及以后我自己的程序工作?

【问题讨论】:

  • 'coff' 格式不是 Windows 的东西吗?
  • 使用nasm -felf array1.asm 或下载objconv 并执行objconv -felf32 array1.o

标签: linux assembly nasm


【解决方案1】:

Linux 内核支持各种二进制格式。 coff 是一个特别古老的,如果内核仍然支持它,它可能不会在现代发行版中启用。试试-f elf 而不是-f coff

【讨论】:

  • 对。 Nasm 的-f coff 是给 D.J. Delorie 的 32 位 DOS 扩展 DJGPP(甚至不是 MS-coff)。 -f elf(或-f elf32 - 相同)应该就在这里。
猜你喜欢
  • 1970-01-01
  • 2018-02-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-13
  • 2013-06-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多