Hello peeps,
I'm trying to create binary from x86 code [.S extension] on Apple Mac [2.3 GHz Dual-Core Intel Core i5 processor]. Im getting .o file without any errors. But I couldn't generate binary file from object file.
command used and error received:
$ clang -o example example.o ld: Undefined symbols: _main, referenced from: <initial-undefines> clang: error: linker command failed with exit code 1 (use -v to see invocation)
Piece of code I used to create .o file:
.intel_syntax noprefix
_main: xor rax, rax
xor rcx, rcx
test rdi, rdi
Any suggestions please.. PS: I have tried using ld as well, it gives me same error.