assembly compile target in termux + prooted ubuntu in galaxy android

86 Views Asked by At

Hi assembly programmers,

I am a newbie using Galaxy Handphone S23 and want to compile hello-world assembly code in termux-prooted-ubuntu environment. I checked to find CPU architecture is armv8-a.

---[hello.c]--- #include <stdio.h>

int main(char \*\*argv)
{
printf("Abc\\n");
return(0);
}

---[commands]---

gcc hello.c -S
as hello.s -o hello.o
ld hello.o -o hello

---[output]---

ld: warning: cannot find entry symbol \_start; defaulting to 00000000004000b0
ld: hello.o: in function main': hello.c:(.text+0x14): undefined reference to puts

---[Question]--- Question is "what is right way to compile hello world assembly code ?"

Thank you.

I tried other options using :

nasm with different format and architecture
command is :
$ nasm -f $format hello.s -o hello.o
$ ld   -m $architecture hello.o -o hello

but no combination is working.

---[Architecture]---

aarch63linux
aarch64linux
aarch64elf
aarch64elf32
aarch64elf32b
aarch64elfb
armelf
armelfb
aarch64linuxb
aarch64linux32
aarch64linux32b
armelfb_linux_eabi
armelf_linux_eabi

---[format]---


bin
ith
srec
aout
aoutb
coff
elf32
elf64
elfx32
as86
obj
win32
win64
ieee
macho32
macho64
dbg
elf
macho
0

There are 0 best solutions below