c_mnon
c_mnon

Reputation: 388

Compiling assembly code for aarch64

I have generated an assembly file try.s with aarch64 instruction set.I want to compile this on an ARM8 (aarch64 processor) running ubuntu. my native compiler is gcc(4.8) and i use the following command to compile

gcc -o try.o try.s

I am getting the following errors Error : ARM register expected -- mov x10,x0

It seems like the aarch4 registers are not being recognized although i thought gcc 4.8 supported aarch64. Can someone tell me what am i missing or is there any special option i should include.Or suggest me a native compiler(not cross-compilers) for doing aarch64.I would also like to use gdb to debug this natively.

Upvotes: 2

Views: 4946

Answers (1)

user3124812
user3124812

Reputation: 1976

gcc is for a 32b targets. 'Xn' registers are not defined for a aarch32 instruction set. That's what compiler tells you.


Right toolchain is aarch64-elf-gcc.

PS: that's a good idea to make asm file extention .S (capital s)

Upvotes: 1

Related Questions