Galaxy S23 Termux+Prooted Ubuntu环境下ARMv8-A汇编编译方法咨询
ARMv8-A架构下Termux嵌套Prooted Ubuntu环境中Hello World汇编编译问题
我是Galaxy S23手机用户,在Termux嵌套的Prooted Ubuntu环境中,编译ARMv8-A架构的Hello World汇编代码时遇到问题。
先通过gcc将hello.c生成汇编文件,再用as汇编、ld链接,出现如下报错:
ld: warning: cannot find entry symbol _start; defaulting to 00000000004000b0 ld: hello.o: in function main': hello.c:(.text+0x14): undefined reference to puts
之后尝试用nasm搭配不同格式和架构参数编译,使用的命令为:
$ nasm -f $format hello.s -o hello.o $ ld -m $architecture hello.o -o hello
但所有参数组合均无效,现咨询正确的Hello World汇编代码编译方法。
相关文件及尝试过的参数
hello.c代码
#include <stdio.h> int main(char **argv) { printf("Abc\n"); return(0); }
尝试过的架构参数
aarch63linux aarch64linux aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi
尝试过的格式参数
bin ith srec aout aoutb coff elf32 elf64 elfx32 as86 obj win32 win64 ieee macho32 macho64 dbg elf macho
内容的提问来源于stack exchange,提问作者user1389406
相关产品推荐
相关产品推荐

