【问题标题】:Trying to run assembly program in termux but it's shows same error again n again [closed]尝试在 termux 中运行汇编程序,但它再次显示相同的错误 [关闭]
【发布时间】:2023-01-11 03:31:29
【问题描述】:

hello.s

nasm -f elf64 -o 你好.o 你好.s

你好你好

ld hello.o -o 你好

ld: hello.o: 通用 ELF 中的重定位 (EM: 62) ld: hello.o: 添加符号时出错:文件格式错误

【问题讨论】:

标签: termux


【解决方案1】:

我希望这可以帮助您解决问题。 您可以使用 ld.lld 而不是 ld

所以你可以运行的命令如下:

$ nasm -f elf hello.asm
$ ld.lld -m elf_i386 -s -o hello hello.o
$ qemu-i386 hello
Hello, world!

参考:https://github.com/termux/termux-app/discussions/3173#discussioncomment-4624316

【讨论】:

    猜你喜欢
    • 2021-10-14
    • 1970-01-01
    • 2015-08-01
    • 2018-10-21
    • 2022-06-10
    • 2019-02-14
    • 2022-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多